Video decoding method, video encoding method, related equipment and storage medium

By using pixels in the historical decoding unit adjacent to the current encoding unit as reference pixels in video encoding and decoding, and using unit vector strings in intra string copy mode, the problem of limited application range of unit vector strings is solved, which improves the Codec performance.

CN114615498BActive Publication Date: 2024-11-19TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011416242.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-05
Publication Date
2024-11-19
Estimated Expiration
2040-12-05

AI Technical Summary

Technical Problem

In the existing video encoding and decoding technology, the scope of application of unit vector strings is limited, which affects the encoding and decoding performance.

Method used

During the video encoding and decoding process, pixels in the historical decoding unit adjacent to the current encoding unit are allowed to be used as reference pixels, expand the scope of application of unit vector strings, and use unit vector strings in the intra string copy mode.

Benefits of technology

Effectively widen the scope of application of unit vector strings, improve encoding and decoding performance, and improve encoding and decoding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114615498B_ABST
    Figure CN114615498B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a video decoding method, a video encoding method, related equipment and a storage medium, wherein the video decoding method comprises: determining a current string to be decoded from a current encoding unit of a current image; if the current string is a unit vector string and the current string includes a first pixel, determining a reference pixel of the first pixel from a historical decoding unit in the current image; the historical decoding unit refers to a decoded encoding unit adjacent to the current encoding unit in the current image, and the reference pixel corresponding to the first pixel is adjacent to the first pixel in the current image; obtaining a predicted value of the first pixel according to a reconstructed value of the reference pixel of the first pixel to obtain a decoded image. The embodiment of the present invention can effectively broaden the scope of application of the unit vector string and help improve encoding and decoding performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, specifically to the field of image processing technology, and in particular to a video decoding method, a video encoding method, a video decoding device, a video encoding device, a computer device and a computer storage medium. Background Art

[0002] In video coding and decoding technology, the encoder usually divides the frame image contained in the video into multiple coding units, and obtains the code stream data of the frame image by encoding each coding unit, and then transmits the code stream data to the decoder. Correspondingly, after receiving the code stream data, the decoder usually performs decoding operations in units of coding units to obtain a decoded image.

[0003] With the development of coding and decoding technology, the concept of unit vector string has been proposed; unit vector string has received widespread attention due to its advantage of low implementation complexity. Research has shown that: At present, the existing related technologies only use the unit vector string in the equivalent string and unit vector string sub-mode included in the intra-frame string replication coding mode; and when encoding and decoding the coding unit based on the unit vector string, only the pixels inside the coding unit can be referenced. This coding and decoding method restricts some strings in the coding unit (such as the string in the first row) from becoming unit vector strings. It can be seen that the existing related technologies limit the scope of application of unit vector strings to a certain extent, thereby affecting the coding and decoding performance. Summary of the invention

[0004] The embodiments of the present invention provide a video decoding method, a video encoding method, related devices and a storage medium, which can effectively expand the application scope of unit vector strings and help improve encoding and decoding performance.

[0005] On the one hand, an embodiment of the present invention provides a video decoding method, the method comprising:

[0006] Determining a current string to be decoded from a current coding unit of a current image;

[0007] If the current string is a unit vector string and the current string includes a first pixel, determining a reference pixel of the first pixel from a historical decoding unit in the current image; the historical decoding unit refers to a decoded coding unit adjacent to the current coding unit in the current image, and the reference pixel corresponding to the first pixel is adjacent to the first pixel in the current image;

[0008] A predicted value of the first pixel is obtained according to a reconstructed value of a reference pixel of the first pixel to obtain a decoded image.

[0009] On the other hand, an embodiment of the present invention provides a video encoding method, the method comprising:

[0010] Determining a current string to be encoded from a current encoding unit of a current image;

[0011] If the current string is a unit vector string and the current string includes a first pixel, determining a reference pixel of the first pixel from a historical coding unit in the current image; the historical coding unit refers to an encoded coding unit adjacent to the current coding unit in the current image, and the reference pixel corresponding to the first pixel is adjacent to the first pixel in the current image;

[0012] A prediction value of the first pixel is obtained according to a reconstructed value of a reference pixel of the first pixel to obtain encoding information of the current encoding unit.

[0013] In another aspect, an embodiment of the present invention provides a video decoding device, the device comprising:

[0014] An acquisition unit, used to determine a current string to be decoded from a current coding unit of a current image;

[0015] a decoding unit, configured to, if the current string is a unit vector string and the current string includes a first pixel, determine a reference pixel of the first pixel from a historical decoding unit in the current image; the historical decoding unit refers to a decoded coding unit adjacent to the current coding unit in the current image, and the reference pixel corresponding to the first pixel is adjacent to the first pixel in the current image;

[0016] The decoding unit is further used to obtain a predicted value of the first pixel according to a reconstructed value of a reference pixel of the first pixel to obtain a decoded image.

[0017] In another aspect, an embodiment of the present invention provides a video encoding device, the device comprising:

[0018] An acquisition unit, used to determine a current string to be encoded from a current encoding unit of a current image;

[0019] a coding unit, configured to determine, if the current string is a unit vector string and the current string includes a first pixel, a reference pixel of the first pixel from a historical coding unit in the current image; the historical coding unit refers to an encoded coding unit adjacent to the current coding unit in the current image, and the reference pixel corresponding to the first pixel is adjacent to the first pixel in the current image;

[0020] The encoding unit is further used to obtain a predicted value of the first pixel according to a reconstructed value of a reference pixel of the first pixel, so as to obtain encoding information of the current encoding unit.

[0021] In another aspect, an embodiment of the present invention provides a computer device, the computer device comprising an input interface and an output interface, the computer device further comprising:

[0022] a processor adapted to implement one or more instructions; and,

[0023] A computer storage medium storing one or more first instructions, wherein the one or more first instructions are suitable for being loaded by the processor and executing the following steps:

[0024] Determining a current string to be decoded from a current coding unit of a current image;

[0025] If the current string is a unit vector string and the current string includes a first pixel, determining a reference pixel of the first pixel from a historical decoding unit in the current image; the historical decoding unit refers to a decoded coding unit adjacent to the current coding unit in the current image, and the reference pixel corresponding to the first pixel is adjacent to the first pixel in the current image;

[0026] A predicted value of the first pixel is obtained according to a reconstructed value of a reference pixel of the first pixel to obtain a decoded image.

[0027] Alternatively, the computer storage medium stores one or more second instructions, and the one or more second instructions are suitable for being loaded by the processor and executing the following steps:

[0028] Determining a current string to be encoded from a current encoding unit of a current image;

[0029] If the current string is a unit vector string and the current string includes a first pixel, determining a reference pixel of the first pixel from a historical coding unit in the current image; the historical coding unit refers to an encoded coding unit adjacent to the current coding unit in the current image, and the reference pixel corresponding to the first pixel is adjacent to the first pixel in the current image;

[0030] A prediction value of the first pixel is obtained according to a reconstructed value of a reference pixel of the first pixel to obtain encoding information of the current encoding unit.

[0031] On the other hand, an embodiment of the present invention provides a computer storage medium, wherein the computer storage medium stores one or more first instructions, and the one or more first instructions are suitable for being loaded by a processor and executing the above-mentioned video decoding method; or, the computer storage medium stores one or more second instructions, and the one or more second instructions are suitable for being loaded by a processor and executing the above-mentioned video encoding method.

[0032] In the process of encoding and decoding, in the embodiment of the present invention, when the current string of the current coding unit is a unit vector string, and the current string includes the first pixel (such as the pixel of the first row in the current coding unit or the pixel of the first column in the current coding unit, etc.), the reference pixel of the first pixel can be determined from the historical decoding unit in the current image, and the prediction value of the first pixel can be obtained according to the reconstructed value of the reference pixel to realize the encoding and decoding processing. It can be seen that the embodiment of the present invention allows the use of pixels in the historical decoding units adjacent to the current coding unit as reference pixels, so that any string in the current coding unit can become a unit vector string, which can effectively broaden the scope of application of the unit vector string and help improve the encoding and decoding performance. In addition, the prediction coding mode adopted by the embodiment of the present invention for the current coding unit is not limited to the equivalent string and the unit vector string sub-mode, but can also be other prediction coding modes such as the string prediction sub-mode in the intra-frame string copy mode; that is, the embodiment of the present invention allows the coding unit under the string prediction sub-mode to use the unit vector string, which can further broaden the scope of application of the unit vector string and improve the coding performance of the string prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0034] Figure 1a is a schematic diagram of the architecture of an image processing system provided by an embodiment of the present invention;

[0035] Figure 1b is a schematic diagram of dividing an image into multiple coding units provided by an embodiment of the present invention;

[0036] Figure 1c This is a basic working flow diagram of a video encoder provided by an embodiment of the present invention;

[0037] Figure 1d is a schematic diagram of multiple intra-frame prediction modes provided by an embodiment of the present invention;

[0038] Figure 1eis a schematic diagram of an angle prediction mode in an intra-frame prediction mode provided by an embodiment of the present invention;

[0039] Figure 1f is a schematic diagram of inter-frame prediction provided by an embodiment of the present invention;

[0040] Figure 1g is a schematic diagram of an intra-frame block copy provided by an embodiment of the present invention;

[0041] Figure 1h is a schematic diagram of a range of reference pixels for intra-frame block copying provided by an embodiment of the present invention;

[0042] Figure 1i is a schematic diagram of an intra-frame string replication provided by an embodiment of the present invention;

[0043] Figure 1j is a schematic diagram of an intra-frame string replication with string length resolution control provided by an embodiment of the present invention;

[0044] Figure 2 is a flow chart of a video encoding method provided by an embodiment of the present invention;

[0045] Figure 3a is a schematic diagram of a scanning mode provided by an embodiment of the present invention;

[0046] Figure 3b is an orientation diagram for a current coding unit provided by an embodiment of the present invention;

[0047] Figure 4 It is a flowchart of a video decoding method provided by an embodiment of the present invention;

[0048] Figure 5 is a structural schematic diagram of a video encoding device provided by an embodiment of the present invention;

[0049] Figure 6 is a structural schematic diagram of a video decoding device provided by an embodiment of the present invention;

[0050] Figure 7 It is a structural schematic diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0051] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0052] In an embodiment of the present invention, it relates to an image processing system; see Figure 1aAs shown, the image processing system at least includes: a video encoding device 11 and a video decoding device 12. The video encoding device 11 may include at least a video encoder, which can be used to perform an encoding process on the image in the video signal to obtain a code stream; correspondingly, the video decoding device 12 may include at least a video decoder, which can be used to perform a decoding process on the code stream to obtain a reconstructed image corresponding to the image in the video signal. The video signals mentioned here can be divided into two methods, namely, those captured by a camera and those generated by a computer, based on the signal acquisition method. Due to different statistical characteristics, the corresponding compression encoding methods may also be different.

[0053] The current mainstream video coding standards, such as the international video coding standards HEVC (High Efficiency Video Coding, high-performance video coding standard), VVC (Versatile Video Coding, multi-functional video coding standard), and China's national video coding standard AVS3 (Audio Video Coding Standard 3), all use a hybrid coding framework to compress video data by dividing the images in the original video signal into a series of CUs (Coding Units), combined with video coding methods such as prediction, transformation and entropy coding. Specifically, these mainstream video coding standards perform the following series of operations and processing on the images in the input original video signal:

[0054] 1) Block partition structure: The input image is divided into several non-overlapping processing units, each of which performs similar compression operations. This processing unit is called CTU (Coding Tree Unit) or LCU (Largest Coding Unit). Below CTU or LCU, more detailed divisions can be performed to obtain one or more basic coding units, called CUs. For example, the processing unit is LCU, and the schematic diagram of further dividing the corresponding LCU into several CUs according to the characteristics of each LCU can be seen in Figure 1b As shown; it should be understood that Figure 1b The LCU division method is only exemplified and does not limit it. Figure 1b It means that the LCU is evenly divided into multiple CUs, but in practice, the LCU can also be unevenly divided into multiple CUs. Each CU is the most basic element in a coding link, and each CU can be independently encoded and decoded using a predictive coding mode.

[0055] 2) Predictive Coding: Current video coding technologies include multiple predictive coding modes such as intra-frame prediction mode and inter-frame prediction mode. The encoder needs to select the most suitable predictive coding mode for the current CU from among many possible predictive coding modes and inform the decoder. Then, the encoder uses the selected predictive coding mode to perform predictive coding on the current CU; after the current CU is predicted by the selected reconstructed video signal, a residual video signal is obtained.

[0056] ① Intra-frame prediction mode: the predicted signal comes from the area that has been encoded and reconstructed in the same image;

[0057] ②Inter-frame prediction mode: The predicted signal comes from other images that have been encoded and are different from the current image (called reference images).

[0058] 3) Transform coding and quantization (Transform & Quantization): The residual video signal is transformed into the transform domain through transformation operations such as DFT (Discrete Fourier Transform) and DCT (Discrete Cosine Transform), which are called transform coefficients. The residual video signal in the transform domain is further subjected to lossy quantization operations, which loses certain information, making the quantized signal conducive to compression expression. Since there may be more than one transform mode to choose from in some video coding standards, the encoder also needs to select one of the transform modes for the current CU and inform the decoder. Among them, the degree of quantization is usually determined by QP (Quantization Parameter); when the QP value is large, the coefficients representing a larger value range will be quantized to the same output, which usually results in greater distortion and lower bit rate; on the contrary, when the QP value is small, the coefficients representing a smaller value range will be quantized to the same output, which usually results in less distortion and a higher bit rate.

[0059] 4) Entropy Coding or Statistical Coding: The quantized transform domain signal will be statistically compressed and encoded according to the frequency of occurrence of each value, and finally output as a binary (0 or 1) compressed bit stream. At the same time, other information is encoded; such as the selected mode, motion vector, etc., which also need to be entropy encoded to reduce the bit rate. Among them, statistical coding is a lossless coding method that can effectively reduce the bit rate required to express the same signal; common statistical coding methods include variable length coding (VLC) or context-based adaptive binary arithmetic coding (CABAC), etc.

[0060] 5) Loop Filtering: The encoded image can be reconstructed into a decoded image after undergoing inverse quantization, inverse transformation and prediction compensation (the reverse operation of the above step 2) - step 4). Compared with the original image, the reconstructed decoded image has some information that is different from the original image due to the influence of quantization, which will cause distortion. Therefore, a filter can be used to filter the reconstructed decoded image, such as deblocking filter, SAO (Sample Adaptive Offset) or ALF (Adaptive Loop Filter), which can effectively reduce the degree of distortion caused by quantization. Since these reconstructed decoded images after filtering will be used as a reference for subsequent encoded images and for predicting future signals, the above filtering operation is also called loop filtering, and the filtering operation in the encoding loop.

