Video encoding method, video decoding method and related equipment

By limiting the block size in video encoding and decoding, and using the intra string copy mode only under specific conditions, the problem that the intra string prediction scheme in the prior art is not conducive to hardware implementation, improving the encoding performance and simplifying the hardware implementation.

CN114466186BActive Publication Date: 2025-03-25TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210101714.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-02
Publication Date
2025-03-25
Estimated Expiration
2040-06-02

AI Technical Summary

Technical Problem

In the prior art, intra-string prediction schemes have parts that are not conducive to hardware implementation, especially in small block string prediction analysis and encoding efficiency.

Method used

By limiting the size of the block, the intra string copy mode is used for encoding and decoding only when specific preset conditions are met, reducing the complexity of encoding and decoding and saving the encoding of string prediction flags.

Benefits of technology

Reduces the number of small strings, reduces the number of memory accesses, improves encoding performance, and simplifies hardware implementation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114466186B_ABST
    Figure CN114466186B_ABST
Patent Text Reader

Abstract

The present disclosure provides a video encoding method, a video decoding method and related devices. The video encoding method comprises: obtaining a current image, wherein the current image comprises a current encoding block; when the size of the current encoding block meets a first preset condition, encoding the current encoding block using an intra-frame string copy mode, and encoding a string prediction flag of the current encoding block. The technical solution provided by the embodiment of the present disclosure can improve the encoding and decoding efficiency by limiting the size of the block for video encoding and decoding using string prediction technology.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] The present disclosure is a divisional application of the Chinese patent application “Video encoding method, video decoding method and related equipment” with application number 202010487810.X and application date June 2, 2020. The entire contents of the Chinese patent application are hereby introduced into the present disclosure as a reference. Technical Field

[0002] The present disclosure relates to the technical field of video encoding and decoding, and in particular to a video encoding method, a video decoding method, an electronic device, and a computer-readable storage medium. Background Art

[0003] On the one hand, the Internet is about to enter a new era of 5G (5th generation mobile networks or 5th generation wireless systems, 5th-Generation, the fifth generation of mobile communication technology). Images (videos) appearing in various Internet applications have become the main consumers of Internet bandwidth. In particular, the image traffic of mobile Internet is increasing day by day, and it will have an explosive growth in the 5G era, which will inject a new and powerful impetus into the accelerated development of image coding and decoding technology. At the same time, it also poses many severe new challenges to image coding and decoding technology that have never been encountered in the past. In the 5G era, everything is connected, and the new Internet images generated in various emerging applications are diverse and different. Therefore, how to study efficient image coding and decoding technology based on the characteristics of new Internet images with diversity and differences has become an urgent need.

[0004] On the other hand, the amount of video data required to depict even a relatively short film may also be quite large, which may cause difficulties when the data is streamed or otherwise transmitted through a communication network with limited bandwidth capacity. Therefore, before being transmitted through a modern telecommunications network, video data is usually compressed. Before transmission, a video compression device usually uses software and / or hardware on the source side to encode the video data, thereby reducing the amount of data required for representing the digital video image. The compressed data is then received at the destination by a video decompression device, which decodes the video data. Under limited network resources and an increasing demand for higher video quality, it is necessary to improve image quality without increasing the improved compression and decompression technology of bit rate.

[0005] The string prediction scheme in the related art (also referred to as intra-frame string copy technology or string matching technology) has a part that is not conducive to hardware implementation.

[0006] Therefore, a new video encoding method, video decoding method, electronic device and computer-readable storage medium are needed.

[0007] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure. Summary of the invention

[0008] The embodiments of the present disclosure provide a video encoding method, a video decoding method, an electronic device, and a computer-readable storage medium, which can improve the encoding and decoding efficiency of string prediction by limiting the size of blocks.

[0009] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0010] An embodiment of the present disclosure provides a video encoding method, which includes: acquiring a current image, where the current image includes a current coding block; when the size of the current coding block meets a first preset condition, encoding the current coding block using an intra-frame string copy mode, and encoding a string prediction flag of the current coding block.

[0011] An embodiment of the present disclosure provides a video decoding method, the method comprising: obtaining a code stream of a current image, the code stream comprising a current decoding block; when a size of the current decoding block meets a second preset condition, not adopting an intra-frame string copy mode to decode the current decoding block, and not decoding a string prediction flag of the current decoding block; when the size of the current decoding block does not meet the second preset condition, adopting an intra-frame string copy mode to decode the current decoding block, and decoding the string prediction flag of the current decoding block.

[0012] An embodiment of the present disclosure provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the video encoding method or the video decoding method described in the above embodiments is implemented.

[0013] An embodiment of the present disclosure provides an electronic device, comprising: at least one processor; a storage device, configured to store at least one program, and when the at least one program is executed by the at least one processor, the at least one processor implements the video encoding method or the video decoding method as described in the above embodiments.

[0014] In the technical solutions provided by some embodiments of the present disclosure, by limiting the size of the blocks in the string prediction technology, on the one hand, the number of small strings can be reduced, which is conducive to reducing the number of memory accesses. On the other hand, the encoding end can skip the analysis of string predictions for blocks of certain sizes, reducing complexity. In addition, the encoding of string prediction flags on certain blocks can be saved, which is conducive to improving encoding performance.

[0015] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0017] Figure 1 A basic block diagram of video encoding in the related art is schematically shown;

[0018] Figure 2 A schematic diagram schematically shows inter-frame prediction in the related art;

[0019] Figure 3 The schematic diagram of the position of the candidate MVP in the spatial domain of the Merge mode of the inter-frame prediction in the related art is schematically shown;

[0020] Figure 4 The schematic diagram of the position of candidate MVPs in the time domain of the Merge mode of inter-frame prediction in the related art is schematically shown;

[0021] Figure 5 A schematic diagram of intra-frame string replication in the related art is schematically shown;

[0022] Figure 6 A schematic diagram schematically shows a video encoding method according to an embodiment of the present disclosure;

[0023] Figure 7 A schematic diagram schematically shows an ISC reference block search range in an embodiment of the present disclosure;

[0024] Figure 8 A schematic diagram schematically shows a video decoding method according to an embodiment of the present disclosure;

[0025] Fig. 9 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0026] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more comprehensive and complete and will fully convey the concept of the example embodiments to those skilled in the art.

[0027] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.

[0028] The block diagrams shown in the accompanying drawings are only functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or in at least one hardware module or integrated circuit, or in different networks and / or processor devices and / or microcontroller devices.

[0029] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0030] First, some terms involved in the embodiments of the present disclosure are explained.

[0031] AVS: Audio Video Coding Standard, audio and video coding standard.

[0032] HEVC: High Efficiency Video Coding, also known as H.265.

[0033] VVC: Versatile Video Coding, also known as H.266.

[0034] Intra(picture)Prediction: intra-frame prediction.

[0035] Inter(picture)Prediction: Inter-frame prediction.

[0036] SCC: screen content coding, screen content / image coding.

[0037] Loop Filtering: Loop filtering.

[0038] QP: Quantization Parameter, quantization parameter.

[0039] LCU: Largest Coding Unit, maximum coding unit.

[0040] CTU: Coding Tree Unit, coding tree unit, generally divided from the largest coding unit downward.

[0041] CU: Coding Unit, coding unit.

[0042] PU: Prediction Unit, prediction unit.

[0043] MV: Motion Vector, motion vector.

[0044] MVP: Motion Vector Prediction, motion vector prediction value.

[0045] MVD: Motion Vector Difference, the difference between the true valuation of MVP and MV.

[0046] AMVP: Advanced Motion Vector Prediction, advanced motion vector prediction.

[0047] ME: Motion Estimation, the process of obtaining a motion vector MV is called motion estimation, which is a technology in motion compensation (MC).

[0048] MC: The process of obtaining an estimated value of the current image based on the motion vector and the inter-frame prediction method. Motion compensation is a method of describing the difference between adjacent frames (adjacent here means adjacent in coding relationship, and the two frames may not be adjacent in playback order). Specifically, it describes how each small block of the previous frame moves to a certain position in the current frame. This method is often used by video compression / video codecs to reduce spatial redundancy in video sequences. Adjacent frames are usually very similar, that is, they contain a lot of redundancy. The purpose of using motion compensation is to improve the compression ratio by eliminating this redundancy.

[0049] I Slice: Intra Slice, an image can be divided into one frame or two fields, and a frame can be divided into one or several slices.

[0050] Video signals can be captured by cameras or generated by computers. Due to different statistical characteristics, the corresponding compression encoding methods may also be different.

[0051] Some video coding technologies, such as HEVC, VVC, and AVS, use a hybrid coding framework, such as Figure 1 As shown, the images (pictures) in the input original video signal (input video) are encoded in sequence, and the following series of operations and processing are performed:

[0052] 1) Block partition structure: The input image is divided into several non-overlapping processing units, and similar compression operations are performed on each processing unit. This processing unit can be called CTU or LCU. Below CTU or LCU, more detailed divisions can be continued to obtain at least one basic coding unit, called CU. Each CU is the most basic element in the coding process. The following describes various possible coding methods for each CU.

[0053] 2) Predictive Coding: This includes intra-frame prediction and inter-frame prediction. The original video signal is predicted by the selected reconstructed video signal to obtain a residual video signal. 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.

[0054] a. Intra-frame prediction: The predicted signal comes from the area that has been encoded and reconstructed in the same image.

[0055] The basic idea of ​​intra prediction is to use the correlation of adjacent pixels to remove spatial redundancy. In video coding, adjacent pixels refer to the reconstructed pixels of the encoded CU around the current CU.

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

[0057] 3) Transform coding and quantization (Transform & Quantization): The residual video signal is transformed into the transform domain through DFT (Discrete Fourier Transform), DCT (Discrete Cosine Transform) and other transformation operations. 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.

[0058] In some video coding standards, there may be more than one transform mode to be selected, so the encoder also needs to select one of the transforms for the current CU to be encoded and inform the decoder.