[0061] Based on the above descriptions of steps 1) to 5), Figure 1c The basic working process diagram of a video encoder is shown as an example; Figure 1c Take the kth CU (labeled as s k [x, y]) is used as an example for illustration, where k is a positive integer greater than or equal to 1 and less than or equal to the number of CUs in the input current image. k [x, y] represents the pixel point (referred to as pixel) with coordinates [x, y] in the kth CU, where x represents the horizontal coordinate of the pixel and y represents the vertical coordinate of the pixel. k [x, y] is obtained by a better processing such as motion compensation or intra-frame prediction to obtain a prediction signal s k [x, y] and Subtract to get the residual signal u k[x, y], and then the residual signal u k [x, y] is transformed and quantized. The quantized output data has two different destinations: one is sent to the entropy encoder for entropy encoding, and the encoded code stream is output to a buffer for storage and waiting to be transmitted; the other is dequantized and inversely transformed to obtain the signal u' k [x, y]. Transform the signal u' k [x, y] and Add together to get the new prediction signal s * k [x, y], and s * k [x, y] is sent to the current image buffer for storage. * k [x, y] is predicted by intra-frame-image prediction to obtain f(s * k [x, y]).s * k [x, y] is obtained after loop filtering to obtain s' k [x, y], and s' k [x, y] is sent to the decoded image buffer for storage to generate the reconstructed image. s' k [x, y] is obtained after motion-compensated prediction s' r [x+m x ,y+m y ], the s' r [x+m x ,y+m y ] represents the reference block; where m x and m y They represent the horizontal and vertical components of the motion vector (MV) respectively.

[0062] According to the description of the encoding process above, it can be seen that: at the decoding end, for each CU, after the video decoder obtains the compressed code stream, it needs to first perform entropy decoding to obtain various mode information (such as prediction coding mode information) and quantized transform coefficients, so that each coefficient can be dequantized and inversely transformed to obtain a residual signal. On the other hand, based on the known prediction coding mode information, the prediction signal corresponding to the CU (that is, the prediction value of each pixel in the CU) can be obtained. After adding the two (that is, the residual signal and the prediction signal), the reconstructed signal (that is, the reconstructed image) can be obtained. Finally, the reconstructed signal needs to undergo a loop filtering operation to generate the final output signal (that is, the decoded image obtained by the final decoding).

[0063] It should be noted that, with the different video coding standards actually adopted, the prediction coding modes involved in the above coding process will also have certain differences. Among them, the prediction coding modes used in AVS3 may include: intra-frame prediction mode, inter-frame prediction mode, intra-frame block copy prediction mode, intra-frame string copy mode, etc. When using AVS3 for encoding, these prediction coding modes can be used alone or in combination; the following will introduce each prediction coding mode separately:

[0064] (I) Intra-frame prediction mode:

[0065] Intra-frame prediction mode is a commonly used prediction coding technology, which is mainly based on the correlation of pixels in the spatial domain of the video image and derives the prediction value of the current CU from the adjacent coded area. Figure 1d As shown in Figure 1, AVS3 currently includes 3 non-angle intra prediction modes (Plane, DC and Bilinear), and 66 angle prediction modes. When the angle prediction mode is used, the pixels in the current CU use the values ​​of the reference pixels at the corresponding positions on the reference pixel rows or columns as the prediction values ​​according to the direction corresponding to the angle of the prediction mode. Figure 1e As shown in the figure, for the pixel P in the current CU, firstly, the position of the reference pixel can be determined from the pixel row that has been encoded above according to the prediction angle in the figure, and then the value of the reference pixel is used as the prediction value of the pixel P. However, it should be noted that not all pixel positions point to the reference pixel positions with integer pixel accuracy (such as Figure 1e The reference pixel of pixel P is located at a sub-pixel position between pixel B and pixel C); in this case, the predicted value of pixel P needs to be obtained by interpolation of surrounding pixels. In order to improve the efficiency of intra-frame prediction, on-chip memory is usually used to store the value of the reference pixel for intra-frame prediction.

[0066] (II) Inter-frame prediction mode:

[0067] See also Figure 1f As shown in Figure 1, inter-frame prediction mainly uses the correlation in the video time domain to use the pixels in other adjacent coded images to predict the pixels in the current image, so as to effectively remove the redundancy in the video time domain and effectively save the bits of the coded residual data. r is the reference frame, B is the current CU, and B r is the reference block of B (i.e., reference CU). B' and B have the same coordinate position in the image. Assume that B r The coordinates are (x r ,y r ), B' coordinates are (x, y); the displacement between the current CU and its reference block is called the motion vector (MV), then: MV = (x r -x,y r-y).

[0068] (III) Intra-block copy mode:

[0069] Intra Block Copy (IBC), also known as block copy intra prediction, is an intra-frame coding tool adopted in the HEVC Screen Content Coding (Screen Cotent Coding, SCC) extension, which significantly improves the coding efficiency of screen content. In AVS3 and VVC, IBC technology is also adopted to improve the performance of screen content coding. IBC mainly uses the spatial correlation of screen content video, and uses the pixels in the encoded area of ​​the current image to predict the predicted value of the pixels in the current CU, which can effectively save the bits required for encoding pixels. Figure 1g As shown, in IBC, the displacement between the current CU and its reference block can be called a block vector (BV); H.266 / VVC uses a BV prediction technology similar to inter-frame prediction to further save the bits required for encoding BV.

[0070] In hardware implementation, all reference pixels used for IBC prediction can be stored in on-chip memory to reduce the additional bandwidth of on-chip and off-chip memory reading and writing. In order to reduce hardware costs, IBC is limited to using only a memory of S×S pixel size (such as 128×128 pixel size) as storage space; then, in order to improve the efficiency of the memory usage, the 128×128 memory can be divided into 4 64×64 areas for reference pixel memory reuse. The range of reference pixels can be as follows Figure 1h As shown: Figure 1h The block with vertical stripes in the figure is the current CU in the current processing unit (i.e., the current CTU or the current LCU); the gray area is the coded part, and the white area is the part that has not been coded in the current processing unit; Figure 1h The parts marked with "X" are not available for the current CU. Figure 1h The pixels in the area marked with "X" cannot be used as reference pixels of the current CU.

[0071] It should be noted that the embodiment of the present invention only uses a memory of 128×128 pixels as an example for explanation. In other embodiments, a memory of 64×64 pixels can be used as storage space to further reduce hardware costs; or, a memory of 256×256 pixels can be used as storage space to meet the storage needs of more data. Moreover, the embodiment of the present invention only uses the example of dividing the storage space into four 64×64 regions for explanation. In other embodiments, there can also be other ways of dividing regions, such as dividing a 128×128 memory into 16 32×32 regions for multiplexing reference pixel memory, and so on. In other words, a memory of S×S pixels can be divided into G 2 indivual The reference pixel memory is reused in an area of ​​size; wherein G is a divisor of S, that is, the quotient obtained by dividing S by G is an integer.

[0072] (IV) Intra-frame string copy mode - string prediction sub-mode:

[0073] Intra String Copy (ISC), also known as string copy intra prediction); it mainly divides a CU into a series of pixel strings or unmatched pixels (i.e., pixels that do not match reference pixels) according to a certain scanning mode (such as raster scanning, round-trip scanning, and Zig-Zag scanning, etc.). Similar to the IBC mode, each pixel string in the string prediction sub-mode searches for a reference string of the same shape in the encoded area of ​​the current image, thereby deriving the predicted value of each pixel in the current string; by encoding the residual between the pixel value and the predicted value of each pixel in the current string instead of directly encoding the pixel value, it can effectively save bits.

[0074] In one embodiment, each pixel string obtained by dividing the CU does not include unmatched pixels; in this embodiment, Figure 1i The schematic diagram of intra-frame string duplication is given as an example, wherein the dark gray area is the encoded area; the 28 white pixels constitute string 1, the 35 light gray pixels constitute string 2, and the 1 black pixel is an unmatched pixel.

[0075] In another embodiment, since the AVS conference in August 2020 adopted the string length resolution control technology, the length of all strings is restricted to an integer multiple of 4, and the string types are divided into matching strings and incomplete matching strings. Among them, a matching string refers to a string whose length can be an integer multiple of 4 and does not include unmatched pixels; an incomplete matching string refers to a string with a length of 4 and contains unmatched pixels. It should be noted that in other embodiments, the length of the matching string may not be limited to an integer multiple of 4, it may also be an integer multiple of 5, or an integer multiple of 3, and so on; similarly, the length of the incomplete matching string may not be limited to 4, it may also be 5, 6, and so on. For the matching pixels in the incomplete matching string, the prediction value can be derived based on the corresponding string displacement vector; and for the unmatched pixels in the incomplete matching string, the pixel value is decoded from the bitstream. In other words, the pixel string obtained by dividing the CU may include unmatched pixels; under this embodiment, Figure 1j The schematic diagram of intra-frame string replication with string length resolution control is given as an example, wherein the dark gray area is the encoded area; 24 white pixels constitute string 1, one black pixel and three pixels to its right constitute string 2, and 36 light gray pixels constitute string 3.

[0076] In addition, the intra-frame string copy technology also needs to encode the string displacement vector (StringVector, abbreviated as SV) corresponding to each string in the current CU, the string length, and the flag of whether there is a matching string, etc.; the string displacement vector here can also be called a string vector, which is used to indicate the displacement of the current string to the reference string. The string length indicates the number of pixels contained in the current string. In different implementations, there are many ways to encode the string length. The following are several examples (some examples may be used in combination): ① Directly encode the string length. ② Encode the number of pixels to be processed after the current string is processed, so that the decoding end decodes the number of pixels to be processed P2 excluding the current string according to the size P of the current CU and the number of processed pixels P1, thereby calculating the string length L of the current string, L = P-P1-P2; wherein L and P are both integers greater than 0, and P1 and P2 are both integers greater than or equal to 0. ③ Encode a flag to indicate whether the current string is the last string. If it is the last string, the string length L of the current string is calculated according to the size P of the current CU and the number of processed pixels P1, L = P-P1.

[0077] In practical applications, in order to keep the hardware implementation at a low complexity, the intra-frame string copy technology in AVS3 uses a reference range limit similar to IBC, uses a 128x128 pixel memory to store the value of the reference pixel and the value of the current pixel to be reconstructed, and uses a memory reuse strategy similar to IBC to improve the efficiency of the memory usage.

[0078] (V) Intra-frame string replication mode - equal value string and unit vector string sub-mode:

[0079] The equivalent string and unit vector string mode is a sub-mode of the intra-frame string copy mode and was adopted into the AVS3 standard in October 2020. Similar to the intra-frame string copy mode, this mode divides a CU (i.e., encoding / decoding block) into a series of pixel strings or unmatched pixels in a certain scanning order. The type of pixel string can be an equivalent string or a unit vector string. The characteristic of the equivalent string in this mode is that all pixels in the pixel string have the same prediction value. The characteristic of the unit vector string (also called unit base vector string, unit offset string, copy above string, etc.) in this mode is that each pixel in the pixel string uses the reconstructed value of the pixel above as the prediction value of the current pixel. In the equivalent string and unit vector string sub-mode, the length and prediction value of each string in the current CU need to be encoded; and the reference range of the equivalent string and unit vector string sub-mode is consistent with the reference range of the string prediction sub-mode.

[0080] Based on the relevant introduction of each of the above-mentioned prediction coding modes, an embodiment of the present invention proposes a coding scheme. On the one hand, the coding scheme allows the CU in the string prediction sub-mode of intra-frame string replication to use a unit vector string, thereby helping to improve the coding performance of string prediction; on the other hand, the coding scheme can also allow the pixels adjacent to the current CU to be derived as a reference for the current string, thereby obtaining the predicted value of the pixels in the current string. Specifically, the coding scheme may include a video encoding method and a video decoding method; the following will be combined with Figure 2 and Figure 4 , the video encoding method and the video decoding method proposed in the embodiments of the present invention are described.

[0081] See also Figure 2 , is a flowchart of a video encoding method proposed in an embodiment of the present invention; the video encoding method can be executed by the video encoding device mentioned above, or a video encoder in the video encoding device. For the convenience of description, the following description is taken as an example of a video encoding device executing the video encoding method; Figure 2 As shown, the video encoding method may include the following steps S201-S203:

[0082] S201, determining a current string to be decoded from a current coding unit of a current image.

[0083] In a specific implementation process, a video encoding device may receive an original video signal and encode images in the original video signal in sequence; accordingly, the current image refers to an image currently being encoded, which may be any frame image in the original video signal. In the process of encoding the current image, the video encoding device may first divide the current image into a plurality of processing units (such as CTU or LCU), and further divide each processing unit into one or more coding units (i.e., CU), thereby encoding each coding unit in sequence. Among them, the coding unit currently to be encoded (i.e., encoding is about to begin) or currently being encoded (i.e., some pixels have been encoded) may be referred to as the current coding unit. For example, suppose there are a total of 5 CUs: CU1, CU2, CU3, CU4, and CU5; and each pixel in CU1-CU2 has been encoded, and each pixel in CU3-CU5 has not been encoded; then according to the encoding order, CU3 can be determined as the current coding unit to be encoded, so the current coding unit is CU3. For another example, assume that there are a total of 5 CUs: CU1, CU2, CU3, CU4 and CU5; and all pixels in CU1 have been encoded, some pixels in CU2 have been encoded (that is, some pixels remain to be encoded), and all pixels in CU3-CU5 have not been encoded; then it can be determined that CU2 is the coding unit currently being encoded, and therefore the current coding unit can be CU2.

[0084] For the current coding unit, the video encoding device may use ISC to encode each pixel in the current coding unit. It should be noted that the current coding unit may be encoded in the string prediction sub-mode in the intra-frame string copy mode (ISC); and the coding unit in the string prediction sub-mode is allowed to use a unit vector string. Alternatively, the current coding unit may also be encoded in the equivalent string and unit vector string sub-mode in the intra-frame string copy mode (ISC), without limitation. For ease of explanation, the following description will be based on the example of encoding the current coding unit using the string prediction sub-mode. In addition, the current coding unit may include P rows and Q columns of pixels; wherein the values ​​of P and Q are both positive integers, and the values ​​of P and Q may be equal or unequal, without limitation. For example, the values ​​of P and Q may both be 64, then the current coding unit may include 64×64 pixels.

[0085] Specifically, the video encoding device may determine the scanning mode of the current coding unit, where the scanning mode may include but is not limited to: a horizontal scanning mode or a vertical scanning mode. Figure 3aAs shown, the horizontal scanning mode (also called the horizontal reciprocating scanning mode) refers to: a scanning mode for scanning pixels in each row of the current coding unit in sequence from top to bottom; the vertical scanning mode (or called the vertical scanning mode) refers to: a scanning mode for scanning pixels in each column of the current coding unit in sequence from left to right. It should be noted that, in other embodiments, the horizontal scanning mode may also refer to: a scanning mode for scanning pixels in each row of the current coding unit in sequence from bottom to top; the vertical scanning mode may also refer to: a scanning mode for scanning pixels in each column of the current coding unit in sequence from right to left, and there is no limitation to this. For ease of explanation, the following will be described as Figure 3a The horizontal scanning mode and the vertical scanning mode shown are explained. Then, the video encoding device may divide the current encoding unit into at least one string and / or unmatched pixels according to the scanning mode of the current encoding unit, and encode the divided strings and / or unmatched pixels in turn. Among them, the string to be encoded currently may be referred to as the current string; since the AVS3 standard stipulates that the length of the string must be an integer multiple of 4, the current string may include 4L pixels, where L is a positive integer; but it should be understood that in other video encoding standards, if the length of the string is not specified, the current string may include one or more pixels. In addition, the current string may be a unit vector string or may not be a unit vector string; and while the current string is a unit vector string, it may be a matching string or an incompletely matching string, which is not limited. If the current string is a unit vector string, step S202 may be executed.