[0059] Among them, the degree of quantization is usually determined by the quantization parameters (QP). When the QP value is large, the transform coefficients representing a larger value range will be quantized into the same output, which usually results in greater distortion and lower bit rate. On the contrary, when the QP value is small, the transform coefficients representing a smaller value range will be quantized into the same output, which usually results in less distortion and corresponds to a higher bit rate.

[0060] 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 bitstream.

[0061] At the same time, encoding generates other information, such as the selected coding mode, motion vectors, etc., which also need to be entropy encoded to reduce the bit rate.

[0062] 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 binary arithmetic coding (CABAC).

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

[0064] Figure 1 Shows a basic flow chart of a video encoder. Figure 1 The kth CU (marked as s k [x, y]) is used as an example. 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, s k [x, y] represents the 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 through 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 bit stream is output to a buffer for storage and waiting to be transmitted; the other application is to obtain the signal u' after inverse quantization and inverse transformation. 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 obtained by intra-image prediction f(s * k [x,y]).s * k [x,y] is obtained after loop filtering s' k [x,y], and s' k [x,y] is sent to the decoded image buffer for storage and used to generate the reconstructed video. s' k [x,y] is obtained after motion-compensated prediction s' r [x+m x ,y+m y ],s' r [x+m x ,y+m y ] represents the reference block, m x and m y Represent the horizontal and vertical components of the motion vector respectively.

[0065] Some video coding standards, such as HEVC, VVC, and AVS3, all adopt a block-based hybrid coding framework. They divide the original video data into a series of coding blocks, and combine video coding methods such as prediction, transform, and entropy coding to achieve video data compression. Among them, motion compensation is a commonly used prediction method for video coding. Motion compensation is based on the redundant characteristics of video content in the time domain or spatial domain, and derives the prediction value of the current coding block from the encoded area. This type of prediction method includes: inter-frame prediction, intra-frame block copy prediction, intra-frame string copy prediction, etc. In specific coding implementations, these prediction methods may be used alone or in combination. For coding blocks using these prediction methods, it is usually necessary to explicitly or implicitly encode at least one two-dimensional displacement vector in the bitstream to indicate the displacement of the current block (or the same-position block of the current block) relative to at least one of its reference blocks.

[0066] Among them, in different prediction modes and different implementations, the displacement vector may have different names. In the embodiments of the present disclosure, they are uniformly described in the following manner: 1) The displacement vector in inter-frame prediction is called a motion vector (MV); 2) The displacement vector in intra-frame block copying is called a block vector or a block displacement vector; 3) The displacement vector in intra-frame string copying is called a string vector (String Vector, abbreviated as SV).

[0067] The following first introduces the relevant technologies in inter-frame prediction.

[0068] Figure 2 The following is a schematic diagram of inter-frame prediction in the related art.

[0069] like Figure 2 As shown in Figure 1, inter-frame prediction uses the correlation of the video time domain and uses the pixels of the adjacent coded images to predict the pixels of the current image, so as to effectively remove the redundancy of the video time domain and effectively save the bits of the coded residual data. r is the reference frame, B is the current block to be encoded, and B r is the reference block of B. B' has the same coordinate position as B in the image.

[0070] Assume that the coordinates of Br are (x r ,y r ), the coordinates of B' are (x, y). The current block to be coded B and its reference block B r The displacement between is called the motion vector (MV), that is:

[0071] MV=(x r -x,y r -y) (1)

[0072] Considering that adjacent blocks in the temporal or spatial domain have a strong correlation, the MV prediction technology can be used to further reduce the bits required for encoding the MV. In H.265 / HEVC, inter-frame prediction includes two MV prediction technologies: Merge and AMVP.

[0073] The Merge mode creates a MV candidate list for the current PU, which contains 5 candidate MVs (and their corresponding reference images). The 5 candidate MVs are traversed and the one with the lowest rate-distortion cost is selected as the optimal MV. If the codec creates the MV candidate list in the same way, the encoder only needs to transmit the index of the optimal MV in the MV candidate list.

[0074] It should be noted that HEVC's MV prediction technology also has a skip mode, which is a special case of the merge mode. After finding the optimal MV in the merge mode, if the current block to be coded is basically the same as the reference block, then there is no need to transmit residual data, only the MV index and a skip flag (a flag indicating whether the coding is in skip mode) need to be transmitted.

[0075] Among them, the MV candidate list established in the Merge mode includes both spatial domain and time domain situations.

[0076] Among them, the airspace provides up to 4 candidate MVs, which are established as follows: Figure 3 As shown. The MV candidate list in the current block space is established in the order of A1->B1->B0->A0->B2, where B2 is a substitute, that is, when at least one of A1, B1, B0, A0 does not exist, the motion information of B2 needs to be used. That is, the size of the MV candidate list is 5, but HEVC uses at most 4 of them (even if all five exist), and when one of them is unavailable, the next one is used in sequence.

[0077] Among them, analogous to the spatial domain, the spatial domain uses adjacent blocks, and the temporal domain uses the MV of the co-located (corresponding position) PU of the adjacent frame to infer the MV of the current position. The temporal domain only provides at most one candidate MV, which is established as follows Figure 4As shown. Inter-frame predicted images must have a reference image, like a B frame refers to the image before it. The current image is called cur, the reference image of the current image is called cur_ref, the co-located image of the current image is called col, and the reference image of the co-located image is called col_ref. Assume that the distance between the co-located image col and its reference image col_ref is tb, and the distance between the current image cur and its reference image cur_ref is td. In the specific implementation, tb can be the difference between the sequence numbers (picture order count, POC) of the co-located image and its reference image, and td can be the difference between the sequence numbers (picture order count, POC) of the current image and its reference image, which can be obtained by scaling the MV of the co-located PU according to the following formula:

[0078] curMV=td*colMV / tb (2)

[0079] Where curMV and colMV represent the MVs of the current PU and the co-located PU respectively, so that the MV of the current image can be derived from the col (co-located) image. If the PU at position D0 on the co-located block is not available, it is replaced with the co-located PU at position D1.

[0080] Among them, the MV candidate list established by the Merge mode includes the above-mentioned spatial domain and time domain situations. For B Slice, it also includes a combination list method. For B frames, which need to refer to the forward frame MV and the backward frame MV, it has two MV lists, list0 and list. Therefore, for the PU in the B Slice, since there are two MVs, its MV candidate list also needs to provide two MVPs. HEVC generates a combination list for B Slice by combining the first 4 candidate MVs in the MV candidate list in pairs.

[0081] In the merge mode mentioned above, MVP is directly used as MV. AMVP mode, similar to merge mode, uses the MV correlation of adjacent blocks in the spatial and temporal domains to first establish a candidate prediction MV list for the current PU. AMVP can use the correlation of motion vectors in space and time to establish a spatial candidate list and a temporal candidate list, respectively, and then select the final MVP from the candidate list. Unlike the Merge mode, in the AMVP mode, the most likely predicted MV, namely MVP, is selected from the candidate prediction MV list, and differentially encoded with the optimal MV (ie, the true MV) obtained through motion search for the current block to be encoded, that is, the encoded MVD = MV-MVP. By establishing the same list, the decoding end only needs the sequence number of MVD and MVP in the list to calculate the MV of the current decoding block. The AMVP candidate prediction MV list also includes two cases, spatial and temporal. The difference is that the length of the AMVP list is only 2.

[0082] As mentioned above, in the AMVP mode of HEVC, MVD needs to be encoded. In HEVC, the resolution of MVD is controlled by the use_integer_mv_flag in the slice_header (slice header or strip header or slice data header). When the value of this flag is 0, MVD is encoded with 1 / 4 (brightness) pixel resolution; when the value of this flag is 1, MVD is encoded with an integer (brightness) pixel resolution.

[0083] An adaptive motion vector resolution (AMVR) method is used in VVC. This method allows each CU to adaptively select the resolution of the encoded MVD. In the normal AMVP mode, the optional resolutions include 1 / 4, 1 / 2, 1 and 4 pixels. For a CU with at least one non-zero MVD component, a flag is first encoded to indicate whether the quarter brightness sampling MVD precision is used for the CU. If the flag is 0, the MVD of the current CU is encoded with a 1 / 4 pixel resolution. Otherwise, a second flag needs to be encoded to indicate that the CU uses a 1 / 2 pixel resolution or other MVD resolution. Otherwise, a third flag is encoded to indicate whether 1 pixel resolution or 4 pixel resolution is used for the CU. In Affine AMVP mode, optional resolutions include 1 / 16 pixel, 1 / 4 (brightness) pixel, and 1 pixel.

[0084] Screen images are images generated by electronic devices such as computers, mobile phones, and televisions, and mainly include two types of content: one is computer-generated non-continuous tone content, which contains a large number of small and sharp line shapes, such as text, icons, buttons, and grids; the other is camera-shot content containing a large number of continuous tones, such as movies, TV clips, natural image videos, etc. Block-based hybrid coding video coding standards in related technologies, such as AVS and HEVC, have a high compression ratio for natural images and videos containing a large amount of continuous content, but the compression effect is not good for screen images containing non-continuous tone content.

[0085] With the rapid development of cloud computing, mobile communication technology and wireless display technology, how to display screen images on various electronic terminal devices with high quality at low bit rates is a problem that SCC needs to solve. In order to improve the performance of screen image coding, the SCC version of the HEVC standard has been developed, and some tools that are conducive to screen image coding have been adopted, such as ISC (Intra String Copy, intra-frame string copy technology / string prediction technology / string matching technology).

[0086] ISC improves the screen image coding effect well. It converts the two-dimensional image into one-dimensional coding units CU one by one. ISC divides a coding block into a series of pixel strings or unmatched pixels according to a certain scanning order (raster scanning, round-trip scanning, Zig-Zag scanning, etc.). Each string searches for a reference string of the same shape in the encoded area of ​​the current image, derives the predicted value of the current string, and effectively saves bits by encoding the residual between the pixel value of the current string and the predicted value instead of directly encoding the pixel value.