[0086] It should be noted that the characteristics of the unit vector string mentioned in the embodiment of the present invention are not exactly the same as the characteristics of the unit vector string in the above-mentioned equivalent string and unit vector string sub-pattern. The characteristics of the unit vector string mentioned in the embodiment of the present invention are as follows: the predicted value of each pixel in the unit vector string is determined by the reconstructed value of the corresponding reference pixel, and the reference pixel corresponding to any pixel refers to: a pixel located on the target side and adjacent to any pixel. Among them, the target side mentioned here can be determined according to the scanning mode of the current coding unit; if the scanning mode of the current coding unit is a horizontal scanning mode, and the horizontal scanning mode indicates that the current coding unit is scanned in order from top to bottom, then the target side of any pixel refers to the top of any pixel, that is, the reference pixel of any pixel refers to a pixel located in a row above any pixel (such as the pixel directly above); if the scanning mode of the current coding unit is a vertical scanning mode, and the vertical scanning mode indicates that the current coding unit is scanned in order from left to right, then the target side of any pixel refers to the left of any pixel (such as the pixel directly to the left). It should also be noted that the upper position mentioned in the embodiment of the present invention refers to the position above the horizontal line where the upper left corner of the current coding unit is located, and the upper position refers to the position vertically upward of the pixel position; the left position refers to the position to the left of the vertical line where the upper left corner of the current coding unit is located, and the left position refers to the position horizontally to the left of the pixel position, such as Figure 3b It should be noted that the reconstructed value in the embodiment of the present application refers to the pixel value that has not been loop filtered.

[0087] S202: If the current string is a unit vector string and the current string includes a first pixel, a reference pixel of the first pixel is determined from historical coding units in the current image.

[0088] Among them, the historical coding unit refers to the encoded coding unit adjacent to the current coding unit in the current image; the reference pixel corresponding to the first pixel and the first pixel are adjacent in the current image, and the first pixel satisfies the following condition: the reference pixel corresponding to the first pixel is not located in the current coding unit. It should be noted that the historical coding unit and the current coding unit are adjacent to each other, which means that there are no other coding units between the historical coding unit and the current coding unit. The reference pixel corresponding to the first pixel and the first pixel are adjacent in the current image, which means that in the current image, the row where the reference pixel of the first pixel is located and the row where the first pixel is located are adjacent to each other (i.e., next to each other); for example, in the current image, the row where the reference pixel of the first pixel is located is the 5th row; if the row where the first pixel is located is the 6th row, it can be considered that the row where the reference pixel of the first pixel is located and the row where the first pixel is located are adjacent to each other; if the row where the first pixel is located is the 7th row, it can be considered that the row where the reference pixel of the first pixel is located and the row where the first pixel is located are not adjacent to each other. Alternatively, the reference pixel corresponding to the first pixel and the first pixel are adjacent in the current image means that: in the current image, the column where the reference pixel of the first pixel is located and the column where the first pixel is located are adjacent to each other (i.e., next to) each other; for example, in the current image, suppose that the column where the reference pixel of the first pixel is located is the 5th column; if the row where the first pixel is located is the 6th column, then it can be considered that the column where the reference pixel of the first pixel is located and the column where the first pixel is located are adjacent to each other; if the column where the first pixel is located is the 7th column, then it can be considered that the column where the reference pixel of the first pixel is located and the column where the first pixel is located are not adjacent to each other.

[0089] It can be seen that when the first pixel and the reference pixel of the first pixel are adjacent in the current image, the first pixel should be a pixel on a critical row or a critical column in the current coding unit; the critical row here can also be called an edge row, which can be the first row or the last row of the current coding unit; similarly, the critical column can also be called an edge column, which can be the first column or the last column of the current coding unit. In a specific implementation, the specific meaning of the first pixel can be determined according to the scanning mode of the current coding unit. For example, if the scanning mode of the current coding unit is a horizontal scanning mode, and the horizontal scanning mode indicates that the current coding unit is scanned in a top-down order, the historical coding unit is located above the current coding unit (that is, the historical coding unit is an encoded CU located above the current coding unit and adjacent to the current coding unit), and the first pixel is a pixel located in the first row of the current coding unit; that is, in this case, the current string includes at least one pixel on the first row in the current coding unit. If the scanning mode of the current coding unit is a vertical scanning mode, and the vertical scanning mode indicates that the current coding unit is scanned in order from left to right, the historical coding unit is located to the left of the current coding unit (that is, the historical coding unit is an encoded CU located to the left of the current coding unit and adjacent to the current coding unit), and the first pixel is a pixel located in the first column of the current coding unit; that is, in this case, the current string includes at least one pixel on the first column in the current coding unit.

[0090] S203: Obtain a prediction value of the first pixel according to a reconstructed value of a reference pixel of the first pixel to obtain encoding information of a current encoding unit.

[0091] In a specific implementation process, the reconstructed value of the reference pixel of the first pixel may be obtained first; secondly, the reconstructed value of the reference pixel of the first pixel may be used as the predicted value of the first pixel; then, the residual between the pixel value of the first pixel and the predicted value may be encoded to obtain the encoding information of the current coding unit; this encoding method may reduce the number of bits and improve the encoding efficiency. Alternatively, after obtaining the predicted value of the first pixel, the indication information (such as a string vector, string length, etc.) used to indicate the predicted value may be encoded to obtain the encoding information of the current coding unit. Among them, as the scanning mode of the current coding unit is different, the method for obtaining the reconstructed value of the reference pixel of the first pixel is also different; see the following description for details:

[0092] 1) If the scanning mode of the current coding unit is a horizontal scanning mode, and the horizontal scanning mode indicates that the current coding unit is scanned in a top-down order; then the method for obtaining the reconstructed value of the reference pixel of the first pixel includes any one of the following:

[0093] The first type: the reconstructed value of the reference pixel of the first pixel is obtained from the first storage space corresponding to the intra-frame string copy mode (or referred to as the reference pixel memory of the intra-frame string copy mode). Among them, the first storage space of the intra-frame string copy mode can be the 128×128 memory mentioned in the aforementioned IBC content, and the first storage space can be divided into 4 64×64 areas for reuse of the reference pixel memory; however, it should be noted that, as mentioned in the relevant content of the aforementioned IBC, the first storage space may not be limited to a 128×128 memory, and the first storage space is not limited to being divided into 4 64×64 areas. Since the prediction coding mode of the current coding unit is the string prediction sub-mode in the intra-frame string copy mode, or the equal value string and unit vector string sub-mode, the value of the first pixel will be stored in the first storage space. Then, by obtaining the reconstructed value of the reference pixel of the first pixel from the first storage space as the prediction value of the first pixel, the assignment of the prediction value can be completed in one storage space, which can effectively improve the coding efficiency.

[0094] The second type: the reconstructed value of the reference pixel of the first pixel is obtained from the second storage space corresponding to the intra-frame prediction mode (or called the reference pixel memory of the intra-frame prediction mode). If the reference pixel of the first pixel is encoded using the intra-frame prediction mode, the reconstructed value of the reference pixel of the first pixel in this case is located in the second storage space; and if the reference pixel of the first pixel is encoded using the intra-frame string copy mode, the reconstructed value of the reference pixel of the first pixel may be overwritten due to memory reuse. Therefore, in order to improve the success rate of obtaining the reconstructed value of the reference pixel of the first pixel, the reconstructed value of the reference pixel of the first pixel can be directly obtained from the second storage space.

[0095] The third method: divide the current image into multiple N×N regions. When the first pixel is located in the first row of any N×N region, the reconstructed value of the reference pixel of the first pixel is obtained from the second storage space; otherwise, the reconstructed value of the reference pixel of the first pixel is obtained from the first storage space. Specifically, the value of N can be determined based on an empirical value, or the size of the processing unit, or the size of the current CU. For example, if the size of the processing unit is 128×128, the target area can be divided into multiple 128×128 regions; when the first pixel is located in the first row of any 128×128 region, refer to Figure 1h The reference range limits shown ( Figure 1hThe corresponding scanning mode is the horizontal scanning mode) It can be known that, in addition to storing the value of the current CU (such as the reconstruction value of the reconstructed pixel), the first storage space only stores the reconstruction value of the CU to the left of the current CU, and does not store the reconstruction value of the reference pixel of the first pixel (that is, the pixel located above the current CU and adjacent to the first pixel). Therefore, the reconstruction value of the reference pixel of the first pixel can be obtained from the second storage space to improve the success rate of obtaining the reconstruction value. When the first pixel is not located in the first row of any 128×128 area, the reference pixel of the first pixel is located inside the current CU, and the reconstruction value of the reference pixel exists in the first storage space. Therefore, the reconstruction value of the reference pixel of the first pixel can be obtained from the first storage space to improve the efficiency of obtaining the reconstruction value.

[0096] It should be noted that the pixels in the current string may all be second pixels (i.e., the current string does not include the first pixel), or the current string may also include the first pixel and the second pixel (i.e., the current string includes the second pixel in addition to the first pixel); wherein the second pixel is a pixel located outside the first row of the current coding unit, and each second pixel in the current string is distributed in at least one row in the current coding unit. Then the computer device may also derive the predicted value of each second pixel in the current string in any of the following ways:

[0097] Method A: Get the predicted value of the second pixel in each row of the current string row by row. For example, assuming that the second pixel in the current string is distributed in the 2nd to 3rd rows in the current coding unit, the predicted value of the second pixel in the 2nd row can be derived once, and then the predicted value of the second pixel in the 3rd row can be derived once from top to bottom; wherein the second pixel in each row uses the reconstructed value of the reference pixel in the row above as the predicted value. This method A can effectively improve the efficiency of obtaining the predicted value, thereby improving the coding efficiency, by getting the predicted value of the second pixel row by row.

[0098] Method B: Taking a single pixel as a unit, the prediction value of each second pixel in the current string is obtained pixel by pixel. For example, if the second pixels in the current string are distributed in the 2nd row to the 3rd row in the current coding unit, the prediction value of each second pixel in the 2nd row can be derived pixel by pixel first, and then the prediction value of the second pixel in the 3rd row can be derived pixel by pixel; wherein each second pixel uses the reconstructed value of the reference pixel located above it as the prediction value.

[0099] It can be seen that in the above-mentioned method AB, the predicted value of any second pixel is obtained based on the reconstructed value of the reference pixel located above and adjacent to any second pixel. Specifically, the reconstructed value of the reference pixel located above and adjacent to any second pixel can be directly used as the predicted value of the any second pixel.

[0100] 2) If the scanning mode of the current coding unit is a vertical scanning mode, and the vertical scanning mode indicates that the current coding unit is scanned in a sequence from left to right; then the method for obtaining the reconstructed value of the reference pixel of the first pixel includes any one of the following:

[0101] The first type: the reconstructed value of the reference pixel of the first pixel is obtained from the first storage space corresponding to the intra-frame string copy mode (or called the reference pixel memory of the intra-frame string copy mode).

[0102] The second type: the reconstructed value of the reference pixel of the first pixel is obtained from the second storage space corresponding to the intra-frame prediction mode (or referred to as the reference pixel memory of the intra-frame prediction mode).

[0103] The third type: divide the current image into multiple N×N areas. When the first pixel is located in the first column of any N×N area, the reconstructed value of the reference pixel of the first pixel is obtained from the second storage space; otherwise, the reconstructed value of the reference pixel of the first pixel is obtained from the first storage space.

[0104] It should be noted that the pixels in the current string may all be third pixels (i.e., the current string does not include the first pixel), or the current string may also include the first pixel and the third pixel (i.e., the current string includes the third pixel in addition to the first pixel); wherein the third pixel is a pixel located outside the first column of the current coding unit, and each third pixel in the current string is distributed in at least one column in the current coding unit. Then the computer device may also derive the predicted value of each third pixel in the current string in any of the following ways:

[0105] Method a: Take columns as units and obtain the predicted value of the third pixel in each column of the current string column by column. For example, assuming that the third pixel in the current string is distributed in the 2nd column to the 3rd column in the current coding unit, the predicted value of the third pixel in the 2nd column can be derived at one time from left to right, and the predicted value of the third pixel in the 3rd column can be derived at one time; wherein the third pixel in each column uses the reconstructed value of the reference pixel in the left column as the predicted value. Method a can effectively improve the efficiency of obtaining the predicted value, thereby improving the coding efficiency, by obtaining the predicted value of the third pixel column by column.

[0106] Mode b: Taking a single pixel as a unit, obtain the prediction value of each third pixel in the current string pixel by pixel. For example, assuming that the third pixels in the current string are distributed in the 2nd column and the 3rd column in the current coding unit, the prediction value of each third pixel in the 2nd column can be derived pixel by pixel from left to right, and then the prediction value of the third pixel in the 3rd column can be derived pixel by pixel; wherein each third pixel uses the reconstructed value of the reference pixel located to its left as the prediction value.

[0107] It can be seen that in the above-mentioned methods ab, the predicted value of any third pixel is obtained based on the reconstructed value of the reference pixel located to the left and adjacent to any second pixel. Specifically, the reconstructed value of the reference pixel located to the left and adjacent to any third pixel can be directly used as the predicted value of the third pixel.

[0108] In an optional specific implementation, the video encoding device may further encode a string indication flag so that the encoding information includes the string indication flag; wherein, if the current string is a unit vector string, the string indication flag is a target value. The target value may be set according to an empirical value or a business requirement, for example, the target value may be set to 0 or 1. Optionally, the string indication flag may be a binary flag to indicate whether the current string is a unit vector string. For example, when the string indication flag is 1 (ie, the target value is 0), it may indicate that the current string is a unit vector string; when the string indication flag is 0, it may indicate that the current string is not a unit vector string.