[0087] Figure 5 A schematic diagram of intra-frame string replication is given. The dark area is the encoded area, the 28 white pixels are string 1, the 35 light pixels are string 2, and the black pixel represents an unmatched pixel. If a pixel does not find a corresponding reference in the reference area, it is called an unmatched pixel, also known as an isolated point. The pixel value of the unmatched pixel is directly encoded instead of being derived from the predicted value of the reference string.

[0088] ISC technology needs to encode the string vector (SV) corresponding to each string in the current coding block, the string length, and the flag of whether there is a matching reference string, etc. Among them, the string vector (SV) represents the displacement of the string to be encoded (the current string, that is, the current string to be encoded) to its reference string. The string length represents the number of pixels contained in the current string. In different implementations, there are many ways to encode the string length. Here are some examples (some examples may be used in combination): 1) Encode the string length of the string directly in the bitstream; 2) Encode the number of pixels to be processed after the current string is processed in the bitstream, and the decoder decodes the number of pixels to be processed P2 excluding the current string based on the size P of the current coding block and the number of pixels processed P1, and calculates the string length L of the current string, L = P-P1-P2, where L and P are both integers greater than 0, and P1 and P2 are both integers greater than or equal to 0; 3) Encode a flag in the bitstream to indicate whether the string is the last string. If it is the last string, calculate the string length L = P-P1 of the current string based on the size P of the current block and the number of pixels processed P1. If a pixel does not find a corresponding reference in the referenceable area, it is regarded as an unmatched pixel, and the pixel value of the unmatched pixel will be directly encoded.

[0089] The decoding process of ISC in the current solution is given below:

[0090]

[0091]

[0092] In the above decoding process, the field with "_" indicates the syntax element that needs to be decoded, and the field without "_" and with a capital letter indicates a variable, and the value of the variable can be obtained by decoding the syntax element. Some details irrelevant to the embodiments of the present disclosure are omitted in the above process.

[0093] The current ISC solution has some parts that are not conducive to hardware implementation, such as the following situation: allowing small blocks of size 4*4 to use string prediction. Since the string length in the small block is small, the performance brought by allowing small blocks is small.

[0094] The following solution is provided by the embodiment of the present disclosure to solve at least one of the above technical problems.

[0095] The method provided by the embodiment of the present disclosure can be applied to a video codec or video compression product using ISC, and can be applied to encoding and decoding of lossy data compression, and can also be applied to encoding and decoding of lossless data compression. The data involved in the encoding and decoding process refers to one of the following examples or a combination thereof:

[0096] 1) One-dimensional data;

[0097] 2) Two-dimensional data;

[0098] 3) Multidimensional data;

[0099] 4) Graphics;

[0100] 5) Image;

[0101] 6) Sequence of images;

[0102] 7) Video;

[0103] 8) Three-dimensional scene;

[0104] 9) Sequences of continuously changing three-dimensional scenes;

[0105] 10) Virtual reality scenes;

[0106] 11) A sequence of continuously changing virtual reality scenes;

[0107] 12) Images in pixel form;

[0108] 13) Transform domain data of the image;

[0109] 14) A collection of bytes of two or more dimensions;

[0110] 15) A set of bits of two or more dimensions;

[0111] 16) A collection of pixels;

[0112] 17) A set of three-component pixels (Y, U, V);

[0113] 18) A set of three-component pixels (Y, Cb, Cr);

[0114] 19) A set of three-component pixels (Y, Cg, Co);

[0115] 20) A set of three-component pixels (R, G, B);

[0116] 21) A set of four-component pixels (C, M, Y, K);

[0117] 22) A set of four-component pixels (R, G, B, A);

[0118] 23) A set of four-component pixels (Y, U, V, A);

[0119] 24) A set of four-component pixels (Y, Cb, Cr, A);

[0120] 25) A set of four-component pixels (Y, Cg, Co, A).

[0121] When the data is an image, a sequence of images, or a video listed above, a coding block is a coding area of ​​an image, and should include at least one of the following: a group of images, a predetermined number of images, an image, a frame of an image, a field of an image, a sub-image of an image, a slice, a macroblock, a maximum coding unit LCU, a coding tree unit CTU, and a coding unit CU.

[0122] Figure 6 The schematic diagram of the video encoding method according to an embodiment of the present disclosure is schematically shown. It should be noted that the methods involved in the embodiment of the present disclosure can be used alone or in combination. Figure 6 The embodiment is introduced by taking the encoding end as an example, wherein the encoding end corresponds to the decoding end, and the encoding end performs a series of analyses to determine the value of each syntax element, and the present disclosure does not limit the analysis process.

[0123] like Figure 6 As shown, the method provided by the embodiment of the present disclosure may include the following steps.

[0124] In step S610, a current image is obtained, where the current image includes a current coding block.

[0125] In an embodiment of the present disclosure, an encoder at the encoding end receives an original video signal, and encodes images in the original video signal in sequence. Here, the image to be encoded is referred to as the current image, which can be any frame of the original video signal. At the encoding end, the current image can be divided into blocks, for example, into a number of non-overlapping CTUs or LCUs. The CTU can continue to be divided more finely to obtain at least one CU. Here, the current CU to be encoded is referred to as the current coding block, but the present disclosure is not limited to this, for example, it can also be a PU or a TU. In the following examples, CU is taken as an example for illustration. The CTU corresponding to the current CU is referred to as the current CTU, and the CTU in the encoded area of ​​the current image and not belonging to the current CTU is referred to as the encoded CTU.

[0126] In the disclosed embodiment, the pixels in the current CU are encoded using ISC, and the pixels in the current CU are divided into strings or unmatched pixels according to a certain scanning order. A reference string of the same shape is searched for each string in the encoded area of ​​the current image, and the string of the reference string to be searched is called the current string.

[0127] In step S620, when the size of the current decoding block meets the second preset condition, the current decoding block is not decoded in intra-frame string copy mode, and the string prediction flag of the current decoding block is not decoded.

[0128] In an exemplary embodiment, the size of the current coding block may include the area of ​​the current coding block. The first preset condition may be that the area of ​​the current coding block is greater than a first area threshold, and the first area threshold is a positive integer greater than or equal to the minimum area of ​​the coding block and less than or equal to the maximum area of ​​the coding block.

[0129] In an exemplary embodiment, the size of the current coding block may include the width of the current coding block. The first preset condition may be that the width of the current coding block is greater than a first width threshold, and the first width threshold is a positive integer greater than or equal to the minimum width of the coding block and less than or equal to the maximum width of the coding block.

[0130] In an exemplary embodiment, the size of the current coding block may include the height of the current coding block. The first preset condition may be that the height of the current coding block is greater than a first height threshold, and the first height threshold is a positive integer greater than or equal to the minimum height of the coding block and less than or equal to the maximum height of the coding block.

[0131] In an exemplary embodiment, the size of the current coding block may include the area of ​​the current coding block. The first preset condition may be that the area of ​​the current coding block is less than a second area threshold, and the second area threshold is a positive integer greater than or equal to the minimum area of ​​the coding block and less than or equal to the maximum area of ​​the coding block.

[0132] In an exemplary embodiment, the size of the current coding block may include the width of the current coding block. The first preset condition may be that the width of the current coding block is less than a second width threshold, and the second width threshold is a positive integer greater than or equal to the minimum width of the coding block and less than or equal to the maximum width of the coding block.

[0133] In an exemplary embodiment, the size of the current coding block may include the height of the current coding block. The first preset condition may be that the height of the current coding block is less than a second height threshold, and the second height threshold is a positive integer greater than or equal to the minimum height of the coding block and less than or equal to the maximum height of the coding block.

[0134] Search the reference string of the current string in the encoded area of ​​the current image, obtain the SV between the current string and its reference string, use the SV and / or string length to represent the corresponding reference string, obtain the predicted value of the pixel in the current string through a predetermined operation, and by encoding the residual of the pixel value of the current string and its predicted value, the number of bits can be reduced and the coding efficiency can be improved. Perform similar processing on each frame of the original video signal, and finally generate a code stream, which can be transmitted to the decoder at the decoding end.

[0135] The following is a specific example to illustrate how to limit the block size for string prediction at the encoding end:

[0136] To limit the use of string prediction in blocks of certain sizes, let the width of the current CU be W, the height be H, and the area be S = W*H. The following optional methods are available:

[0137] 1) If the area S of the current CU is less than or equal to the preset first area threshold T11, the current CU does not use string prediction by default, and does not need to encode "sp_flag", i.e., the string prediction flag. The value of T11 is related to the block size allowed by the encoder, and the value range can be an integer in the block size allowed by the encoder (minimum size * minimum size, maximum size * maximum size). Among them, minimum size * minimum size is the minimum area of ​​the coding block, and maximum size * maximum size is the maximum area of ​​the coding block.

[0138] For example, in AVS3, T11 can be an integer in (4*4, 64*64). At the encoding end, T11 can be selected based on considerations of encoding performance and complexity.

[0139] 2) If the width W of the current CU is less than or equal to the preset first width threshold T21, the current CU does not use string prediction by default, and does not need to encode "sp_flag". The value of T21 is related to the block size allowed by the encoder, and the value range can be an integer in the block size (minimum size, maximum size) allowed by the encoder. Among them, the minimum size is the minimum width of the coding block, and the maximum size is the maximum width of the coding block.

[0140] For example, in AVS3, T21 can be an integer in (4, 64). At the encoding end, T21 can be selected based on considerations of encoding performance and complexity.

[0141] 3) If the height H of the current CU is less than or equal to the preset first height threshold T31, the current CU does not use string prediction by default, and does not need to encode "sp_flag". The value of T31 is related to the block size allowed by the encoder, and the value range can be an integer in the block size (minimum size, maximum size) allowed by the encoder. Among them, the minimum size is the minimum height of the coding block, and the maximum size is the maximum height of the coding block.

[0142] For example, in AVS3, T31 can be an integer in (4, 64). At the encoding end, T31 can be selected based on considerations of encoding performance and complexity.

[0143] 4) If the area S of the current CU is greater than or equal to the preset second area threshold T41, the current CU does not use string prediction by default, and does not need to encode "sp_flag". The value of T41 is related to the block size allowed by the encoder, and the value range can be an integer in the block size allowed by the encoder (minimum size * minimum size, maximum size * maximum size). Among them, minimum size * minimum size is the minimum area of ​​the coding block, and maximum size * maximum size is the maximum area of ​​the coding block.

[0144] For example, in AVS3, T41 can be an integer in (4*4, 64*64). At the encoding end, T41 can be selected based on considerations of encoding performance and complexity.

[0145] 5) If the width W of the current CU is greater than or equal to the preset second width threshold T51, the current CU does not use string prediction by default, and does not need to encode "sp_flag". The value of T51 is related to the block size allowed by the encoder, and the value range can be an integer in the block size (minimum size, maximum size) allowed by the encoder. Among them, the minimum size is the minimum width of the coding block, and the maximum size is the maximum width of the coding block.

[0146] For example, in AVS3, T51 can be an integer in (4, 64). At the encoding end, T51 can be selected based on considerations of encoding performance and complexity.

[0147] 6) If the height H of the current CU is greater than or equal to the preset second height threshold T61, the current CU does not use string prediction by default, and does not need to encode "sp_flag". The value of T61 is related to the block size allowed by the encoder, and the value range can be an integer in the block size (minimum size, maximum size) allowed by the encoder. Among them, the minimum size is the minimum height of the coding block, and the maximum size is the maximum height of the coding block.

[0148] For example, in AVS3, T61 can be an integer in (4, 64). At the encoding end, T61 can be selected based on considerations of encoding performance and complexity.

[0149] In the above steps 4)-6), the use of string prediction for large blocks is restricted because the performance improvement brought by using string prediction for large blocks is relatively small. On the one hand, this restriction can save the encoding of syntax elements, and on the other hand, it can skip the string prediction analysis of blocks of this size at the encoding end.

[0150] 7) The above methods can be used in combination.

[0151] Here are some specific examples:

[0152] 1) Blocks with width equal to 4 and height equal to 4 do not use string matching by default and do not need to encode "sp_flag". Or

[0153] 2) Blocks with width equal to 4 or height equal to 4 do not use string matching by default, and do not need to encode "sp_flag". Or

[0154] 3) Blocks with an area less than or equal to 32 do not use string matching by default and do not need to encode "sp_flag".

[0155] The solution proposed in the embodiment of the present disclosure makes a series of simplifications to the ISC solution, including the limitation of block size. These methods simplify the hardware implementation of ISC. The limitation of block size can, on the one hand, reduce the number of small strings, which is beneficial to reduce the number of memory accesses. On the other hand, the encoding end can skip the analysis of string predictions for blocks of certain sizes (for example, blocks of 4*4 size), reducing the complexity. In addition, the encoding of string prediction flags on certain blocks can be saved, which is beneficial to improving the encoding performance.

[0156] The current ISC solution also has other parts that are not conducive to hardware implementation, such as the following situation: the position of the reference string overlaps with the current CU to be encoded, causing the encoding of the string to be dependent.

[0157] In some embodiments, the pixels in the reference string do not overlap with the pixels in the current coding block, so that there is no dependency between strings, thereby reducing the complexity of coding and achieving parallel coding.

[0158] In some embodiments, the reference string can be allowed to overlap with the encoded pixels in the current CU, and the pixels in the reference string do not overlap with the unencoded pixels in the current encoding block. This situation is called inter-string dependency. According to the scanning order, the string at the back needs to wait for the encoding of the previous string to be completed before it can be encoded, but compared with the intra-string dependency, the complexity of the inter-string dependency is smaller; at the same time, since the correlation between the neighboring pixels and the current pixel to be encoded in the current CU is greater, using the neighboring pixels as a reference can achieve better prediction results. Therefore, the performance of the inter-string dependency is higher than that of the case without dependence. Among them, the intra-string dependency means that the position of the reference string overlaps with the current CU and overlaps with the position of the current string to be encoded. In this case, the string can only be encoded pixel by pixel according to the scanning order.

[0159] In some embodiments, pixels in the reference string are allowed to overlap with encoded pixels in the current coding block, but pixels in the reference string are not allowed to overlap with a row of the current coding block containing unencoded pixels (note that it is a row of the current coding block, not a row of the current image). As described above, in hardware implementation, if there is no reference between the strings, they can be encoded in parallel. For inter-string references, since there is a reference, it is not possible to be completely parallel, and it is necessary to wait for the encoding of the referenced string to be completed before the current string can start encoding. After adding this restriction, the reference string and the current string are not in the same row of the current coding block, so they can be encoded line by line without waiting.

[0160] The following uses a specific example to illustrate how to limit the position of the reference string at the encoding end.

[0161] In order to facilitate hardware implementation, on the encoding side, ISC only uses a memory of the size of 1 CTU. For example, assuming that the size of a CTU is 128*128 samples (in video coding standards, "sample" can be used to describe "pixels", which can include 128*128 luminance samples and corresponding chrominance samples), then ISC is limited to using only a 128*128 memory. In the 128*128 memory, a 64*64 space is used to store the 64*64 current CU to be encoded ( Figure 7 The 64*64 CU marked with Curr in the image corresponds to the uncoded pixels in the current CTU of 128*128, and there are 3 64*64 spaces that can be used to store the coded pixels in the 3 coded CUs of the coded area of ​​the current image. Therefore, ISC can only search for the reference string of the current string of the current CU in these 3 64*64 coded CUs, which should meet the following conditions:

[0162] 1) The pixels of the reference string pointed to by the string vector should not contain the pixels of the current CU.

[0163] For example, assume that the coordinates of the pixels in the reference string are (xRef_i, yRef_i), where both xRef_i and yRef_i are integers greater than or equal to 0, and i = 0, 1, 2, …, L-1, L is the string length, and L is a positive integer greater than 1. The upper left corner position of the current CU is (xCb, yCb), where both xCb and yCb are integers greater than or equal to 0. Then, the coordinates of the pixels in the reference string should satisfy the condition that (xRef_i < xCb || yRef_i < yCb) is true, where “||” is “logical or”. That is, in the referenced coordinate system, as Figure 7 shown, the reference string is located to the left or above the current CU.

[0164] It should be noted that the condition that the coordinates of the pixels in the above reference string should satisfy (xRef_i < xCb || yRef_i < yCb) being true is restricted under the encoding order from left to right and from top to bottom. If the encoder / standard encodes in other orders, this condition can be adjusted accordingly, and the present disclosure does not make any limitations in this regard. Similarly, in the following text, examples are all given under the encoding order from left to right and from top to bottom. Therefore, the upper left corner is the minimum coordinate or the pixel corresponding to the minimum coordinate. However, the solution provided by the embodiments of the present disclosure can also be applied to other encoding orders, and no limitations are made in this regard.

[0165] 2) The reference string pointed to by the string vector is restricted within the range of N CTUs (belonging to the encoded CTUs) to the left of the current CTU and the current CTU (assuming the target side is the left in the referenced coordinate system). The size of N is determined by the size of the maximum coding unit. For example, N can be determined according to the following formula:

[0166] N = (1 << ((7 - (log2_lcu_size_minus2 + 2)) << 1)) – (((log2_lcu_size_minus2 + 2) < 7)? 1 : 0) (3)

[0167] In the above formula (3), the width or height of the maximum coding unit is lcu_size, lcu_size is a positive integer greater than or equal to 1, then 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.

[0168] For example, if the LCU size is 128*128, then lcu_size=128, log2(128)=7, log2_lcu_size_minus2=5, N=(1<<(0<<1))-0=1. Figure 7 As shown, in order to reduce the memory and computational complexity of the encoding end and facilitate hardware implementation, ISC allows searching for the reference string of the current string in the current CU only in the current CTU and its left adjacent left CTU, and each small square represents a 64*64 area.

[0169] For another example, if the LCU size is equal to 64*64, then lcu_size=64, log2(64)=6, log2_lcu_size_minus2=4, N=(1<<(1<<1))–1=3, and the value of N is equivalent to dividing the 128*128 block into 4 parts, one part of which stores the pixels of the current LCU, and the other part is used to store the pixels of the N-1 LCUs to the left of the current LCU in the same row. The same applies to smaller LCUs.

[0170] Alternatively, N can be determined according to the following formula:

[0171] N=(1<<((7-log2_lcu_size)<<1))–(((log2_lcu_size)<7)?1:0) (4)

[0172] In the above formula (4), log2_lcu_size=log2(lcu_size). First, determine whether ((log2_lcu_size)<7) holds. If so, (((log2_lcu_size)<7)?1:0)=1; if not, (((log2_lcu_size)<7)?1:0)=0.

[0173] 3) When the pixel in the reference string pointed to by the string vector falls on the adjacent maximum coding unit (belonging to the encoded CTU) to the left of the current CTU, and the size of the maximum coding unit is 128*128, the following restrictions shall be met:

[0174] 3.1) The upper left corner of the 64*64 area (target area) where the pixel in the reference string is located after being shifted right (in a predetermined direction) by 128 pixels (predetermined pixels) has not been encoded yet.

[0175] 3.2) The upper left corner coordinates of the 64*64 area where the pixel in the reference string is shifted right by 128 pixels should not be the same as the upper left corner coordinates of the current CU.

[0176] For example, assuming that the brightness component position of the pixel in the reference string is (xRefTL, yRefTL), xRefTL and yRefTL are both integers greater than or equal to 0, and (((xRefTL+128) / 64)*64, (yRefTL / 64)*64) is not available, that is, the encoded pixel cannot be found in the memory used to store the encoded pixels of three 64*64 CUs, then (((xRefTL+128) / 64)*64, (yRefTL / 64)*64) should not be equal to the upper left corner position of the current CU (xCb, yCb). The division here is rounded down.