[0109] In another optional specific implementation, the video encoding device may further encode a value K so that the encoding information includes the value K; the value K is greater than or equal to zero, and the value K is used to indicate that at least one string after the Kth group of pixels in the target group of pixels in the current encoding unit is a unit vector string. The current encoding unit may be divided into multiple groups of pixels; a group of pixels includes: a string or at least one unmatched pixel. Specifically, if the video encoding device adopts Figure 1i If the intra-frame string replication technology shown is used to perform string division on the current coding unit, then the current coding unit may be divided into unmatched pixels; in this case, these divided unmatched pixels may constitute one or more groups of pixels. Specifically, if there are at least two unmatched pixels among the divided unmatched pixels whose distribution positions in the current coding unit are continuous, then all the unmatched pixels of the at least two unmatched pixels are taken as a group of pixels, or a part of the continuous unmatched pixels are selected from the at least two unmatched pixels as a group of pixels, and each unselected unmatched pixel is taken as a group of pixels. If there are independent unmatched pixels among the divided unmatched pixels (i.e., unmatched pixels between two strings), then an independent unmatched pixel may be taken as a group of pixels. It should be noted that the embodiments of the present invention only exemplarily list several ways of dividing unmatched pixels into one or more groups of pixels, and are not exhaustive. In practical applications, the encoding end may set the division method according to requirements. If the video encoding device adopts Figure 1j If the intra-frame string replication technology with string length resolution control shown performs string division on the current coding unit, then the current coding unit will be divided into multiple strings (such as matching strings and / or incomplete matching strings); in this case, each matching string can be regarded as a group of pixels, and each incomplete matching string can also be regarded as a group of pixels.

[0110] In one embodiment, the number of K included in the encoding information in the current encoding unit may be one, and the target group of pixels may be all groups of pixels in the current encoding unit; in this embodiment, the value K may be used to indicate that among all groups of pixels in the current encoding unit, all strings after the Kth group of pixels are unit vector strings. Optionally, if each group of pixels includes one string, the value K may be used to indicate that among all groups of pixels in the current encoding unit, the K+1th string is a unit vector string.

[0111] In another embodiment, each group of pixels includes a string; the number of K included in the encoding information in the current encoding unit can be multiple, and one K corresponds to one target group of pixels; in this embodiment, the i-th K can be used to indicate that the K+1-th string in the target group of pixels corresponding to the i-th K in the current encoding unit is a unit vector string. Among them, the target group of pixels corresponding to the i-th K is: the remaining group of pixels in the current encoding unit whose string type (unit vector string or non-unit vector string) has not been determined based on the first i-1 K. For example, if the value of the first K is equal to 2, the target group of pixels corresponding to the first K is all the groups of pixels in the current encoding unit, and the first K indicates that the strings in the first group of pixels and the strings in the second group of pixels in the current encoding unit are not unit vector strings, and the strings in the third group of pixels are unit vector strings. If the value of the second K is equal to 1, the target group of pixels corresponding to the second K is: the remaining group of pixels whose string type has not been determined based on the first K, that is, the fourth group of pixels and the group of pixels located after the fourth group of pixels. Furthermore, since the first group of pixels (i.e., the Kth group of pixels) in the target group of pixels corresponding to the second K corresponds to the fourth group of pixels in the current coding unit, and the second group of pixels (i.e., the K+1th group of pixels) in the target group of pixels corresponding to the second K corresponds to the fifth group of pixels in the current coding unit, the second K may indicate that the string in the fourth group of pixels is not a unit vector string, and the fifth group of pixels is a unit vector string.

[0112] In another optional specific implementation, the video encoding device may further encode the string displacement vector of the current string, so that the encoding information includes the string displacement vector; wherein, if the current string is a unit vector string, the string displacement vector is a unit vector, and the unit vector here may include a first element and a second element. If the scanning mode of the current encoding unit is a horizontal scanning mode, the element value of the first element is a first numerical value, and the element value of the second element is a second numerical value; if the scanning mode of the current encoding unit is a vertical scanning mode, the element value of the first element is a second numerical value, and the element value of the second element is a first numerical value. The specific values ​​of the first numerical value and the second numerical value may be set according to empirical values ​​or business requirements; for example, the first numerical value is set to 0 and the second is set to -1: then when the scanning mode of the current encoding unit is a horizontal scanning mode, the unit vector is (0, -1); when the scanning mode of the current encoding unit is a vertical scanning mode, the unit vector is (-1, 0).

[0113] As can be seen from the above, the current image is divided into multiple processing units, each processing unit includes one or more coding units; and the multiple processing units include: the current processing unit and the decoded processing unit, and the current processing unit includes the current coding unit. The string displacement vector is used to represent the displacement from the current string to the reference string. When the current string is a unit vector string, the reference string of the current string may not satisfy one or more of the following conditions:

[0114] ① Any reference pixel in the reference string is within the specified area; for example, the specified area may be the range of the current processing unit or the range of H decoded processing units to the left of the current processing unit, where H is a positive integer. In an exemplary embodiment, the value of H may be determined by the size of the processing unit (i.e., LCU or CTU); specifically, H may be determined according to the following formula:

[0115] H=(1<<((7-log2_lcu_size_minus2+2)<<1))–(((log2_lcu_size_minus2+2)<7)?1:0)

[0116] Wherein, lcu_size, lcu_size represents the width or height of the processing unit, which can be a positive integer greater than or equal to 1; log2_lcu_size_minus2 = log2(lcu_size)-2. The "<<" operator represents left shift, which is used to shift all binary bits of a number to the left by K (K is a positive integer greater than or equal to 1) bits, discard the high bits, and fill the low bits with 0. (((log2_lcu_size_minus2+2)<7)?1:0) is a ternary operator. First, determine whether ((log2_lcu_size_minus2+2)<7) is true. If true, then (((log2_lcu_size_minus2+2)<7)?1:0)=1; if not true, then (((log2_lcu_size_minus2+2)<7)?1:0)=0. For example, if the size of the processing unit is 128×128, lcu_size=128, log2(128)=7, log2_lcu_size_minus2=5, and H=(1<<(0<<1))−0=1. For another example, if the size of the processing unit is 64×64, lcu_size=64, log2(64)=6, log2_lcu_size_minus2=4, and H=(1<<(1<<1))−1=3.

[0117] Alternatively, H can be determined according to the following formula:

[0118] H=(1<<((7-log2_lcu_size)<<1))–(((log2_lcu_size)<7)?1:0)

[0119] Among them, log2_lcu_size=log2(lcu_size); first determine whether ((log2_lcu_size)<7) holds, if so, then (((log2_lcu_size)<7)?1:0)=1; if not, then (((log2_lcu_size)<7)?1:0)=0.

[0120] ② When any reference pixel in the reference string is in the decoded processing unit adjacent to the left of the current processing unit, the pixels in the target area where any reference pixel in the reference string is located after it is moved to the right by a predetermined pixel have not yet been reconstructed. Among them, the predetermined pixels and the target area can be determined according to the size of the processing unit (i.e., LCU or CTU); specifically, if the size of the processing unit is M×M, the predetermined pixels are M pixels, and the target area is the corresponding pixel after any pixel in the reference string is moved to the right by M pixels. Area. For example, assuming that the size of the processing unit is 128×128, the predetermined pixels may be 128 pixels, and the target area is the 64×64 area corresponding to any pixel in the reference string moved 128 pixels to the right. Among them, the pixels in the target area where any reference pixel of the reference string is moved to the right by a predetermined pixel have not yet been reconstructed means: any pixel in the target area where any reference pixel of the reference string is moved to the right by a predetermined pixel has not yet been reconstructed, or the pixel at the upper left corner of the target area where any reference pixel of the reference string is moved to the right by a predetermined pixel has not yet been reconstructed.

[0121] Optionally, the reference area of ​​any reference pixel in the reference string included in the left adjacent processing unit can find the same position area in the current processing unit, and the upper left corner coordinates of the position area should not be the same as the upper left corner coordinates of the current CU. Take the size of the processing unit as 128×128 and the size of the CU as 64×64 as an example; suppose the position of any reference pixel in the reference string is (xRef, yRef), then ((xRef+128) / 64×64, yRef / 64×64) is not available (that is, the reconstructed value of the pixel cannot be found in the first storage space), ((xRef+128) / 64×64, yRef / 64×64) should not be equal to the upper left corner coordinates of the current CU (xCb, yCb). It should be noted that " / " here represents rounding down division.

[0122] ③ Each reference pixel in the reference string is located in the same alignment area, and the size of the alignment area is determined according to the size of the processing unit. Specifically, vSize can be used to represent the height or width of the alignment area, and it can be defined as: vSize = LcuSize> = 64? 64: LcuSize. Among them, vSize = LcuSize> = 64? 64: LcuSize means: determine whether LcuSize is greater than or equal to 64, LcuSize represents the height or width of the processing unit; if so, vSize is equal to 64; otherwise, vSize is equal to LcuSize.

[0123] That is to say, in this case: all reference pixels in the reference string pointed to by the string displacement vector can only come from the same vSize x vSize alignment area. That is, the following conditions must be met:

[0124] xRefA / vSize=xRefB / vSize

[0125] yRefA / vSize=yRefB / vSize

[0126] Wherein, (xRefA, yRefA) and (xRefB, yRefB) are the coordinates of any two reference pixels (luminance components) A and B in the reference string. It should be noted that here, " / " represents a division with rounding down.

[0127] ④ Any reference pixel in the reference string does not belong to the current string, that is, the reference string and the current string do not overlap.

[0128] In another optional specific implementation, the video encoding device may further encode a string scan mode flag (or a string prediction scan mode flag) so that the encoding information includes the string scan mode flag. Specifically, if the scan mode of the current encoding unit is a horizontal scan mode, the string scan mode flag is a third value; if the scan mode of the current encoding unit is a vertical scan mode, the string scan mode flag is a fourth value. The third value and the fourth value may be set according to experience or business requirements; for example, the third value is set to 0 and the fourth value is set to 1.

[0129] It should be noted that if the current string is not a unit vector string, the video encoding device may also search for a reference string of the current string from the current processing unit and some of the encoded coding units in the encoded processing unit; and obtain the predicted value of each pixel in the current string according to the reference string to obtain the encoding information of the current coding unit. In this case, the reference string must meet one or more of the following conditions:

[0130] ① Any reference pixel in the reference string is within the range of the current processing unit and H decoded processing units to the left of the current processing unit, where H is a positive integer.

[0131] ② When any reference pixel in the reference string is in an encoded processing unit adjacent to the left of the current processing unit, the pixels in the target area where any reference pixel in the reference string is located after being moved right by a predetermined number of pixels have not yet been reconstructed.

[0132] ③ Each reference pixel in the reference string is located in the same alignment area, and the size of the alignment area is determined according to the size of the processing unit.

[0133] ④ Each reference pixel in the reference string and each pixel in the current string are located in the same independent coding area, where the independent coding area may include the current image, or a slice or strip in the current image.

[0134] ⑤ Any reference pixel in the reference string does not belong to the current string.

[0135] It should also be noted that if the current coding unit includes unmatched pixels (i.e., pixels whose corresponding reference pixels are not found in the reference area in the encoded area of ​​the current image), the video encoding device can directly encode the pixel values ​​of the unmatched pixels so that the encoding information includes the pixel values ​​of the unmatched pixels.

[0136] In the encoding process of the embodiment of the present invention, when the current string of the current coding unit is a unit vector string and the current string includes the first pixel (such as the pixel of the first row in the current coding unit or the pixel of the first column in the current coding unit, etc.), the reference pixel of the first pixel can be determined from the historical decoding unit in the current image, and the prediction value of the first pixel can be obtained according to the reconstructed value of the reference pixel to realize the encoding process. It can be seen that the embodiment of the present invention allows the use of pixels in the historical decoding units adjacent to the current coding unit as reference pixels, so that any string in the current coding unit can become a unit vector string, which can effectively broaden the scope of application of the unit vector string and help improve the encoding performance. In addition, the prediction coding mode adopted by the embodiment of the present invention for the current coding unit is not limited to the equivalent string and the unit vector string sub-mode, but can also be other prediction coding modes such as the string prediction sub-mode in the intra-frame string copy mode; that is, the embodiment of the present invention allows the coding unit under the string prediction sub-mode to use the unit vector string, which can further broaden the scope of application of the unit vector string and improve the encoding performance of the string prediction.

[0137] See also Figure 4 , is a flowchart of a video decoding method proposed in an embodiment of the present invention; the video decoding method can be executed by the video decoding device mentioned above, or a video decoder in the video decoding device. For the convenience of description, the following description is taken as an example of a video decoding device executing the video decoding method; Figure 4 As shown, the video decoding method may include the following steps S401-S403:

[0138] S401, determining a current string to be decoded from a current coding unit of a current image.

[0139] In a specific implementation process, the video decoding device can obtain the encoding information of the current coding unit in the current image, and the current coding unit includes P rows and Q columns of pixels; wherein the values ​​of P and Q are both positive integers. Then, according to the encoding information of the current coding unit, the current string to be decoded can be determined from the current coding unit. Specifically, the video decoding device can decode the prediction coding mode of the current coding unit from the encoding information of the current coding unit; if the prediction coding mode is a string prediction sub-mode in ISC or an equivalent string and a unit vector string prediction sub-mode, the scanning mode and string length are further decoded from the decoding information of the current coding unit. Then, according to the scanning mode and the string length, the current string to be decoded can be determined from the current coding unit.

[0140] It should be noted that the current coding units mentioned on the decoding side refer to: the CU that is currently to be decoded (i.e., decoding is about to begin) or is currently being decoded (i.e., some pixels have been decoded). The current coding unit can be encoded under the string prediction sub-mode in the intra-frame string copy mode (ISC); and the coding unit under the string prediction sub-mode is allowed to use a unit vector string. Alternatively, the current coding unit can also be encoded under the equivalent string and unit vector string sub-mode in the intra-frame string copy mode (ISC), and there is no restriction on this. For the sake of ease of explanation, the following description will take the encoding of the current coding unit using the string prediction sub-mode as an example.

[0141] After determining the current string, the video decoding device may use any of the following methods to determine whether the current string is a unit vector string:

[0142] In a first approach, the video decoding device may decode a string indication flag from the encoding information of the current encoding unit; if the string indication flag is a target value, it is determined that the current string is a unit vector string.

[0143] Method 2: The video decoding device can decode a numerical value K from the encoding information of the current encoding unit, and the value of the numerical value K is greater than or equal to zero; and the numerical value K is used to indicate that in the target group of pixels in the current encoding unit, at least one string located after the Kth group of pixels is a unit vector string, and a group of pixels includes: a string or at least one unmatched pixel. If the current string is located after the Kth group of pixels in the target group of pixels, the current string is determined to be a unit vector string. Optionally, if each group of pixels includes a string, the numerical value K can be specifically used to indicate that in the target group of pixels in the current encoding unit, the K+1th string is a unit vector string; then under this embodiment, it can be further determined whether the current string is the K+1th string in the target group of pixels; if the current string is the K+1th string in the target group of pixels, the current string is determined to be a unit vector string.

[0144] In implementation mode three, the video decoding device can decode the string displacement vector of the current string from the encoding information of the current encoding unit; if the string displacement vector is a unit vector, the current string is determined to be a unit vector string. The unit vector may include a first element and a second element. If the scanning mode of the current encoding unit is a horizontal scanning mode, the element value of the first element is a first numerical value, and the element value of the second element is a second numerical value; if the scanning mode of the current encoding unit is a vertical scanning mode, the element value of the first element is a second numerical value, and the element value of the second element is a first numerical value. The specific values ​​of the first numerical value and the second numerical value can be set according to empirical values ​​or business requirements; for example, the first numerical value is set to 0 and the second is set to -1: when the scanning mode of the current encoding unit is a horizontal scanning mode, the unit vector is (0, -1); when the scanning mode of the current encoding unit is a vertical scanning mode, the unit vector is (-1, 0).

[0145] Among them, the scanning mode of the current coding unit can be determined as follows: decode the string scanning mode flag from the encoding information of the current coding unit; if the string scanning mode flag is a third value, determine that the scanning mode of the current coding unit is a horizontal scanning mode; if the string scanning mode flag is a fourth value, determine that the scanning mode of the current coding unit is a vertical scanning mode.

[0146] As can be seen from the above, the current image is divided into multiple processing units, each processing unit includes one or more coding units; and the multiple processing units include: the current processing unit and the decoded processing unit, and the current processing unit includes the current coding unit. The string displacement vector is used to represent the displacement from the current string to the reference string. When the current string is a unit vector string, the reference string of the current string may not satisfy one or more of the following conditions:

[0147] ① Any reference pixel in the reference string is within the specified area range; for example, the specified area range may be the range of the current processing unit, or the range of H decoded processing units to the left of the current processing unit.

[0148] ② When any reference pixel in the reference string is in a decoded processing unit adjacent to the left of the current processing unit, the pixels in the target area where any reference pixel in the reference string is located after being moved to the right by a predetermined pixel have not yet been reconstructed. Optionally, the reference area of ​​any reference pixel in the reference string in the processing unit adjacent to the left can be found in the current processing unit in the same position area, and the upper left corner coordinates of the position area should not be the same as the upper left corner coordinates of the current CU.

[0149] ③ Each reference pixel in the reference string is located in the same alignment area.

[0150] ④ Any reference pixel in the reference string does not belong to the current string.

[0151] S402: If the current string is a unit vector string and the current string includes a first pixel, a reference pixel of the first pixel is determined from a historical decoding unit in the current image.

[0152] Among them, the historical decoding unit refers to a decoded coding unit adjacent to the current coding unit in the current image, and the reference pixel corresponding to the first pixel and the first pixel are adjacent in the current image; and the first pixel satisfies the following conditions: the reference pixel corresponding to the first pixel is not located in the current coding unit. It should be noted that the historical decoding unit and the current coding unit are adjacent to each other, which means that there are no other coding units between the historical decoding unit and the current coding unit. The reference pixel corresponding to the first pixel and the first pixel are adjacent in the current image, which means that in the current image, the row where the reference pixel of the first pixel is located and the row where the first pixel is located are adjacent to each other (i.e., adjacent). Alternatively, the reference pixel corresponding to the first pixel and the first pixel are adjacent in the current image, which means that in the current image, the column where the reference pixel of the first pixel is located and the column where the first pixel is located are adjacent to each other (i.e., adjacent).

[0153] It can be seen that when the first pixel and the reference pixel of the first pixel are adjacent in the current image, the first pixel should be a pixel on a critical row or a critical column in the current coding unit; the critical row here can also be called an edge row, which can be the first row or the last row of the current coding unit; similarly, the critical column can also be called an edge column, which can be the first column or the last column of the current coding unit. In a specific implementation, the specific meaning of the first pixel can be determined according to the scanning mode of the current coding unit. For example, if the scanning mode of the current coding unit is a horizontal scanning mode, and the horizontal scanning mode indicates that the current coding unit is scanned in a top-down order, the historical decoding unit is located above the current coding unit (that is, the historical decoding unit is a decoded CU located above the current coding unit and adjacent to the current coding unit), and the first pixel is a pixel located in the first row of the current coding unit; that is, in this case, the current string includes at least one pixel on the first row in the current coding unit. If the scanning mode of the current coding unit is a vertical scanning mode, and the vertical scanning mode indicates that the current coding unit is scanned in order from left to right, the historical decoding unit is located to the left of the current coding unit (that is, the historical decoding unit is a decoded CU located to the left of the current coding unit and adjacent to the current coding unit), and the first pixel is a pixel located in the first column of the current coding unit; that is, in this case, the current string includes at least one pixel on the first column in the current coding unit.

[0154] S403: Obtain a predicted value of the first pixel according to a reconstructed value of a reference pixel of the first pixel to obtain a decoded image.

[0155] In a specific implementation process, the reconstruction value of the reference pixel of the first pixel can be obtained first; secondly, the reconstruction value of the reference pixel of the first pixel is used as the prediction value of the first pixel to obtain a decoded image; through this decoding method, the prediction value acquisition process can be simplified and the decoding efficiency can be improved. Among them, as the scanning mode of the current coding unit is different, the method for obtaining the reconstruction value of the reference pixel of the first pixel is also different; see the following description for details:

[0156] 1) If the scanning mode of the current coding unit is a horizontal scanning mode, and the horizontal scanning mode indicates that the current coding unit is scanned in a top-down order; then the method for obtaining the reconstructed value of the reference pixel of the first pixel includes any one of the following:

[0157] The first type: the reconstructed value of the reference pixel of the first pixel is obtained from the first storage space corresponding to the intra-frame string copy mode (or called the reference pixel memory of the intra-frame string copy mode).

[0158] The second type: the reconstructed value of the reference pixel of the first pixel is obtained from the second storage space corresponding to the intra-frame prediction mode (or referred to as the reference pixel memory of the intra-frame prediction mode).

[0159] The third type: divide the current image into multiple N×N areas. When the first pixel is located in the first row of any N×N area, the reconstructed value of the reference pixel of the first pixel is obtained from the second storage space; otherwise, the reconstructed value of the reference pixel of the first pixel is obtained from the first storage space.

[0160] It should be noted that the pixels in the current string may all be second pixels (i.e., the current string does not include the first pixel), or the current string may also include the first pixel and the second pixel (i.e., the current string includes the second pixel in addition to the first pixel); wherein the second pixel is a pixel located outside the first row of the current coding unit, and each second pixel in the current string is distributed in at least one row in the current coding unit. Then the computer device may also derive the predicted value of each second pixel in the current string in any of the following ways:

[0161] Method A: Obtain the predicted value of the second pixel in each row of the current string row by row.

[0162] Method B: Taking a single pixel as a unit, the predicted value of each second pixel in the current string is obtained pixel by pixel.

[0163] In the above-mentioned method AB, the prediction value of any second pixel is obtained based on the reconstructed value of the reference pixel located above and adjacent to any second pixel.

[0164] 2) If the scanning mode of the current coding unit is a vertical scanning mode, and the vertical scanning mode indicates that the current coding unit is scanned in a sequence from left to right; then the method for obtaining the reconstructed value of the reference pixel of the first pixel includes any one of the following:

[0165] The first type: the reconstructed value of the reference pixel of the first pixel is obtained from the first storage space corresponding to the intra-frame string copy mode.

[0166] The second method: the reconstructed value of the reference pixel of the first pixel is obtained from the second storage space corresponding to the intra prediction mode.

[0167] The third type: divide the current image into multiple N×N areas. When the first pixel is located in the first column of any N×N area, the reconstructed value of the reference pixel of the first pixel is obtained from the second storage space; otherwise, the reconstructed value of the reference pixel of the first pixel is obtained from the first storage space.

[0168] It should be noted that the pixels in the current string may all be third pixels (i.e., the current string does not include the first pixel), or the current string may also include the first pixel and the third pixel (i.e., the current string includes the third pixel in addition to the first pixel); wherein the third pixel is a pixel located outside the first column of the current coding unit, and each third pixel in the current string is distributed in at least one column in the current coding unit. Then the computer device may also derive the predicted value of each third pixel in the current string in any of the following ways:

[0169] Method a: Taking columns as units, obtain the predicted value of the third pixel in each column of the current string column by column.

[0170] Mode b: Taking a single pixel as a unit, the prediction value of each third pixel in the current string is obtained pixel by pixel. In the above modes ab, the prediction value of any third pixel is obtained based on the reconstructed value of the reference pixel located to the left and adjacent to any second pixel.

[0171] It should be noted that if the current string is not a unit vector string, the video decoding device can also search for a reference string of the current string from the current processing unit and some decoded coding units in the encoded processing unit; and obtain the predicted value of each pixel in the current string according to the reference string to obtain a decoded image. In this case, the reference string must meet one or more of the following conditions:

[0172] ① Any reference pixel in the reference string is within the range of the current processing unit and H decoded processing units to the left of the current processing unit, where H is a positive integer.

[0173] ② When any reference pixel in the reference string is in an encoded processing unit adjacent to the left of the current processing unit, the pixels in the target area where any reference pixel in the reference string is located after being moved right by a predetermined number of pixels have not yet been reconstructed.

[0174] ③ Each reference pixel in the reference string is located in the same alignment area, and the size of the alignment area is determined according to the size of the processing unit.

[0175] ④ Each reference pixel in the reference string and each pixel in the current string are located in the same independent coding area, where the independent coding area may include the current image, or a slice or strip in the current image.

[0176] ⑤ Any reference pixel in the reference string does not belong to the current string.

[0177] It should also be noted that, if the current coding unit includes unmatched pixels, the pixel values ​​of the unmatched pixels can be directly decoded from the encoding information of the current coding unit.

[0178] In the decoding process of the embodiment of the present invention, when the current string of the current coding unit is a unit vector string and the current string includes the first pixel (such as the pixel of the first row in the current coding unit or the pixel of the first column in the current coding unit, etc.), the reference pixel of the first pixel can be determined from the historical decoding unit in the current image, and the prediction value of the first pixel can be obtained according to the reconstructed value of the reference pixel to realize the decoding process. It can be seen that the embodiment of the present invention allows the use of pixels in the historical decoding units adjacent to the current coding unit as reference pixels, so that any string in the current coding unit can become a unit vector string, which can effectively broaden the scope of application of the unit vector string and help improve the decoding performance. In addition, the prediction coding mode adopted by the embodiment of the present invention for the current coding unit is not limited to the equivalent string and the unit vector string sub-mode, but can also be other prediction coding modes such as the string prediction sub-mode in the intra-frame string copy mode; that is, the embodiment of the present invention can allow the coding unit under the string prediction sub-mode to use the unit vector string, which can further broaden the scope of application of the unit vector string and improve the coding performance of the string prediction.

[0179] Based on the above Figure 2 The embodiment of the video encoding method shown in the figure describes and Figure 4 The embodiment of the video decoding method shown in the figure describes that an embodiment of the present invention proposes a string prediction method based on a unit vector string; the method is applicable to a codec using an intra-frame string copy mode, and is described below at the decoding end:

[0180] 1) The unit vector is:

[0181] a) If the scanning mode of the ISC block (current CU) is the horizontal scanning mode, the unit vector is (0, -1);

[0182] b) If the scanning mode of the ISC block (current CU) is the vertical scanning mode, the unit vector is (-1, 0).

[0183] 2) There are the following optional ways to confirm that the current string is a unit vector string:

[0184] a) decoding a binary flag (i.e., the string indication flag mentioned above) from a bitstream (such as the encoding information of the current CU), and if the binary flag is a target value, it indicates that the current string is a unit vector string;

[0185] b) decoding a value K from a bitstream (such as the encoding information of the current CU), indicating that at least one string after the Kth group of pixels in the target group of pixels in the current coding unit is a unit vector string. If the current string is after the Kth group of pixels in the target group of pixels, then the current string is determined to be a unit vector string;

[0186] c) Decode the string vector (ie, string displacement vector) of the current string from the bitstream (eg, the encoding information of the current CU). If the string vector is a unit vector, the current string is a unit vector string.

[0187] 3) Derivation of predicted values ​​of unit vector strings:

[0188] a) If the current ISC block (current CU) uses horizontal scanning order

[0189] i. Derive the predicted value of the current string row by row from top to bottom, where the pixels in each row of the string use the value of the pixel in the row above (such as the reconstructed value) as the predicted value;

[0190] Another implementation of ii. i. is to complete the reconstruction of the unit vector string pixel by pixel, and each pixel in the string uses the value of the pixel above it (such as the reconstructed value) as the predicted value;

[0191] iii. In i. and ii., if the pixel to be predicted is located in the first row of the current decoding block (i.e., the current CU), then the reference pixel of the pixel is located in a row above the current decoding block, and the reconstructed value of the reference pixel has the following optional acquisition methods:

[0192] ① The reconstructed value of the reference pixel is obtained from the reference pixel memory copied from the intra-frame string (i.e., the first storage space mentioned above);

[0193] ② The reconstructed value of the reference pixel is obtained from the reference pixel memory of the intra-frame prediction (i.e., the second storage space mentioned above);

[0194] ③ The current image is divided into a series of regions of size N×N (for example, 64×64). Only when the pixel is located in the first row of the region, the reconstructed value of the reference pixel is obtained from the reference pixel memory of intra-frame prediction; otherwise, the reconstructed value of the reference pixel is obtained from the reference pixel memory of intra-frame string replication.

[0195] b) If the current ISC block (current CU) uses vertical scanning order

[0196] i. Derive the predicted value of the current string column by column, where the pixels in each row of the string use the value of the pixel in the left column (such as the reconstructed value) as the predicted value;

[0197] Another implementation of ii. i. is to complete the reconstruction of the unit vector string pixel by pixel, and each pixel in the string uses the value of the pixel to its left (such as the reconstructed value) as the predicted value;

[0198] iii. In i. and ii., if the pixel to be predicted is located in the first column of the current decoding block, and the reference pixel of the pixel is located in a column to the left outside the current decoding block, the reconstructed value of the reference pixel can be obtained in the following optional ways:

[0199] ① The reconstructed value of the reference pixel is obtained from the reference pixel memory copied from the frame string;

[0200] ② The reconstructed value of the reference pixel is obtained from the reference pixel memory of the intra-frame prediction;

[0201] ③ Divide the current image into a series of regions of size N×N (for example, 64×64). When the pixel is located in the first column of the region, the reconstructed value of the reference pixel is obtained from the reference pixel memory of intra-frame prediction; otherwise, the reconstructed value of the reference pixel is obtained from the reference pixel memory of intra-frame string replication.

[0202] 4) Optionally, unit vector strings are allowed in the intra string copy string prediction sub-mode, unless the current string is a unit vector offset string, and the compliant bitstream shall satisfy all or part of the following reference range restrictions:

[0203] a) Any reference pixel in the reference string pointed to by the string displacement vector is limited to a certain specified area. For example, the specified area can be: the range of the current processing unit (such as the current maximum coding unit) or the range of the left H processing units (such as the maximum coding unit); where the size of H can be determined by the size of the processing unit (such as LCU or CTU). N = (1<<((7-log2_lcu_size_minus2+2)<<1))-(((log2_lcu_size_minus2+2)<7)?1:0).