[0177] The processing power of the hardware design pipeline is taken into consideration here. The mainstream processing unit in the relevant technology is capable of processing an image area of ​​64*64. Therefore, some coding elements in the standard setting are also capped at a processing power of 64*64, such as the maximum value of the transform unit, etc.

[0178] like Figure 7 As shown, according to the position of the current CU in the current CTU, it can be divided into four cases:

[0179] like Figure 7 As shown in the figure in the upper left corner, if the current CU is the 64*64 block in the upper left corner of the current CTU, the 64*64 block in the lower right corner, the 64*64 block in the lower left corner, and the 64*64 block in the upper right corner of the left CTU can be used as references for the current CU.

[0180] like Figure 7 As shown in the figure in the upper right corner, if the current CU is the 64*64 block in the upper right corner of the current CTU, in addition to the encoded part of the current CTU, if the (0,64) position relative to the current CTU has not been encoded, the current CU can also refer to the 64*64 block in the lower right corner and the 64*64 block in the lower left corner of the left CTU.

[0181] like Figure 7 As shown in the figure in the lower left corner, if the current CU is the 64*64 block in the lower left corner of the current CTU, in addition to the encoded part of the current CTU, the current CU can also refer to the 64*64 block in the lower right corner of the left CTU.

[0182] like Figure 7 As shown in the figure in the lower right corner, if the current CU is the 64*64 block in the lower right corner of the current CTU, it can only refer to the encoded part of the current CTU.

[0183] 4) When the pixel in the reference string pointed to by the string vector falls on the largest coding unit (belonging to the encoded CTU) adjacent to the left of the current CTU, and the size of the largest coding unit is less than or equal to 64*64, the following restrictions shall be met:

[0184] 4.1) The upper left corner of the CTU area where the pixel in the reference string is located after being shifted right by N*lcu_size pixels has not been encoded yet.

[0185] 4.2) The upper left corner of the CTU area where the pixel in the reference string is shifted right by N*lcu_size pixels should not be the same as the upper left corner coordinates of the current CU.

[0186] For example, assuming that the brightness component position of a pixel in the reference string is (xRefTL, yRefTL), (((xRefTL+lcu_size*N) / lcu_size)*lcu_size, (yRefTL / lcu_size)*lcu_size) is not available, then (((xRefTL+lcu_size*N) / lcu_size)*lcu_size, (yRefTL / lcu_size)*lcu_size) should not be equal to the upper left corner position of the current block (xCb, yCb).

[0187] The above step 3) gives the restriction when the maximum coding unit is 128*128, and the above step 4) gives the restriction when the size of the maximum coding unit is less than or equal to 64*64, so that the 128*128 memory can be fully utilized during the encoding process.

[0188] It should be noted that the above examples are based on a memory size of 128*128. The size of the LCU can be designed through parameters during encoding. However, for hardware design, if a 128*128 memory has been designed, when the LCU is smaller than 128*128, the memory should be fully utilized.

[0189] 5) For a 128*128 CTU, all pixels in the reference string pointed to by the string vector can only come from the same 64*64 aligned area, that is, all sample positions in the reference string are required to be confined to the same 64*64 aligned reference pixel area. Figure 7 Taking the picture in the lower right corner as an example, the 128*128 CTU on the left is divided into four 64*64 CUs, and all pixels in the reference string cannot cross the boundary of the 64*64 CU.

[0190] For CTUs other than 128*128, all pixels in the reference string will come from the same CTU, that is, the reference string cannot cross the CTU boundary. This restriction reduces the number of memory accesses. When the encoder performs ISC prediction, only one 64*64 memory space needs to be accessed.

[0191] 6) The reference string position pointed by the string vector should not exceed the boundary of independent coding areas such as images, slices, and stripes. Among them, slices are a concept in AVS3. Slices are rectangular areas in images, including parts of several maximum coding units in the image, and slices should not overlap. Strips are a concept in HEVC.

[0192] 7) Any reference string sample in the reference string position pointed to by the string vector should not overlap with the uncoded area or the coding block area currently being coded (ie, the current CU).

[0193] 8) Optionally, the bounding rectangle of any reference string sample in the reference string position pointed to by the string vector should not overlap with the uncoded area or the coding block area currently being encoded. This is a simplified way to determine whether the position of the reference string meets the restriction by using the four corner points of the bounding rectangle of the reference string. If the bounding rectangle does not overlap with the uncoded area or the coding block area currently being encoded, it means that the reference string also meets the restriction of not overlapping with the uncoded area or the coding block area currently being encoded.

[0194] The solution proposed in the embodiment of the present disclosure makes a series of simplifications to the ISC solution, including the limitation of the reference string position. These methods simplify the hardware implementation of ISC. On the one hand, after the reference string position is limited, there is no dependency between strings, and the strings can be encoded in parallel. On the other hand, the reference string can also be limited to be used only in a memory area of ​​128*128 size.

[0195] The current ISC scheme also has other parts that are not conducive to hardware implementation, such as limiting the sum of the number of strings and the number of isolated points (unmatched pixels) to no more than one-fourth of the number of CU pixels at the encoding end. This will result in a large number of strings, which in turn will result in more syntax elements that need to be encoded.

[0196] The following is a specific example to illustrate how to limit the number of strings and the number of unmatched pixels at the encoding end:

[0197] Assume that the number of encoded strings in the current CU is N1, the number of unmatched pixels is N2, and both N1 and N2 are integers greater than or equal to 0. The following methods can be used alone or in any combination:

[0198] A) Limit N1+N2 to be less than or equal to the first quantity threshold T1. The value range of T1 can be an integer in [1, W*H], W is the width of the current CU, H is the height of the current CU, and both W and H are positive integers greater than or equal to 1. In this embodiment, in order to avoid the coding block being divided too finely, resulting in increased complexity, the value range of T1 is limited to be less than or equal to one quarter of W*H. Moreover, according to experimental results, T1 is preferably 4. The encoding end has the following optional methods:

[0199] i. When N1+N2 is equal to T1-1, if the number of remaining pixels NR (NR is an integer greater than or equal to 0) in the current CU is equal to 1, there is no need to encode "sp_is_matched_flag", that is, there is no need to encode the matching flag to determine the type of the next remaining pixel, and the remaining pixel can be directly confirmed as an unmatched pixel.

[0200] ii. When N1+N2 is equal to T1-1, if the number of remaining pixels NR in the current CU is greater than 1, there is no need to encode "sp_is_matched_flag", that is, there is no need to encode the matching flag to determine the type of the next remaining pixel. The remaining pixels can be directly confirmed as a string with a string length of NR.

[0201] iii. Another method of the above step ii., when N1+N2 is equal to T1-1, if the number of remaining pixels NR in the current CU is greater than 1, then "sp_is_matched_flag" is encoded; if the remaining pixels are a string, then "sp_is_matched_flag" is encoded as a first value, such as 1 (but the present disclosure is not limited to this and can be limited according to actual conditions), and the string length is NR.

[0202] B) Limit N1 to be less than or equal to the second quantity threshold T2. The value range of T2 can be an integer in [1, W*H]. The following optional methods are available:

[0203] i. If N1 is equal to T2-1, and it is confirmed that the next remaining pixel is the starting point of the string, the "sp_is_matched_flag" is encoded as the second value (here it is assumed to be 1 but the present disclosure is not limited to this and can be limited according to actual conditions), indicating that the remaining pixels in the current CU are a string.

[0204] ii. If N1 is equal to T2-1, the remaining pixels are directly confirmed to be a string.

[0205] iii. If N1 is equal to T2, then directly confirm that the remaining pixels are all unmatched pixels.

[0206] C) Limit N2 to be less than or equal to a third quantity threshold T3. The value range of T3 can be an integer in [1, W*H]. The following optional methods are available:

[0207] i. If N2 is equal to T3, there is no need to encode "sp_is_matched_flag" and the string length, and the remaining pixels of the current CU are directly used as a string.

[0208] ii. If N2 is equal to T3, there is no need to encode "sp_is_matched_flag", and directly confirm that the types of the remaining pixels of the current CU are all strings, and encode the string length of each string.

[0209] D) Limiting N1+N2 to be greater than or equal to a fourth quantity threshold value T4. The value range of T4 may be an integer in [1, W*H]. In this embodiment, T4 is preferably a positive integer greater than 2. Here, limiting N1+N2 to be greater than or equal to T4 takes into account that the number of strings in the string prediction is usually not only 1, and this limitation can save the encoding of syntax elements. The encoding end has the following optional methods:

[0210] i. If N1+N2 is less than T4, and by encoding "sp_is_matched_flag" as a third value, such as 1 (but the present disclosure is not limited to this and can be limited according to actual conditions) to confirm that the next remaining pixel is the starting point of the string, it can be directly determined that the string is not the last string, so there is no need to encode "sp_last_len_flag" to confirm whether it is the last string, thereby improving coding efficiency.

[0211] E) Limiting N1 to be greater than or equal to a fourth quantity threshold T4. Here, limiting N1 to be greater than or equal to T4 takes into account that the number of strings in a common string prediction is not limited to 1, and this limitation can save coding of syntax elements. There are the following optional methods:

[0212] i. If N1 is less than T4, it can be directly determined that the string is not the last string without encoding "sp_last_len_flag" to confirm whether it is the last string.

[0213] In the disclosed embodiment, any one or all of the threshold values ​​of the first to fourth quantity thresholds can be adjusted according to the size of the current coding block. For example, when the size of the current coding block is width*height=4*4, the first quantity threshold and / or the second quantity threshold is adjusted to be equal to 1, and when the sum of the number of encoded strings and the number of encoded unmatched pixels is equal to 1-1=0, if the number of remaining pixels in the current coding block is greater than 1, it is confirmed that the remaining pixels in the current coding block are one string, that is, when the size of the current coding block is 4*4, the entire current coding block is limited to only one string.