[0204] b) When any reference pixel of the reference string pointed to by the string displacement vector falls on the adjacent maximum coding unit on the left, and the luminance sample size of the maximum coding unit is 128×128, the upper left corner of the 64×64 area where the luminance sample of any reference pixel in the reference string is shifted 128 pixels to the right has not been reconstructed. Moreover, the 64×64 area where any reference pixel in the reference string falls in the adjacent CTU on the left can correspond to the same area position in the current CTU, and the upper left corner coordinates of the 64×64 area should not be the same as the upper left corner coordinates of the current coding block. That is, any position of the luminance component of the reference string is (xRef, yRef), ((xRef+128) / 64×64, yRef / 64×64) is not available; ((xRef+128) / 64×64, yRef / 64×64) should not be equal to the upper left corner position of the current block (xCb, yCb).

[0205] c) Reference string position limitation. Define the sample limit area size vSize = LcuSize > = 64? 64: LcuSize. All pixels in the reference string pointed to by the string displacement vector can only come from the same vSize x vSize alignment area. That is:

[0206] xRefA / vSize=xRefB / vSize

[0207] yRefA / vSize=yRefB / vSize

[0208] Among them, (xRefA, yRefA) and (xRefB, yRefB) are the coordinates of any two brightness components A and B on the reference string.

[0209] d) Any reference pixel in the reference string pointed to by the string displacement vector should not be located in the current string.

[0210] The method proposed in the embodiment of the present invention expands the scope of use of unit vector strings, which helps to improve the encoding efficiency of string vectors; and, by combining unit vector strings with string prediction sub-patterns, the encoding performance of string prediction can also be improved by relying on the lower implementation complexity of unit vector strings.

[0211] Based on the description of the embodiment of the above video encoding method, the embodiment of the present invention further discloses a video encoding device, which can be a computer program (including program code) running in the above-mentioned video encoding device. The video encoding device can execute Figure 2 See the method shown in Figure 5 , the video encoding device can run the following units:

[0212] An acquisition unit 501 is used to determine a current string to be encoded from a current encoding unit of a current image;

[0213] A coding unit 502 is configured to determine a reference pixel of a first pixel from a historical coding unit in the current image if the current string is a unit vector string and the current string includes a first pixel; the historical coding unit refers to an encoded coding unit adjacent to the current coding unit in the current image, and the reference pixel corresponding to the first pixel is adjacent to the first pixel in the current image;

[0214] The encoding unit 502 is further configured to obtain a predicted value of the first pixel according to a reconstructed value of a reference pixel of the first pixel, so as to obtain encoding information of the current encoding unit.

[0215] In one implementation, the encoding unit 502 may also be used to: encode the string indication flag so that the encoding information includes the string indication flag.

[0216] In yet another implementation, the encoding unit 502 may be further configured to: encode a value K, such that the encoding information includes the value K, and the value K is greater than or equal to zero.

[0217] In yet another implementation, the encoding unit 502 may be further configured to: encode a string displacement vector of the current string, so that the encoding information includes the string displacement vector.

[0218] In another embodiment, the current coding unit includes P rows and Q columns of pixels; wherein the values ​​of P and Q are both positive integers; if the scanning mode of the current coding unit is a horizontal scanning mode, and the horizontal scanning mode indicates that the current coding unit is scanned from top to bottom, then the historical coding unit is located above the current coding unit, and the first pixel is a pixel located in the first row of the current coding unit.

[0219] In this case, if all pixels in the current string are second pixels, or the current string includes the first pixel and the second pixel; the second pixel is a pixel located outside the first row of the current coding unit, and each second pixel in the current string is distributed in at least one row in the current coding unit; then correspondingly, the coding unit 502 can also be used for:

[0220] Obtaining the predicted value of the second pixel in each row of the current string row by row; or,

[0221] Taking a single pixel as a unit, obtaining the predicted value of each second pixel in the current string pixel by pixel;

[0222] The predicted value of any second pixel is obtained based on the reconstructed value of the reference pixel located above and adjacent to the any second pixel.

[0223] In another embodiment, the current coding unit includes P rows and Q columns of pixels; wherein the values ​​of P and Q are both positive integers; if the scanning mode of the current coding unit is a vertical scanning mode, and the vertical scanning mode indicates that the current coding unit is scanned from left to right, then the historical coding unit is located to the left of the current coding unit, and the first pixel is the pixel located in the first column of the current coding unit.

[0224] In this case, if all pixels in the current string are third pixels, or the current string includes the first pixel and the third pixel; the third pixel is a pixel located outside the first column of the current coding unit, and each third pixel in the current string is distributed in at least one column in the current coding unit; then correspondingly, the coding unit 502 can also be used for:

[0225] Taking columns as units, obtaining predicted values ​​of the third pixels in each column of the current string column by column; or,

[0226] Taking a single pixel as a unit, obtaining a predicted value of each third pixel in the current string pixel by pixel;

[0227] The predicted value of any third pixel is obtained based on the reconstructed value of the reference pixel located to the left and adjacent to any second pixel.

[0228] In still another implementation, the encoding unit 502 may be further configured to: encode a string scan mode flag, so that the encoding information includes the string scan mode flag.

[0229] In another embodiment, the current image is divided into a plurality of processing units, each processing unit includes one or more encoding units; the plurality of processing units include: a current processing unit and an encoded processing unit, the current processing unit includes the current encoding unit; accordingly, the encoding unit 502 may also be used to:

[0230] If the current string is not the unit vector string, searching for a reference string of the current string from the current processing unit and a portion of the encoded coding units in the encoded processing units;

[0231] The prediction value of each pixel in the current string is obtained according to the reference string to obtain the encoding information of the current encoding unit.

[0232] In another implementation manner, the encoding unit 502 may also be used to:

[0233] If the current coding unit includes an unmatched pixel, the pixel value of the unmatched pixel is encoded so that the encoding information includes the pixel value of the unmatched pixel.

[0234] According to one embodiment of the present application, Figure 2 Each step involved in the method shown can be performed by Figure 5 The video encoding device shown in FIG. 1 is executed by each unit in the video encoding device shown in FIG. Figure 2 The step S201 shown in FIG. 1 can be performed by Figure 5 The acquisition unit 501 shown in FIG. 1 is executed, and steps S202-S203 can be performed by Figure 5 The encoding unit 502 shown in FIG.

[0235] According to another embodiment of the present application, Figure 5 The various units in the video encoding device shown can be separately or completely combined into one or several other units to form, or one (some) of the units can be further divided into multiple smaller units in function to form, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present invention. The above units are divided based on logical functions. In practical applications, the functions of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present invention, other units can also be included based on the video encoding device. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.

[0236] According to another embodiment of the present application, the program can be executed by running on a general computing device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2 A computer program (including program code) for each step involved in the corresponding method shown in Figure 5 The video encoding device shown in the embodiment of the present invention is used to implement the video encoding method of the embodiment of the present invention. The computer program can be recorded on a computer-readable recording medium, for example, and loaded into the above-mentioned computing device through the computer-readable recording medium and run therein.

[0237] In the encoding process of the embodiment of the present invention, when the current string of the current coding unit is a unit vector string and the current string includes the first pixel (such as the pixel of the first row in the current coding unit or the pixel of the first column in the current coding unit, etc.), the reference pixel of the first pixel can be determined from the historical decoding unit in the current image, and the prediction value of the first pixel can be obtained according to the reconstructed value of the reference pixel to realize the encoding process. It can be seen that the embodiment of the present invention allows the use of pixels in the historical decoding units adjacent to the current coding unit as reference pixels, so that any string in the current coding unit can become a unit vector string, which can effectively broaden the scope of application of the unit vector string and help improve the encoding performance. In addition, the prediction coding mode adopted by the embodiment of the present invention for the current coding unit is not limited to the equivalent string and the unit vector string sub-mode, but can also be other prediction coding modes such as the string prediction sub-mode in the intra-frame string copy mode; that is, the embodiment of the present invention allows the coding unit under the string prediction sub-mode to use the unit vector string, which can further broaden the scope of application of the unit vector string and improve the encoding performance of the string prediction.

[0238] Based on the description of the embodiment of the above video decoding method, the embodiment of the present invention further discloses a video decoding device, which can be a computer program (including program code) running in the above-mentioned video decoding device. The video decoding device can execute Figure 4 See the method shown in Figure 6 , the video decoding device may run the following units:

[0239] An acquisition unit 601 is used to determine a current string to be decoded from a current coding unit of a current image;

[0240] A decoding unit 602 is configured to determine a reference pixel of a first pixel from a historical decoding unit in the current image if the current string is a unit vector string and the current string includes a first pixel; the historical decoding unit refers to a decoded coding unit adjacent to the current coding unit in the current image, and the reference pixel corresponding to the first pixel is adjacent to the first pixel in the current image;

[0241] The decoding unit 602 is further configured to obtain a predicted value of the first pixel according to a reconstructed value of a reference pixel of the first pixel, so as to obtain a decoded image.

[0242] In one implementation, the decoding unit 602 may also be configured to:

[0243] Decoding a string indication flag from the encoding information of the current encoding unit;

[0244] If the string indication flag is a target value, the current string is determined to be a unit vector string.

[0245] In another implementation manner, the decoding unit 602 may also be used to:

[0246] Decoding a value K from the encoding information of the current encoding unit, where the value K is greater than or equal to zero; the value K is used to indicate that at least one string after the Kth group of pixels in the target group of pixels in the current encoding unit is a unit vector string, and a group of pixels includes: a string or at least one unmatched pixel;

[0247] If the current string is located after the Kth group of pixels in the target group of pixels, the current string is determined to be the unit vector string.

[0248] In another embodiment, if each group of pixels includes a string, the value K is used to indicate that the K+1th string in the target group of pixels in the current coding unit is the unit vector string;

[0249] Accordingly, when the decoding unit 602 is used to determine that the current string is the unit vector string if the current string is located after the Kth group of pixels in the target group of pixels, it can be specifically used to:

[0250] If the current string is the K+1th string in the target group of pixels, the current string is determined to be the unit vector string.

[0251] In another implementation manner, the decoding unit 602 may also be used to:

[0252] Decoding a string displacement vector of the current string from the encoding information of the current encoding unit;

[0253] If the string displacement vector is a unit vector, the current string is determined to be the unit vector string.

[0254] In another embodiment, the current coding unit includes P rows and Q columns of pixels; wherein the values ​​of P and Q are both positive integers; if the scanning mode of the current coding unit is a horizontal scanning mode, and the horizontal scanning mode indicates that the current coding unit is scanned from top to bottom, then the historical decoding unit is located above the current coding unit, and the first pixel is a pixel located in the first row of the current coding unit.

[0255] In this case, if all pixels in the current string are second pixels, or the current string includes the first pixel and the second pixel; the second pixel is a pixel located outside the first row of the current coding unit, and each second pixel in the current string is distributed in at least one row in the current coding unit; then, accordingly, the decoding unit 602 may also be used for:

[0256] Obtaining the predicted value of the second pixel in each row of the current string row by row; or,

[0257] Taking a single pixel as a unit, obtaining the predicted value of each second pixel in the current string pixel by pixel;

[0258] The predicted value of any second pixel is obtained based on the reconstructed value of the reference pixel located above and adjacent to the any second pixel.

[0259] In another embodiment, the current coding unit includes P rows and Q columns of pixels; wherein the values ​​of P and Q are both positive integers; if the scanning mode of the current coding unit is a vertical scanning mode, and the vertical scanning mode indicates that the current coding unit is scanned from left to right, then the historical decoding unit is located to the left of the current coding unit, and the first pixel is the pixel located in the first column of the current coding unit.

[0260] In this case, if all pixels in the current string are third pixels, or the current string includes the first pixel and the third pixel; the third pixel is a pixel located outside the first column of the current coding unit, and each third pixel in the current string is distributed in at least one column in the current coding unit; then, accordingly, the decoding unit 602 may also be used for:

[0261] Taking columns as units, obtaining predicted values ​​of the third pixels in each column of the current string column by column; or,

[0262] Taking a single pixel as a unit, obtaining a predicted value of each third pixel in the current string pixel by pixel;

[0263] The predicted value of any third pixel is obtained based on the reconstructed value of the reference pixel located to the left and adjacent to any second pixel.

[0264] In another implementation manner, the decoding unit 602 may also be used to:

[0265] Decoding a string scan mode flag from the encoding information of the current encoding unit;

[0266] If the string scanning mode flag is a third value, determining that the scanning mode of the current coding unit is a horizontal scanning mode;

[0267] If the string scanning mode flag is a fourth value, it is determined that the scanning mode of the current encoding unit is a vertical scanning mode.

[0268] In another embodiment, the current image is divided into a plurality of processing units, each processing unit includes one or more encoding units; the plurality of processing units include: a current processing unit and a decoded processing unit, the current processing unit includes the current encoding unit; accordingly, the decoding unit 602 may also be used to:

[0269] If the current string is not the unit vector string, searching for a reference string of the current string from the current processing unit and a portion of the decoded coding units in the decoded processing unit;

[0270] The predicted value of each pixel in the current string is obtained according to the reference string to obtain a decoded image.

[0271] According to one embodiment of the present application, Figure 4 Each step involved in the method shown can be performed by Figure 6 The video decoding device shown in FIG. 1 is executed by each unit in the video decoding device shown in FIG. Figure 4 The step S401 shown in FIG. 4 can be performed by Figure 6 The acquisition unit 501 shown in FIG. 1 is executed, and steps S402-S403 can be performed by Figure 6 The decoding unit 602 shown in FIG.

[0272] According to another embodiment of the present application, Figure 6 The various units in the video decoding device shown can be separately or completely combined into one or several other units to form, or one (some) of the units can be further divided into multiple smaller units in function to form, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present invention. The above units are divided based on logical functions. In practical applications, the functions of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present invention, other units can also be included based on the video decoding device. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.

[0273] According to another embodiment of the present application, the program can be executed by running on a general computing device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 4 A computer program (including program code) for each step involved in the corresponding method shown in Figure 6 The video decoding device shown in the embodiment of the present invention is used to implement the video decoding method of the embodiment of the present invention. The computer program can be recorded on a computer-readable recording medium, for example, and loaded into the above-mentioned computing device through the computer-readable recording medium and run therein.

[0274] In the decoding process of the embodiment of the present invention, when the current string of the current coding unit is a unit vector string and the current string includes the first pixel (such as the pixel of the first row in the current coding unit or the pixel of the first column in the current coding unit, etc.), the reference pixel of the first pixel can be determined from the historical decoding unit in the current image, and the prediction value of the first pixel can be obtained according to the reconstructed value of the reference pixel to realize the decoding process. It can be seen that the embodiment of the present invention allows the use of pixels in the historical decoding units adjacent to the current coding unit as reference pixels, so that any string in the current coding unit can become a unit vector string, which can effectively broaden the scope of application of the unit vector string and help improve the decoding performance. In addition, the prediction coding mode adopted by the embodiment of the present invention for the current coding unit is not limited to the equivalent string and the unit vector string sub-mode, but can also be other prediction coding modes such as the string prediction sub-mode in the intra-frame string copy mode; that is, the embodiment of the present invention can allow the coding unit under the string prediction sub-mode to use the unit vector string, which can further broaden the scope of application of the unit vector string and improve the coding performance of the string prediction.

[0275] Based on the description of the above method embodiment and the apparatus embodiment, the embodiment of the present invention further provides a computer device; the computer device may be the above-mentioned video encoding device or the above-mentioned video decoding device. Figure 7 , the computer device may include at least a processor 701, an input interface 702, an output interface 703, and a computer storage medium 704. The processor 701, the input interface 702, the output interface 703, and the computer storage medium 704 in the computer device may be connected via a bus or other means. Optionally, if the computer device is the video encoding device mentioned above, the computer device may also include a video encoder; if the computer device is the video decoding device mentioned above, the computer device may also include a video decoder.

[0276] The computer storage medium 704 may be stored in the memory of the computer device, the computer storage medium 704 is used to store a computer program, the computer program includes program instructions, and the processor 701 is used to execute the program instructions stored in the computer storage medium 704. The processor 701 (or CPU (Central Processing Unit)) is the computing core and control core of the computer device, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding function. In one embodiment, when the computer device is a video encoding device, the processor 701 described in the embodiment of the present invention can be used to perform the above Figure 2In another implementation, when the computer device is a video decoding device, the processor 701 described in the embodiment of the present invention can be used to perform the above Figure 4 Relevant method steps of the video decoding method shown.

[0277] The embodiment of the present invention also provides a computer storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer storage medium provides a storage space, and the storage space stores the operating system of the computer device. In addition, one or more instructions suitable for being loaded and executed by the processor 1001 are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage; optionally, it can also be at least one computer storage medium located away from the aforementioned processor.

[0278] In one embodiment, when the computer device is the video decoding device mentioned above, the processor 701 may load and execute one or more first instructions stored in the computer storage medium to implement the above Figure 4 The corresponding steps of the method in the embodiment of the video decoding method shown; in a specific implementation, one or more first instructions in the computer storage medium are loaded by the processor 701 and execute the following steps:

[0279] Determining a current string to be decoded from a current coding unit of a current image;

[0280] If the current string is a unit vector string and the current string includes a first pixel, determining a reference pixel of the first pixel from a historical decoding unit in the current image; the historical decoding unit refers to a decoded coding unit adjacent to the current coding unit in the current image, and the reference pixel corresponding to the first pixel is adjacent to the first pixel in the current image;

[0281] A predicted value of the first pixel is obtained according to a reconstructed value of a reference pixel of the first pixel to obtain a decoded image.

[0282] In one implementation, the one or more first instructions may also be loaded and specifically executed by the processor 701:

[0283] Decoding a string indication flag from the encoding information of the current encoding unit;

[0284] If the string indication flag is a target value, the current string is determined to be a unit vector string.

[0285] In another implementation manner, the one or more first instructions may also be loaded and specifically executed by the processor 701:

[0286] Decoding a value K from the encoding information of the current encoding unit, where the value K is greater than or equal to zero; the value K is used to indicate that at least one string after the Kth group of pixels in the target group of pixels in the current encoding unit is a unit vector string, and a group of pixels includes: a string or at least one unmatched pixel;

[0287] If the current string is located after the Kth group of pixels in the target group of pixels, the current string is determined to be the unit vector string.

[0288] In another embodiment, if each group of pixels includes a string, the value K is used to indicate that the K+1th string in the target group of pixels in the current coding unit is the unit vector string;

[0289] Correspondingly, if the current string is located after the Kth group of pixels in the target group of pixels, when it is determined that the current string is the unit vector string, the one or more first instructions may be loaded and specifically executed by the processor 701:

[0290] If the current string is the K+1th string in the target group of pixels, the current string is determined to be the unit vector string.

[0291] In another implementation manner, the one or more first instructions may also be loaded and specifically executed by the processor 701:

[0292] Decoding a string displacement vector of the current string from the encoding information of the current encoding unit;

[0293] If the string displacement vector is a unit vector, the current string is determined to be the unit vector string.

[0294] In another embodiment, the current coding unit includes P rows and Q columns of pixels; wherein the values ​​of P and Q are both positive integers; if the scanning mode of the current coding unit is a horizontal scanning mode, and the horizontal scanning mode indicates that the current coding unit is scanned from top to bottom, then the historical decoding unit is located above the current coding unit, and the first pixel is a pixel located in the first row of the current coding unit.

[0295] In this case, if all pixels in the current string are second pixels, or the current string includes the first pixel and the second pixel; the second pixel is a pixel located outside the first row of the current coding unit, and each second pixel in the current string is distributed in at least one row in the current coding unit; then correspondingly, the one or more first instructions can also be loaded and specifically executed by the processor 701:

[0296] Obtaining the predicted value of the second pixel in each row of the current string row by row; or,

[0297] Taking a single pixel as a unit, obtaining the predicted value of each second pixel in the current string pixel by pixel;

[0298] The predicted value of any second pixel is obtained based on the reconstructed value of the reference pixel located above and adjacent to the any second pixel.

[0299] In another embodiment, the current coding unit includes P rows and Q columns of pixels; wherein the values ​​of P and Q are both positive integers; if the scanning mode of the current coding unit is a vertical scanning mode, and the vertical scanning mode indicates that the current coding unit is scanned from left to right, then the historical decoding unit is located to the left of the current coding unit, and the first pixel is the pixel located in the first column of the current coding unit.

[0300] In this case, if all pixels in the current string are third pixels, or the current string includes the first pixel and the third pixel; the third pixel is a pixel located outside the first column of the current coding unit, and each third pixel in the current string is distributed in at least one column in the current coding unit; then correspondingly, the one or more first instructions can also be loaded and specifically executed by the processor 701:

[0301] Taking columns as units, obtaining predicted values ​​of the third pixels in each column of the current string column by column; or,

[0302] Taking a single pixel as a unit, obtaining a predicted value of each third pixel in the current string pixel by pixel;

[0303] The predicted value of any third pixel is obtained based on the reconstructed value of the reference pixel located to the left and adjacent to any second pixel.

[0304] In another implementation manner, the one or more first instructions may also be loaded and specifically executed by the processor 701:

[0305] Decoding a string scan mode flag from the encoding information of the current encoding unit;

[0306] If the string scanning mode flag is a third value, determining that the scanning mode of the current coding unit is a horizontal scanning mode;

[0307] If the string scanning mode flag is a fourth value, it is determined that the scanning mode of the current encoding unit is a vertical scanning mode.

[0308] In another embodiment, the current image is divided into a plurality of processing units, each processing unit includes one or more encoding units; the plurality of processing units include: a current processing unit and a decoded processing unit, the current processing unit includes the current encoding unit; accordingly, the one or more first instructions may also be loaded and specifically executed by the processor 701:

[0309] If the current string is not the unit vector string, searching for a reference string of the current string from the current processing unit and a portion of the decoded coding units in the decoded processing unit;

[0310] The predicted value of each pixel in the current string is obtained according to the reference string to obtain a decoded image.

[0311] In another embodiment, when the computer device is the video encoding device mentioned above, the processor 701 may load and execute one or more second instructions stored in the computer storage medium to implement the above Figure 2 The corresponding steps of the method in the embodiment of the video encoding method shown; in a specific implementation, one or more second instructions in the computer storage medium are loaded by the processor 701 and execute the following steps:

[0312] Determining a current string to be encoded from a current encoding unit of a current image;

[0313] If the current string is a unit vector string and the current string includes a first pixel, determining a reference pixel of the first pixel from a historical coding unit in the current image; the historical coding unit refers to an encoded coding unit adjacent to the current coding unit in the current image, and the reference pixel corresponding to the first pixel is adjacent to the first pixel in the current image;

[0314] A prediction value of the first pixel is obtained according to a reconstructed value of a reference pixel of the first pixel to obtain encoding information of the current encoding unit.

[0315] In one implementation, the one or more second instructions may also be loaded and specifically executed by the processor 701:

[0316] The string indication flag is encoded so that the encoding information includes the string indication flag.

[0317] In another implementation manner, the one or more second instructions may also be loaded and specifically executed by the processor 701:

[0318] Encode the value K so that the encoding information includes the value K, and the value K is greater than or equal to zero.

[0319] In another implementation manner, the one or more second instructions may also be loaded and specifically executed by the processor 701:

[0320] Encode the string displacement vector of the current string so that the encoding information includes the string displacement vector.

[0321] In another embodiment, the current coding unit includes P rows and Q columns of pixels; wherein the values ​​of P and Q are both positive integers; if the scanning mode of the current coding unit is a horizontal scanning mode, and the horizontal scanning mode indicates that the current coding unit is scanned from top to bottom, then the historical coding unit is located above the current coding unit, and the first pixel is a pixel located in the first row of the current coding unit.

[0322] In this case, if all pixels in the current string are second pixels, or the current string includes the first pixel and the second pixel; the second pixel is a pixel located outside the first row of the current coding unit, and each second pixel in the current string is distributed in at least one row in the current coding unit; then correspondingly, the one or more second instructions can also be loaded and specifically executed by the processor 701:

[0323] Obtaining the predicted value of the second pixel in each row of the current string row by row; or,

[0324] Taking a single pixel as a unit, obtaining the predicted value of each second pixel in the current string pixel by pixel;

[0325] The predicted value of any second pixel is obtained based on the reconstructed value of the reference pixel located above and adjacent to the any second pixel.

[0326] In another embodiment, the current coding unit includes P rows and Q columns of pixels; wherein the values ​​of P and Q are both positive integers; if the scanning mode of the current coding unit is a vertical scanning mode, and the vertical scanning mode indicates that the current coding unit is scanned from left to right, then the historical coding unit is located to the left of the current coding unit, and the first pixel is the pixel located in the first column of the current coding unit.

[0327] In this case, if all pixels in the current string are third pixels, or the current string includes the first pixel and the third pixel; the third pixel is a pixel located outside the first column of the current coding unit, and each third pixel in the current string is distributed in at least one column in the current coding unit; then, correspondingly, the one or more second instructions can also be loaded and specifically executed by the processor 701:

[0328] Taking columns as units, obtaining predicted values ​​of the third pixels in each column of the current string column by column; or,

[0329] Taking a single pixel as a unit, obtaining a predicted value of each third pixel in the current string pixel by pixel;

[0330] The predicted value of any third pixel is obtained based on the reconstructed value of the reference pixel located to the left and adjacent to any second pixel.

[0331] In another implementation manner, the one or more second instructions may also be loaded and specifically executed by the processor 701:

[0332] The encoding string scan mode flag is included in the encoding information.

[0333] In another embodiment, the current image is divided into a plurality of processing units, each processing unit includes one or more encoding units; the plurality of processing units include: a current processing unit and an encoded processing unit, the current processing unit includes the current encoding unit; accordingly, the one or more second instructions may also be loaded and specifically executed by the processor 701:

[0334] If the current string is not the unit vector string, searching for a reference string of the current string from the current processing unit and a portion of the encoded coding units in the encoded processing units;

[0335] The prediction value of each pixel in the current string is obtained according to the reference string to obtain the encoding information of the current encoding unit.

[0336] In another implementation manner, the one or more second instructions may also be loaded and specifically executed by the processor 701:

[0337] If the current coding unit includes an unmatched pixel, the pixel value of the unmatched pixel is encoded so that the encoding information includes the pixel value of the unmatched pixel.

[0338] In the decoding process of the embodiment of the present invention, when the current string of the current coding unit is a unit vector string and the current string includes the first pixel (such as the pixel of the first row in the current coding unit or the pixel of the first column in the current coding unit, etc.), the reference pixel of the first pixel can be determined from the historical decoding unit in the current image, and the prediction value of the first pixel can be obtained according to the reconstructed value of the reference pixel to realize the decoding process. It can be seen that the embodiment of the present invention allows the use of pixels in the historical decoding units adjacent to the current coding unit as reference pixels, so that any string in the current coding unit can become a unit vector string, which can effectively broaden the scope of application of the unit vector string and help improve the decoding performance. In addition, the prediction coding mode adopted by the embodiment of the present invention for the current coding unit is not limited to the equivalent string and the unit vector string sub-mode, but can also be other prediction coding modes such as the string prediction sub-mode in the intra-frame string copy mode; that is, the embodiment of the present invention can allow the coding unit under the string prediction sub-mode to use the unit vector string, which can further broaden the scope of application of the unit vector string and improve the coding performance of the string prediction.

[0339] It should be noted that according to one aspect of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above Figure 2 The video encoding method shown or Figure 4 The method provided in various optional aspects of the video decoding method embodiment shown.

[0340] Furthermore, it should be understood that what is disclosed above is only a preferred embodiment of the present invention, and certainly cannot be used to limit the scope of rights of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.

Claims

1. A video decoding method, characterized in that: include: Determining a current string to be decoded from a current coding unit of a current image; If the current string is a unit vector string, and the current string includes a first pixel, and the first pixel is a pixel on an edge row or an edge column in the current coding unit, a reference pixel of the first pixel is determined from a historical decoding unit in the current image; the historical decoding unit refers to a decoded coding unit adjacent to the current coding unit in the current image, and a reference pixel corresponding to the first pixel is adjacent to the first pixel in the current image; A predicted value of the first pixel is obtained according to a reconstructed value of a reference pixel of the first pixel to obtain a decoded image.

2. The method according to claim 1, characterized in that The current coding unit is encoded in a string prediction sub-mode in an intra string copy mode; Furthermore, the coding units in the string prediction sub-mode are allowed to use unit vector strings.

3. The method according to claim 1 or 2, characterized in that The method further comprises: Decoding a string indication flag from the encoding information of the current encoding unit; If the string indication flag is a target value, the current string is determined to be a unit vector string.

4. The method according to claim 1 or 2, characterized in that: The method further comprises: Decoding a value K from the encoding information of the current encoding unit, wherein the value K is greater than or equal to zero; the value K is used to indicate that at least one string after the Kth group of pixels in the target group of pixels in the current encoding unit is a unit vector string, and a group of pixels includes: a string or at least one unmatched pixel; If the current string is located after the Kth group of pixels in the target group of pixels, the current string is determined to be the unit vector string.

5. The method according to claim 4, characterized in that If each group of pixels includes a string, the value K is used to indicate that the K+1th string in the target group of pixels in the current coding unit is the unit vector string; If the current string is located after the Kth group of pixels in the target group of pixels, determining that the current string is the unit vector string includes: If the current string is the K+1th string in the target group of pixels, the current string is determined to be the unit vector string.

6. The method according to claim 1 or 2, characterized in that: The method further comprises: Decoding a string displacement vector of the current string from the encoding information of the current encoding unit; If the string displacement vector is a unit vector, the current string is determined to be the unit vector string.

7. The method according to claim 6, characterized in that The unit vector includes a first element and a second element; If the scanning mode of the current coding unit is a horizontal scanning mode, the element value of the first element is a first value, and the element value of the second element is a second value; If the scanning mode of the current coding unit is the vertical scanning mode, the element value of the first element is the second value, and the element value of the second element is the first value.