[0214] The solution proposed in the embodiment of the present disclosure makes a series of simplifications to the ISC solution, including the limitation of the reference string position, the limitation of the number of strings, and the limitation of the block size. These methods simplify the hardware implementation of the ISC:

[0215] 1) After the reference string position is limited, there is no dependency between strings, and the strings can be encoded in parallel. In addition, similar to IBC, the reference string can be limited to a 128*128 size memory area.

[0216] 2) Limiting the number of strings can reduce the number of strings and the number of memory accesses. On the other hand, it can save the encoding of some syntax elements and improve the encoding performance.

[0217] 3) Limiting the block size can, on the one hand, reduce the number of small strings, which is beneficial to reducing the number of memory accesses. On the other hand, the encoder can skip the analysis of string prediction for blocks of certain sizes (such as 4*4 blocks), reducing complexity. In addition, it can also save the encoding of string prediction flags on certain blocks, which is beneficial to improving encoding performance.

[0218] Figure 8 The following is a schematic diagram of a video decoding method according to an embodiment of the present disclosure. It should be noted that the methods involved in the embodiments of the present disclosure can be used alone or in combination. Figure 8 The embodiment is introduced by taking the decoding end as an example.

[0219] like Figure 8 As shown, the method provided by the embodiment of the present disclosure may include the following steps.

[0220] In step S810, a code stream of a current image is obtained, where the code stream includes a current decoding block.

[0221] In the following embodiments, the current decoding block is taken as the current CU as an example for illustration, but the present disclosure is not limited thereto.

[0222] In step S820, when the size of the current decoding block meets the second preset condition, the current decoding block is not decoded in intra-frame string copy mode, and the string prediction flag of the current decoding block is not decoded.

[0223] In step S830, when the size of the current decoding block does not meet the second preset condition, the current decoding block is decoded in an intra-frame string copy mode to decode the string prediction flag of the current decoding block.

[0224] In an exemplary embodiment, the size of the current decoding block may include the area of ​​the current decoding block. The second preset condition may be that the area of ​​the current decoding block is less than or equal to a first area threshold, and the first area threshold is a positive integer greater than or equal to a minimum area of ​​the decoding block and less than or equal to a maximum area of ​​the decoding block.

[0225] In an exemplary embodiment, the size of the current decoding block may include the width of the current decoding block. The second preset condition may be that the width of the current decoding block is less than or equal to a first width threshold, and the first width threshold is a positive integer greater than or equal to a minimum width of the decoding block and less than or equal to a maximum width of the decoding block.

[0226] In an exemplary embodiment, the size of the current decoding block may include the height of the current decoding block. The second preset condition may be that the height of the current decoding block is less than or equal to a first height threshold, and the first height threshold is a positive integer greater than or equal to a minimum height of the decoding block and less than or equal to a maximum height of the decoding block.

[0227] In an exemplary embodiment, the size of the current decoding block may include the area of ​​the current decoding block. The second preset condition may be that the area of ​​the current decoding block is greater than a second area threshold, and the second area threshold is a positive integer greater than or equal to a minimum area of ​​the decoding block and less than or equal to a maximum area of ​​the decoding block.

[0228] In an exemplary embodiment, the size of the current decoding block may include the width of the current decoding block. The second preset condition may be that the width of the current decoding block is greater than a second width threshold, and the second width threshold is a positive integer greater than or equal to a minimum width of the decoding block and less than or equal to a maximum width of the decoding block.

[0229] In an exemplary embodiment, the size of the current decoding block may include the height of the current decoding block. The second preset condition may be that the height of the current decoding block is greater than a second height threshold, and the second height threshold is a positive integer greater than or equal to a minimum height of the decoding block and less than or equal to a maximum height of the decoding block.

[0230] The following is a specific example to illustrate how to limit the block size for string prediction at the decoding end:

[0231] To limit the use of string prediction in blocks of certain sizes, let the width of the current CU be W, the height be H, and the area be S = W*H. The following optional methods are available:

[0232] 1) If the area S of the current CU is less than or equal to the preset first area threshold T11, the current CU does not use string prediction by default, and does not need to decode "sp_flag", i.e., the string prediction flag. The value of T11 is related to the block size allowed by the encoder, and the value range can be an integer in the block size allowed by the encoder (minimum size * minimum size, maximum size * maximum size). Among them, minimum size * minimum size is the minimum area of ​​the decoding block, and maximum size * maximum size is the maximum area of ​​the decoding block.

[0233] For example, in AVS3, T11 can be an integer in (4*4, 64*64). T11 can be selected based on considerations of coding performance and complexity.

[0234] 2) If the width W of the current CU is less than or equal to the preset first width threshold T21, the current CU does not use string prediction by default, and does not need to decode "sp_flag". The value of T21 is related to the block size allowed by the encoder, and the value range can be an integer in the block size (minimum size, maximum size) allowed by the encoder. Among them, the minimum size is the minimum width of the decoding block, and the maximum size is the maximum width of the decoding block.

[0235] 3) If the height H of the current CU is less than or equal to the preset first height threshold T31, the current CU does not use string prediction by default, and does not need to decode "sp_flag". The value of T31 is related to the block size allowed by the encoder, and the value range can be an integer in the block size (minimum size, maximum size) allowed by the encoder. Among them, the minimum size is the minimum height of the decoding block, and the maximum size is the maximum height of the decoding block.

[0236] 4) If the area S of the current CU is greater than or equal to the preset second area threshold T41, the current CU does not use string prediction by default, and does not need to decode "sp_flag". The value of T41 is related to the block size allowed by the encoder, and the value range can be an integer in the block size allowed by the encoder (minimum size * minimum size, maximum size * maximum size). Among them, minimum size * minimum size is the minimum area of ​​the decoding block, and maximum size * maximum size is the maximum area of ​​the decoding block.

[0237] 5) If the width W of the current CU is greater than or equal to the preset second width threshold T51, the current CU does not use string prediction by default, and does not need to decode "sp_flag". The minimum size is the minimum width of the decoding block, and the maximum size is the maximum width of the decoding block.

[0238] 6) If the height H of the current CU is greater than or equal to the preset second height threshold T61, it is assumed that the current CU does not use string prediction and does not need to decode "sp_flag". The value of T61 is related to the block size allowed by the encoder, and the value range can be an integer in the block size (minimum size, maximum size) allowed by the encoder. Among them, the minimum size is the minimum height of the decoding block, and the maximum size is the maximum height of the decoding block.

[0239] In the above steps 4)-6), the use of string prediction for large blocks is restricted because the performance improvement brought by using string prediction for large blocks is small. On the one hand, this restriction can save the decoding of syntax elements, and on the other hand, it can skip the string prediction analysis of blocks of this size at the decoding end.

[0240] 7) The above methods can be used in combination.

[0241] Here are some specific examples:

[0242] 1) Blocks with width equal to 4 and height equal to 4 do not use string matching by default and do not need to decode "sp_flag". Or

[0243] 2) Blocks with a width of 4 or a height of 4 do not use string matching by default and do not need to decode "sp_flag". Or

[0244] 3) Blocks with an area less than or equal to 32 do not use string matching by default and do not need to decode the "sp_flag".

[0245] The current ISC solution also has other parts that are not conducive to hardware implementation, such as the following situation: the location of the reference string overlaps with the current CU to be reconstructed, causing the reconstruction of the string to be dependent. For example, suppose a CU is divided into two strings, called string 1 and string 2, and string 2 refers to string 1. In this case, string 2 needs to wait until string 1 is reconstructed before it can start reconstruction.

[0246] In some embodiments, the pixels in the reference string do not overlap with the pixels in the current decoding block, so that there is no dependency between strings, thereby reducing the complexity of decoding and achieving parallel decoding.

[0247] In some embodiments, the reference string is allowed to overlap with the reconstructed pixels in the current CU, and the pixels in the reference string do not overlap with the unreconstructed pixels in the current decoding block. This situation is called inter-string dependency. According to the scanning order, the string at the back needs to wait for the decoding of the previous string to be completed before it can be decoded, but compared with the intra-string dependency, the complexity of the inter-string dependency is smaller; at the same time, since the correlation between the neighboring pixels and the current pixel to be decoded in the current CU is greater, using the neighboring pixels as a reference can achieve better prediction results. Therefore, the performance of the inter-string dependency is higher than that of the case without dependency. Among them, the intra-string dependency means that the position of the reference string overlaps with the current CU and overlaps with the position of the current string to be decoded. In this case, the string can only be reconstructed pixel by pixel according to the scanning order.

[0248] In some embodiments, pixels in the reference string are allowed to overlap with reconstructed pixels in the current decoding block, but pixels in the reference string are not allowed to overlap with a row of the current decoding block that contains unreconstructed pixels (note that it is a row of the current decoding block, not a row of the current image). As described above, in hardware implementation, if there is no reference between the strings, they can be reconstructed in parallel. For inter-string references, since there is a reference, it is not possible to be completely parallel, and it is necessary to wait for the reconstruction of the referenced string to be completed before the current string can begin to be reconstructed. After adding this restriction, the reference string and the current string are not in the same row of the current decoding block, so they can be reconstructed row by row without waiting.

[0249] The following uses a specific example to illustrate how to perform string prediction decoding according to the position of the restricted reference string at the decoding end.

[0250] In order to facilitate hardware implementation, at the decoding end, ISC only uses a memory of the size of 1 CTU. For example, assuming that the size of 1 CTU is 128*128, ISC is limited to using only a memory of 128*128. In this 128*128 memory, a 64*64 space is used to store the unreconstructed pixels in the current CU of 64*64 to be reconstructed, and three 64*64 spaces can be used to store the reconstructed pixels in the three decoded CUs of the decoded area of ​​the current image. Therefore, ISC can only search for the reference string of the current string of the current CU in these three 64*64 decoded CUs, and the following conditions should be met:

[0251] 1) The pixels of the reference string pointed to by the string vector should not contain the pixels of the current CU.

[0252] For example, assume that the coordinates of the pixels in the reference string are (xRef_i, yRef_i), where both xRef_i and yRef_i are integers greater than or equal to 0, and i = 0, 1, 2, …, L-1, L being the string length and a positive integer greater than 1. If the top-left position of the current CU is (xCb, yCb), where both xCb and yCb are integers greater than or equal to 0, then the coordinates of the pixels in the reference string should satisfy the condition that (xRef_i < xCb || yRef_i < yCb) is true, where "||" is "logical or", that is, in the referenced coordinate system, the reference string is to the left or above the current CU.

[0253] It should be noted that the condition that the coordinates of the pixels in the above reference string should satisfy (xRef_i < xCb || yRef_i < yCb) being true is restricted under the decoding order from left to right and top to bottom. If the decoder / standard decodes in other orders, this condition can be adjusted accordingly, and the present disclosure does not make any limitations in this regard. Similarly, in the following text, examples are given under the decoding order from left to right and top to bottom. Therefore, the top-left corner is the pixel corresponding to the minimum coordinate or the minimum coordinate, but the solution provided by the embodiments of the present disclosure can also be applied to other decoding orders, and no limitations are made in this regard.

[0254] 2) The reference string pointed to by the string vector is restricted within the range of N CTUs (belonging to the encoded CTUs) to the left of the current CTU and the current CTU (assuming the target side is the left in the referenced coordinate system). The size of N is determined by the size of the maximum coding unit. For example, N can be determined according to the above formula (3) or (4).

[0255] 3) When the pixels in the reference string pointed to by the string vector fall within the adjacent maximum coding unit (belonging to the encoded CTU) to the left of the current CTU and the size of the maximum coding unit is 128*128, the following restrictive conditions should be met:

[0256] 3.1) The top-left corner of the 64*64 area where the position of the pixel in the reference string after being shifted 128 pixels to the right is located has not been reconstructed.

[0257] 3.2) The top-left corner coordinates of the 64*64 area where the position of the pixel in the reference string after being shifted 128 pixels to the right is located should not be the same as the top-left corner coordinates of the current CU.

[0258] For example, assuming that the brightness component position of the pixel in the reference string is (xRefTL, yRefTL), and (((xRefTL+128) / 64)*64, (yRefTL / 64)*64) is not available, that is, the reconstructed pixel cannot be found in the memory used to store the reconstructed pixels of three 64*64 reconstructed CUs, then (((xRefTL+128) / 64)*64, (yRefTL / 64)*64) should not be equal to the upper left corner position of the current CU (xCb, yCb). The division here is rounded down.

[0259] 4) When the pixel in the reference string pointed to by the string vector falls on the largest coding unit (belonging to the encoded CTU) adjacent to the left of the current CTU, and the size of the largest coding unit is less than or equal to 64*64, the following restrictions shall be met:

[0260] 4.1) The upper left corner of the CTU area where the pixel in the reference string is shifted right by N*lcu_size pixels has not been reconstructed.

[0261] 4.2) The upper left corner of the CTU area where the pixel in the reference string is shifted right by N*lcu_size pixels should not be the same as the upper left corner coordinates of the current CU.

[0262] That is: assuming that the brightness component position of the pixel in the reference string is (xRefTL, yRefTL), (((xRefTL+lcu_size*N) / lcu_size)*lcu_size, (yRefTL / lcu_size)*lcu_size) is not available; (((xRefTL+lcu_size*N) / lcu_size)*lcu_size, (yRefTL / lcu_size)*lcu_size) should not be equal to the upper left corner position of the current block (xCb, yCb).

[0263] The above step 3) gives the restriction when the maximum coding unit is 128*128, and the above step 4) gives the restriction when the size of the maximum coding unit is less than or equal to 64*64, so that the 128*128 memory can be fully utilized during the decoding process.

[0264] 5) For a 128*128 CTU, all pixels in the reference string pointed to by the string vector can only come from the same 64*64 aligned area, that is, all sample positions in the reference string are required to be confined to the same 64*64 aligned reference pixel area. Figure 7 Taking the picture in the lower right corner as an example, the 128*128 CTU on the left is divided into four 64*64 CUs, and all pixels in the reference string cannot cross the boundary of the 64*64 CU.

[0265] For CTUs other than 128*128, all pixels in the reference string will come from the same CTU, that is, the reference string cannot cross the CTU boundary. This restriction reduces the number of memory accesses. When the decoder performs ISC prediction, only one 64*64 memory space needs to be accessed.

[0266] 6) The reference string position pointed to by the string vector should not exceed the boundary of independent decoding areas such as pictures, slices, and strips.

[0267] 7) Any reference string sample in the reference string position pointed to by the string vector should not overlap with the unreconstructed area or the coding block area currently being reconstructed.

[0268] 8) Optionally, the bounding rectangle of any reference string sample in the reference string position pointed to by the string vector should not overlap with the unreconstructed area or the coding block area currently being reconstructed. This is a simplified way to determine whether the position of the reference string meets the restriction by using the four corner points of the bounding rectangle of the reference string. If the bounding rectangle does not overlap with the unreconstructed area or the coding block area currently being reconstructed, it means that the reference string also meets the restriction of not overlapping with the unreconstructed area or the coding block area currently being reconstructed.

[0269] The following is a specific example to illustrate how to limit the number of strings and the number of unmatched pixels at the decoding end:

[0270] Maximum string quantity limit: Assume that the number of decoded strings in the current block is N1, the number of unmatched pixels is N2, and both N1 and N2 are integers greater than or equal to 0. The following methods can be used alone or in any combination:

[0271] A) Limit N1+N2 to be less than or equal to the first quantity threshold T1. The value range of T1 can be an integer in [1, W*H], W is the width of the current CU, H is the height of the current CU, and both W and H are positive integers greater than or equal to 1. In this embodiment, in order to avoid the coding block being divided too finely, resulting in increased complexity, the value range of T1 is limited to be less than or equal to one quarter of W*H. Moreover, according to experimental results, T1 is preferably 4. The decoding end has the following optional methods:

[0272] i. When N1+N2 is equal to T1-1, if the number of remaining pixels NR (NR is an integer greater than or equal to 0) in the current CU is equal to 1, there is no need to decode "sp_is_matched_flag", that is, there is no need to decode the matching flag to determine the type of the next remaining pixel, and the remaining pixel can be directly confirmed as an unmatched pixel.

[0273] ii. When N1+N2 is equal to T1-1, if the number of remaining pixels NR in the current CU is greater than 1, there is no need to decode "sp_is_matched_flag", that is, there is no need to decode the matching flag to determine the type of the next remaining pixel. The remaining pixels can be directly confirmed as a string with a string length of NR.

[0274] iii. Another way of the above step ii., when N1+N2 is equal to T1-1, if the number of remaining pixels NR in the current CU is greater than 1, decode "sp_is_matched_flag", if the decoded "sp_is_matched_flag" is a first value, such as 1 (but the present disclosure is not limited to this, and can be limited according to actual conditions), directly confirm that the remaining pixels of the current CU are a string, and the string length is NR.

[0275] B) Limit N1 to be less than or equal to the second quantity threshold T2. The value range of T2 can be an integer in [1, W*H]. The following optional methods are available:

[0276] i. If N1 is equal to T2-1, and the decoded "sp_is_matched_flag" is the second value, such as 1 (but the present disclosure is not limited to this and can be limited according to actual conditions), then the next remaining pixel is confirmed as the starting point of the string, and the remaining pixels of the current CU are directly confirmed as a string.

[0277] ii. If N1 is equal to T2-1, there is no need to decode "sp_is_matched_flag", and directly confirm that the remaining pixels in the current CU are a string.

[0278] iii. If N1 is equal to T2, there is no need to decode "sp_is_matched_flag", and directly confirm that the remaining pixels in the current CU are all unmatched pixels.

[0279] C) Limit N2 to be less than or equal to a third quantity threshold T3. The value range of T3 can be an integer in [1, W*H]. The following optional methods are available:

[0280] i. If N2 is equal to T3, there is no need to decode "sp_is_matched_flag" and the string length, and the remaining pixels of the current CU are directly taken as a string.

[0281] ii. If N2 is equal to T3, there is no need to decode "sp_is_matched_flag", and directly confirm that the type of the remaining pixels of the current CU is all strings, and decode the string length of each string.

[0282] D) Limiting N1+N2 to be greater than or equal to a fourth quantity threshold value T4. The value range of T4 may be an integer in [1, W*H]. In this embodiment, T4 is preferably a positive integer greater than 2. Here, limiting N1+N2 to be greater than or equal to T4 takes into account that the number of strings in the string prediction is usually not only 1, and this limitation can save the decoding of syntax elements. The decoding end has the following optional methods:

[0283] i. If N1+N2 is less than T4, and the next remaining pixel is confirmed as the starting point of the string by decoding "sp_is_matched_flag", for example, if "sp_is_matched_flag" is decoded to a third value such as 1 (but the present disclosure is not limited to this and can be limited according to actual conditions), then it can be directly determined that the string is not the last string, so there is no need to decode "sp_last_len_flag" to confirm whether it is the last string, thereby improving decoding efficiency.

[0284] E) Limiting N1 to be greater than or equal to a fourth quantity threshold T4. Here, limiting N1 to be greater than or equal to T4 takes into account that the number of strings in a common string prediction is not limited to 1, and this limitation can save decoding of syntax elements. There are the following optional methods:

[0285] i. If N1 is less than T4, it can be directly determined that the string is not the last string without decoding "sp_last_len_flag" to confirm whether it is the last string.