8. The method according to claim 6, characterized in that The current image is divided into a plurality of processing units, each processing unit including one or more coding units; the plurality of processing units include: a current processing unit and a decoded processing unit, the current processing unit including the current coding unit; The string displacement vector is used to represent the displacement from the current string to the reference string, and allows the reference string to not satisfy one or more of the following conditions: Any reference pixel in the reference string is within the specified area; When any reference pixel in the reference string is in a decoded processing unit adjacent to the left of the current processing unit, pixels in the target area where any reference pixel in the reference string is located after being shifted to the right by a predetermined pixel have not yet been reconstructed; Each reference pixel in the reference string is located in a same alignment area, and the size of the alignment area is determined according to the size of the processing unit; Any reference pixel in the reference string does not belong to the current string.

9. The method according to claim 1, characterized in that The current coding unit includes P rows and Q columns of pixels; wherein the values ​​of P and Q are both positive integers; If the scanning mode of the current coding unit is a horizontal scanning mode, and the horizontal scanning mode indicates that the current coding unit is scanned in a top-down order, then the historical decoding unit is located above the current coding unit, and the first pixel is a pixel located in the first row of the current coding unit.

10. The method according to claim 9, characterized in that The method for obtaining the reconstruction value of the reference pixel of the first pixel includes any one of the following: The reconstructed value of the reference pixel of the first pixel is obtained from a first storage space corresponding to the intra-frame string copy mode; The reconstructed value of the reference pixel of the first pixel is obtained from a second storage space corresponding to the intra prediction mode; The current image is divided into multiple N×N areas. When the first pixel is located in the first row of any N×N area, the reconstructed value of the reference pixel of the first pixel is obtained from the second storage space; otherwise, the reconstructed value of the reference pixel of the first pixel is obtained from the first storage space.

11. The method according to claim 9, characterized in that All pixels in the current string are second pixels, or the current string includes the first pixel and the second pixel; the second pixel is a pixel located outside the first row of the current coding unit, and each second pixel in the current string is distributed in at least one row in the current coding unit; The method further comprises: Obtaining the predicted value of the second pixel in each row of the current string row by row; or, Taking a single pixel as a unit, obtaining the predicted value of each second pixel in the current string pixel by pixel; The predicted value of any second pixel is obtained based on the reconstructed value of the reference pixel located above and adjacent to the any second pixel.

12. The method according to claim 1, characterized in that The current coding unit includes P rows and Q columns of pixels; wherein the values ​​of P and Q are both positive integers; If the scanning mode of the current coding unit is a vertical scanning mode, and the vertical scanning mode indicates that the current coding unit is scanned from left to right, then the historical decoding unit is located to the left of the current coding unit, and the first pixel is a pixel located in the first column of the current coding unit.

13. The method according to claim 12, characterized in that The method for obtaining the reconstruction value of the reference pixel of the first pixel includes any one of the following: The reconstructed value of the reference pixel of the first pixel is obtained from a first storage space corresponding to the intra-frame string copy mode; The reconstructed value of the reference pixel of the first pixel is obtained from a second storage space corresponding to the intra prediction mode; The current image is divided into multiple N×N areas. When the first pixel is located in the first column of any N×N area, the reconstructed value of the reference pixel of the first pixel is obtained from the second storage space; otherwise, the reconstructed value of the reference pixel of the first pixel is obtained from the first storage space.

14. The method according to claim 12, characterized in that All pixels in the current string are third pixels, or the current string includes the first pixel and the third pixel; the third pixel is a pixel located outside the first column of the current coding unit, and each third pixel in the current string is distributed in at least one column in the current coding unit; The method further comprises: Taking columns as units, the predicted value of the third pixel in each column of the current string is obtained column by column; or, Taking a single pixel as a unit, obtaining a predicted value of each third pixel in the current string pixel by pixel; The predicted value of any third pixel is obtained based on the reconstructed value of the reference pixel located to the left and adjacent to the any third pixel.

15. The method according to any one of claims 9 to 14, characterized in that: The method further comprises: Decoding a string scan mode flag from the encoding information of the current encoding unit; If the string scanning mode flag is a third value, determining that the scanning mode of the current coding unit is a horizontal scanning mode; If the string scanning mode flag is a fourth value, it is determined that the scanning mode of the current encoding unit is a vertical scanning mode.

16. The method according to claim 1, wherein: The current image is divided into a plurality of processing units, each processing unit comprising one or more encoding units; The multiple processing units include: a current processing unit and a decoded processing unit, the current processing unit including the current encoding unit; The method further comprises: If the current string is not the unit vector string, searching for a reference string of the current string from the current processing unit and a portion of the decoded coding units in the decoded processing unit; The predicted value of each pixel in the current string is obtained according to the reference string to obtain a decoded image.

17. The method according to claim 16, characterized in that The reference string satisfies one or more of the following conditions: Any reference pixel in the reference string is within the range of the current processing unit and H decoded processing units to the left of the current processing unit, where H is a positive integer; When any reference pixel in the reference string is in a decoded processing unit adjacent to the left of the current processing unit, pixels in the target area where any reference pixel in the reference string is located after being shifted to the right by a predetermined pixel have not yet been reconstructed; Each reference pixel in the reference string is located in a same alignment area, and the size of the alignment area is determined according to the size of the processing unit; Each reference pixel in the reference string and each pixel in the current string are located in the same independent decoding area; Any reference pixel in the reference string does not belong to the current string.

18. The method according to claim 1, characterized in that If the current coding unit includes an unmatched pixel, the pixel value of the unmatched pixel is decoded from the encoding information of the current coding unit.

19. A video encoding method, characterized in that: include: Determining a current string to be encoded from a current coding unit in a current image; If the current string is a unit vector string, and the current string includes a first pixel, and the first pixel is a pixel on an edge row or an edge column in the current coding unit, a reference pixel of the first pixel is determined from a historical coding unit in the current image; the historical coding unit refers to an encoded coding unit adjacent to the current coding unit in the current image, and the reference pixel corresponding to the first pixel is adjacent to the first pixel in the current image; A prediction value of the first pixel is obtained according to a reconstructed value of a reference pixel of the first pixel to obtain encoding information of the current encoding unit.

20. The method of claim 19, wherein: The current coding unit is encoded in a string prediction sub-mode in an intra string copy mode; Furthermore, the coding units in the string prediction sub-mode are allowed to use unit vector strings.

21. The method according to claim 19 or 20, characterized in that The method further comprises: Encoding a string indication flag, so that the encoding information includes the string indication flag; If the current string is a unit vector string, the string indication flag is a target value.

22. The method according to claim 19 or 20, characterized in that The method further comprises: Encode a numerical value K so that the encoding information includes the numerical value K, and the value of the numerical value K is greater than or equal to zero; The value K is used to indicate that in the target group of pixels in the current coding unit, at least one string after the Kth group of pixels is a unit vector string, and a group of pixels includes: a string or at least one unmatched pixel.

23. The method of claim 22, wherein: If each group of pixels includes a string, the value K is used to indicate that the K+1th string in the target group of pixels in the current coding unit is the unit vector string.

24. The method according to claim 19 or 20, characterized in that The method further comprises: Encoding a string displacement vector of the current string so that the encoding information includes the string displacement vector; Among them, if the current string is the unit vector string, the string displacement vector is a unit vector.

25. The method of claim 24, wherein: The unit vector includes a first element and a second element; If the scanning mode of the current coding unit is a horizontal scanning mode, the element value of the first element is a first value, and the element value of the second element is a second value; If the scanning mode of the current coding unit is the vertical scanning mode, the element value of the first element is the second value, and the element value of the second element is the first value.

26. The method of claim 24, wherein: The current image is divided into a plurality of processing units, each processing unit including one or more encoding units; the plurality of processing units include: a current processing unit and an encoded processing unit, the current processing unit including the current encoding unit; The string displacement vector is used to represent the displacement from the current string to the reference string, and allows the reference string to not satisfy one or more of the following conditions: Any reference pixel in the reference string is within the specified area; When any reference pixel in the reference string is in an encoded processing unit adjacent to the left of the current processing unit, pixels in the target area where any reference pixel in the reference string is located after being shifted to the right by a predetermined pixel have not yet been encoded; Each reference pixel in the reference string is located in a same alignment area, and the size of the alignment area is determined according to the size of the processing unit; Any reference pixel in the reference string does not belong to the current string.

27. The method of claim 19, wherein: The current coding unit includes P rows and Q columns of pixels; wherein the values ​​of P and Q are both positive integers; If the scanning mode of the current coding unit is a horizontal scanning mode, and the horizontal scanning mode indicates that the current coding unit is scanned in a top-down order, then the historical coding unit is located above the current coding unit, and the first pixel is a pixel located in the first row of the current coding unit.

28. The method of claim 27, wherein: The method for obtaining the reconstruction value of the reference pixel of the first pixel includes any one of the following: The reconstructed value of the reference pixel of the first pixel is obtained from a first storage space corresponding to the intra-frame string copy mode; The reconstructed value of the reference pixel of the first pixel is obtained from a second storage space corresponding to the intra prediction mode; The current image is divided into multiple N×N areas. When the first pixel is located in the first row of any N×N area, the reconstructed value of the reference pixel of the first pixel is obtained from the second storage space; otherwise, the reconstructed value of the reference pixel of the first pixel is obtained from the first storage space.

29. The method of claim 27, wherein: All pixels in the current string are second pixels, or the current string includes the first pixel and the second pixel; the second pixel is a pixel located outside the first row of the current coding unit, and each second pixel in the current string is distributed in at least one row in the current coding unit; The method further comprises: Obtaining the predicted value of the second pixel in each row of the current string row by row; or, Taking a single pixel as a unit, obtaining the predicted value of each second pixel in the current string pixel by pixel; The predicted value of any second pixel is obtained based on the reconstructed value of the reference pixel located above and adjacent to the any second pixel.

30. The method of claim 19, wherein: The current coding unit includes P rows and Q columns of pixels; wherein the values ​​of P and Q are both positive integers; If the scanning mode of the current coding unit is a vertical scanning mode, and the vertical scanning mode indicates that the current coding unit is scanned from left to right, then the historical coding unit is located to the left of the current coding unit, and the first pixel is a pixel located in the first column of the current coding unit.

31. The method of claim 30, wherein: The method for obtaining the reconstruction value of the reference pixel of the first pixel includes any one of the following: The reconstructed value of the reference pixel of the first pixel is obtained from a first storage space corresponding to the intra-frame string copy mode; The reconstructed value of the reference pixel of the first pixel is obtained from a second storage space corresponding to the intra prediction mode; The current image is divided into multiple N×N areas. When the first pixel is located in the first column of any N×N area, the reconstructed value of the reference pixel of the first pixel is obtained from the second storage space; otherwise, the reconstructed value of the reference pixel of the first pixel is obtained from the first storage space.

32. The method of claim 30, wherein: All pixels in the current string are third pixels, or the current string includes the first pixel and the third pixel; the third pixel is a pixel located outside the first column of the current coding unit, and each third pixel in the current string is distributed in at least one column in the current coding unit; The method further comprises: Taking columns as units, the predicted value of the third pixel in each column of the current string is obtained column by column; or, Taking a single pixel as a unit, obtaining a predicted value of each third pixel in the current string pixel by pixel; The predicted value of any third pixel is obtained based on the reconstructed value of the reference pixel located to the left and adjacent to the any third pixel.

33. The method according to any one of claims 27 to 32, characterized in that The method further comprises: encoding a string scan mode flag so that the encoding information includes the string scan mode flag; Among them, if the scanning mode of the current encoding unit is a horizontal scanning mode, the string scanning mode flag is a third value; if the scanning mode of the current encoding unit is a vertical scanning mode, the string scanning mode flag is a fourth value.

34. The method of claim 19, wherein: The current image is divided into a plurality of processing units, each processing unit comprising one or more encoding units; The multiple processing units include: a current processing unit and an encoded processing unit, the current processing unit includes the current encoding unit; The method further comprises: If the current string is not the unit vector string, searching for a reference string of the current string from the current processing unit and a portion of the encoded coding units in the encoded processing units; The prediction value of each pixel in the current string is obtained according to the reference string to obtain the encoding information of the current encoding unit.

35. The method of claim 34, wherein: The reference string satisfies one or more of the following conditions: Any reference pixel in the reference string is within the range of the current processing unit and H encoded processing units to the left of the current processing unit, where H is a positive integer; When any reference pixel in the reference string is in an encoded processing unit adjacent to the left of the current processing unit, pixels in the target area where any reference pixel in the reference string is located after being shifted to the right by a predetermined pixel have not yet been encoded; Each reference pixel in the reference string is located in a same alignment area, and the size of the alignment area is determined according to the size of the processing unit; Each reference pixel in the reference string and each pixel in the current string are located in the same independent coding region; Any reference pixel in the reference string does not belong to the current string.

36. The method of claim 19, wherein: The method further comprises: If the current coding unit includes an unmatched pixel, the pixel value of the unmatched pixel is encoded so that the encoding information includes the pixel value of the unmatched pixel.

37. A video decoding device, characterized in that: include: An acquisition unit, used to determine a current string to be decoded from a current coding unit of a current image; a decoding unit, configured to, if the current string is a unit vector string and the current string includes a first pixel, the first pixel being a pixel on an edge row or an edge column in the current coding unit, determine a reference pixel of the first pixel from a historical decoding unit in the current image; the historical decoding unit refers to a decoded coding unit adjacent to the current coding unit in the current image, and the reference pixel corresponding to the first pixel is adjacent to the first pixel in the current image; The decoding unit is further used to obtain a predicted value of the first pixel according to a reconstructed value of a reference pixel of the first pixel to obtain a decoded image.

38. A video encoding device, characterized in that: include: An acquisition unit, used to determine a current string to be encoded from a current encoding unit of a current image; a coding unit, configured to determine a reference pixel of the first pixel from historical coding units in the current image if the current string is a unit vector string and the current string includes a first pixel, the first pixel being a pixel on an edge row or an edge column in the current coding unit; the historical coding unit refers to an encoded coding unit adjacent to the current coding unit in the current image, and the reference pixel corresponding to the first pixel is adjacent to the first pixel in the current image; The encoding unit is further used to obtain a predicted value of the first pixel according to a reconstructed value of a reference pixel of the first pixel, so as to obtain encoding information of the current encoding unit.

39. A computer device, comprising an input interface and an output interface, characterized in that: Also includes: a processor adapted to implement one or more instructions; as well as, A computer storage medium, wherein the computer storage medium stores one or more first instructions, wherein the one or more first instructions are suitable for being loaded by the processor and executing the video decoding method as described in any one of claims 1-18; or, wherein the computer storage medium stores one or more second instructions, wherein the one or more second instructions are suitable for being loaded by the processor and executing the video encoding method as described in any one of claims 19-36.

40. A computer storage medium, characterized in that The computer storage medium stores one or more first instructions, and the one or more first instructions are suitable for being loaded by a processor and executing the video decoding method as described in any one of claims 1-18; or, the computer storage medium stores one or more second instructions, and the one or more second instructions are suitable for being loaded by the processor and executing the video encoding method as described in any one of claims 19-36.