[0286] In the disclosed embodiment, any one or all of the threshold values ​​of the first to fourth quantity thresholds can be adjusted according to the size of the current decoded block. For example, when the size of the current decoded block is width*height=4*4, the first quantity threshold and / or the second quantity threshold is adjusted to be equal to 1, and when the sum of the number of decoded strings and the number of decoded unmatched pixels is equal to 1-1=0, if the number of remaining pixels in the current decoded block is greater than 1, it is confirmed that the remaining pixels in the current decoded block are one string, that is, when the size of the current decoded block is 4*4, the entire current decoded block is limited to only one string. At this time, there is no need to decode sp_dir_flag, sp_is_matched_flag, sp_special_len_flag, SpLength, next_remaining_pixel_minus1 and SpLength, and only the string vector (i.e., decode_sv() in the above decoding flowchart) needs to be decoded, thereby simplifying the decoding process.

[0287] The solution proposed in the embodiment of the present disclosure makes a series of simplifications to the ISC solution, including the limitation of the reference string position, the limitation of the number of strings, and the limitation of the block size. These methods simplify the hardware implementation of the ISC:

[0288] 1) After the reference string position is limited, there is no dependency between strings, and the strings can be rebuilt in parallel. In addition, similar to IBC, the reference string can be limited to a 128*128 size memory area.

[0289] 2) Limiting the number of strings can reduce the number of strings and the number of memory accesses. On the other hand, it can save the decoding of some syntax elements and improve the decoding performance.

[0290] 3) Limiting the block size can, on the one hand, reduce the number of small strings, which is beneficial to reducing the number of memory accesses. On the other hand, the encoder can skip the analysis of string prediction for blocks of certain sizes (such as 4*4 blocks), reducing complexity. In addition, it can also save the decoding of string prediction flags on certain blocks, which is beneficial to improving decoding performance.

[0291] Furthermore, the embodiments of the present disclosure also provide a video encoding device, which can be applied to an encoding end / encoder, and the device may include: a current image acquisition unit, which can be used to acquire a current image, and the current image includes a current coding block; a first block size limitation unit, which can be used to encode the current coding block using an intra-frame string copy mode when the size of the current coding block meets a first preset condition, and encode a string prediction flag of the current coding block.

[0292] In an exemplary embodiment, the size of the current coding block may include the area of ​​the current coding block. The first preset condition may be that the area of ​​the current coding block is greater than a first area threshold, and the first area threshold is a positive integer greater than or equal to the minimum area of ​​the coding block and less than or equal to the maximum area of ​​the coding block.

[0293] In an exemplary embodiment, the size of the current coding block may include the width of the current coding block. The first preset condition may be that the width of the current coding block is greater than a first width threshold, and the first width threshold is a positive integer greater than or equal to the minimum width of the coding block and less than or equal to the maximum width of the coding block.

[0294] In an exemplary embodiment, the size of the current coding block may include the height of the current coding block. The first preset condition may be that the height of the current coding block is greater than a first height threshold, and the first height threshold is a positive integer greater than or equal to the minimum height of the coding block and less than or equal to the maximum height of the coding block.

[0295] In an exemplary embodiment, the size of the current coding block may include the area of ​​the current coding block. The first preset condition may be that the area of ​​the current coding block is less than a second area threshold, and the second area threshold is a positive integer greater than or equal to the minimum area of ​​the coding block and less than or equal to the maximum area of ​​the coding block.

[0296] In an exemplary embodiment, the size of the current coding block may include the width of the current coding block. The first preset condition may be that the width of the current coding block is less than a second width threshold, and the second width threshold is a positive integer greater than or equal to the minimum width of the coding block and less than or equal to the maximum width of the coding block.

[0297] In an exemplary embodiment, the size of the current coding block may include the height of the current coding block. The first preset condition may be that the height of the current coding block is less than a second height threshold, and the second height threshold is a positive integer greater than or equal to the minimum height of the coding block and less than or equal to the maximum height of the coding block.

[0298] The specific implementation of each unit in the video encoding device provided by the embodiment of the present disclosure can refer to the content of the above-mentioned video encoding method, which will not be repeated here.

[0299] Furthermore, an embodiment of the present disclosure also provides a video decoding device, which can be applied to a decoding end / decoder, and the device may include: a code stream acquisition unit, which can be used to acquire a code stream of a current image, wherein the code stream includes a current decoding block; a second block size limitation unit, which can be used to not use an intra-frame string copy mode to decode the current decoding block and not decode a string prediction flag of the current decoding block when the size of the current decoding block meets a second preset condition; when the size of the current decoding block does not meet the second preset condition, use an intra-frame string copy mode to decode the current decoding block and decode the string prediction flag of the current decoding block.

[0300] In an exemplary embodiment, the size of the current decoding block may include the area of ​​the current decoding block. The second preset condition may be that the area of ​​the current decoding block is less than or equal to a first area threshold, and the first area threshold is a positive integer greater than or equal to a minimum area of ​​the decoding block and less than or equal to a maximum area of ​​the decoding block.

[0301] In an exemplary embodiment, the size of the current decoding block may include the width of the current decoding block. The second preset condition may be that the width of the current decoding block is less than or equal to a first width threshold, and the first width threshold is a positive integer greater than or equal to a minimum width of the decoding block and less than or equal to a maximum width of the decoding block.

[0302] In an exemplary embodiment, the size of the current decoding block may include the height of the current decoding block. The second preset condition may be that the height of the current decoding block is less than or equal to a first height threshold, and the first height threshold is a positive integer greater than or equal to a minimum height of the decoding block and less than or equal to a maximum height of the decoding block.

[0303] In an exemplary embodiment, the size of the current decoding block may include the area of ​​the current decoding block. The second preset condition may be that the area of ​​the current decoding block is greater than a second area threshold, and the second area threshold is a positive integer greater than or equal to a minimum area of ​​the decoding block and less than or equal to a maximum area of ​​the decoding block.

[0304] In an exemplary embodiment, the size of the current decoding block may include the width of the current decoding block. The second preset condition may be that the width of the current decoding block is greater than a second width threshold, and the second width threshold is a positive integer greater than or equal to a minimum width of the decoding block and less than or equal to a maximum width of the decoding block.

[0305] In an exemplary embodiment, the size of the current decoding block may include the height of the current decoding block. The second preset condition may be that the height of the current decoding block is greater than a second height threshold, and the second height threshold is a positive integer greater than or equal to a minimum height of the decoding block and less than or equal to a maximum height of the decoding block.

[0306] The specific implementation of each unit in the video decoding device provided by the embodiment of the present disclosure can refer to the contents of the above-mentioned video encoding method and video decoding method, which will not be repeated here.

[0307] It should be noted that although several units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.

[0308] The embodiments of the present disclosure provide a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the video encoding method described in the above embodiments is implemented.

[0309] The embodiments of the present disclosure provide a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the video decoding method described in the above embodiments is implemented.

[0310] An embodiment of the present disclosure provides an electronic device, comprising: at least one processor; and a storage device configured to store at least one program, so that when the at least one program is executed by the at least one processor, the at least one processor implements the video encoding method as described in the above embodiment.

[0311] An embodiment of the present disclosure provides an electronic device, comprising: at least one processor; and a storage device configured to store at least one program, so that when the at least one program is executed by the at least one processor, the at least one processor implements the video decoding method as described in the above embodiment.

[0312] Fig. 9 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown.

[0313] It should be noted that Fig. 9 The electronic device 900 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0314] like Fig. 9 As shown, the electronic device 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 902 or the program loaded from the storage part 908 to the random access memory (RAM) 903. In the RAM 903, various programs and data required for system operation are also stored. The CPU 901, the ROM 902 and the RAM 903 are connected to each other through a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0315] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed so that a computer program read therefrom is installed into the storage section 908 as needed.

[0316] In particular, according to an embodiment of the present disclosure, the process described below with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 909, and / or installed from a removable medium 911. When the computer program is executed by a central processing unit (CPU) 901, various functions defined in the method and / or device of the present application are executed.

[0317] It should be noted that the computer-readable storage medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with at least one wire, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM (Erasable Programmable Read Only Memory, Erasable Programmable Read Only Memory) or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable storage medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF (Radio Frequency), etc., or any suitable combination of the above.

[0318] The flowchart and block diagram in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the method, device and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains at least one executable instruction for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0319] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, and the units described may also be arranged in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0320] As another aspect, the present application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the following embodiment. For example, the electronic device may implement the following Figure 6 or Figure 8 The steps shown.

[0321] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0322] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0323] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A video encoding method, characterized in that: include: Acquire a current image, wherein the current image includes a current coding block; When the size of the current coding block meets the first preset condition, the current coding block is allowed to be encoded in an intra-frame string copy mode, and a string prediction flag of the current coding block is encoded; When the size of the current coding block does not meet the first preset condition, the current coding block is not encoded by using the intra-frame string replication, and the string prediction flag of the current coding block is not encoded; The size of the current coding block includes the width and height of the current coding block, and the first preset condition is that the width of the current coding block is less than or equal to a second width threshold and the height of the current coding block is less than or equal to a second height threshold.

2. A video decoding method, characterized in that: include: Acquire a code stream of a current image, wherein the code stream includes a current decoding block; When the size of the current decoding block meets the first preset condition, it is allowed to decode the current decoding block in an intra-frame string copy mode, and decode the string prediction flag of the current decoding block; When the size of the current decoding block does not meet the first preset condition, the current decoding block is not decoded in the intra-frame string copy mode, and the string prediction flag of the current decoding block is not decoded; The size of the current decoding block includes the width and height of the current decoding block, and the first preset condition is that the width of the current decoding block is less than or equal to a second width threshold and the height of the current decoding block is less than or equal to a second height threshold.

3. An electronic device, characterized in that: include: at least one processor; A storage device configured to store at least one program, which, when executed by the at least one processor, enables the at least one processor to implement the video encoding method as claimed in claim 1 or the video decoding method as claimed in claim 2.

Citation Information

Patent Citations

  • Image encoding method and apparatus and image decoding method and apparatus

    CN105847842A

  • Method and apparatus for processing video signal

    CN106797473A