Block Vector Encoding and Decoding Method, Encoding Device, Decoding Device, and Storage Medium
By generating a list of historical copy information and a list of candidate displacement vectors, and carrying only the block vector predictor index, the problem of large encoding overhead in the prior art is solved, and a more efficient encoding and decoding process is realized.
Patent Information
- Application Number
- CN202110204711.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-23
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2041-02-23
AI Technical Summary
In the prior art, the video encoding method based on motion compensation leads to excessive encoding overhead when encoding block vectors, especially in intra-block copying and intra-string copying tools, the carrying of block vectors and residual information leads to a decrease in encoding efficiency.
By generating a historical copy information list, the candidate displacement vector list is determined, and only the index of the block vector predictor in the candidate list is carried, rather than the block vector and residual information, reducing the encoding overhead.
It effectively reduces the overhead in the encoding and decoding process, improves the accuracy of block vector prediction, and improves the encoding efficiency.
Smart Images

Figure CN114979632B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of image processing technology, and in particular, to a method for encoding and decoding block vectors, an encoding device, a decoding device, and a storage medium. Background Art
[0002] Currently, mainstream video coding standards, such as High Efficiency Video Coding (HEVC), Versatile Video Coding (VVC), and Audio Video Coding Standard (AVS) 3, all adopt a hybrid coding framework based on image blocks. They divide an original frame of image into a series of image blocks, and combine video coding methods such as prediction, transformation, and entropy coding to achieve the compression of video data. Among them, motion compensation is a commonly used prediction method in video coding and decoding. Motion compensation is based on the redundancy characteristics of video content in the time domain or spatial domain, and determines the predicted value of the current block to be encoded according to the reference block. Such prediction methods based on motion compensation include: inter-frame prediction, intra-block copy, intra-string copy, etc. For image blocks using these prediction methods, usually one or more two-dimensional displacement vectors need to be encoded explicitly or implicitly in the bitstream to indicate the displacement of the current block to be encoded relative to one or more of its reference blocks.
[0003] Intra Block Copy (IBC) and Intra String Copy (ISC) are two screen content coding tools in AVS3. They both use the current image frame as a reference and derive the predicted value of the block to be encoded through motion compensation. Considering that IBC and ISC have similar reference regions, and block vectors (BVs) and string vectors (SVs) have a high correlation, an intra-frame prediction history motion information table can be used to record these two types of displacement vector information, position information, size information, and repetition times, and the predicted block vector (Block Vector Predictor, BVP) and predicted string vector (String Vector Predictor, SVP) can be derived through this intra-frame prediction history motion information table.
[0004] In the prior art, for the block to be encoded, that is, the IBC block to be encoded, the encoding end determines the BVP of the block to be encoded. When encoding, the index of the BVP in the candidate displacement vector list is carried in the bitstream, and the residual information between the BVP and the BV of the block to be encoded is also carried in the bitstream. However, this encoding method leads to the problem of excessive encoding overhead. Summary of the Invention
[0005] The present application provides a method for encoding and decoding block vectors, an encoding device, a decoding device, and a storage medium, thereby reducing the encoding overhead.
[0006] In a first aspect, a method for encoding block vectors is provided, including: generating a historical copy information list; determining a candidate displacement vector list according to the historical copy information list; determining a predicted block vector (BVP) of a block to be encoded according to the candidate displacement vector list; encoding the block to be encoded to obtain an output bitstream; where the bitstream includes the index of the BVP in the candidate displacement vector list, and the bitstream does not include the residual information of the BVP and the block vector (BV) of the block to be encoded.
[0007] In a second aspect, a method for decoding block vectors is provided, including: generating a historical copy information list; determining a candidate displacement vector list according to the historical copy information list; obtaining an encoded bitstream; parsing the bitstream to obtain the index of the BVP of the encoded block corresponding to the block to be decoded in the candidate displacement vector list; determining the BVP according to the index and the candidate displacement vector list; determining the BV of the block to be decoded according to the BVP; where the bitstream includes the index, and the bitstream does not include the residual information of the BVP and the BV of the encoded block.
[0008] In a third aspect, an encoding device is provided, including: a generating module, a first determining module, a second determining module, and an encoding module, where the generating module is configured to generate a historical copy information list; the first determining module is configured to determine a candidate displacement vector list according to the historical copy information list; the second determining module is configured to determine the BVP of the block to be encoded according to the candidate displacement vector list; the encoding module is configured to encode the block to be encoded to obtain an output bitstream; the bitstream includes the index of the BVP in the candidate displacement vector list, and the bitstream does not include the residual information of the BVP and the BV of the block to be encoded.
[0009] In a fourth aspect, a decoding device is provided, including: a generating module, a first determining module, an obtaining module, a parsing module, a second determining module, and a third determining module, where the generating module is configured to generate a historical copy information list; the first determining module is configured to determine a candidate displacement vector list according to the historical copy information list; the obtaining module is configured to obtain an encoded bitstream; the parsing module is configured to parse the bitstream to obtain the index of the BVP of the encoded block corresponding to the block to be decoded in the candidate displacement vector list; the second determining module is configured to determine the BVP according to the index and the candidate displacement vector list; the third determining module is configured to determine the BV of the block to be decoded according to the BVP; the bitstream includes the index, and the bitstream does not include the residual information of the BVP and the BV of the encoded block.
[0010] In a fifth aspect, an encoding device is provided, and this encoding device is configured to execute the method in the first aspect.
[0011] In a sixth aspect, a decoding device is provided, and this decoding device is configured to execute the method in the second aspect.
[0012] In a seventh aspect, a computer-readable storage medium is provided for storing a computer program that causes a computer to execute the method of the first aspect.
[0013] In an eighth aspect, a computer-readable storage medium is provided for storing a computer program that causes a computer to execute the method of the second aspect.
[0014] Through the technical solution provided by the present application, the encoding end does not need to encode the residual information of the BVP and BV of the block to be encoded, thereby reducing the encoding overhead. The bitstream parsed by the decoding end does not include the encoding of the residual information of the BVP and BV of the block to be encoded, thereby reducing the decoding overhead. Further, in the present application, when the encoding end and the decoding end generate the historical copy information list, certain restrictions can be imposed on the historical copy information list to filter out some invalid BV or SV in the historical copy information list, so as to improve the accuracy of the BVP. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0016] Figure 1 Schematic diagram of the encoding framework provided by the embodiment of the present application;
[0017] Figure 2 Schematic diagram of the decoding framework provided by the embodiment of the present application;
[0018] Figure 3 Schematic diagram of intra-block copy provided by the embodiment of the present application;
[0019] Figure 4 Schematic diagram of an intra-frame string copy provided by the embodiment of the present application;
[0020] Figure 5 Flowchart of a method for encoding a block vector provided by the embodiment of the present application;
[0021] Figure 6 Flowchart of a method for generating a historical copy information list provided by the embodiment of the present application;
[0022] Figure 7 Flowchart of another method for generating a historical copy information list provided by the embodiment of the present application;
[0023] Figure 8Flowchart of a method for decoding block vectors provided by an embodiment of the present application;
[0024] Figure 9 Flowchart of another method for generating a historical copy information list provided by an embodiment of the present application;
[0025] Figure 10 Flowchart of another method for generating a historical copy information list provided by an embodiment of the present application;
[0026] Figure 11 Schematic diagram of an encoding device provided by an embodiment of the present application;
[0027] Figure 12 Schematic diagram of a decoding device provided by an embodiment of the present application. Detailed implementation manners
[0028] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described here can be implemented in an order different from those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or server including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0030] Before introducing the technical solutions of the present application, the following will first explain the image or video coding framework and decoding framework, IBC technology, and ISC technology:
[0031] I. Image or video coding framework and decoding framework, that is, the hybrid coding framework.
[0032] Exemplarily, Figure 1 Schematic diagram of the coding framework provided by an embodiment of the present application. As Figure 1As shown in the figure, the encoding framework includes: a prediction unit 11, a residual generation unit 12, a transformation unit 13, a quantization unit 14, an inverse quantization unit 15, an inverse transformation unit 16, a reconstruction unit 17, a filtering unit 18, and an entropy encoding unit 19. The prediction unit 11 includes an inter-frame prediction unit 111 and an intra-frame prediction unit 112. The inter-frame prediction unit 111 includes a motion estimation unit 1111 and a motion compensation unit 1112.
[0033] Among them, after the encoding end receives the video, for each frame image constituting the video, the image is divided into multiple image blocks to be encoded. For the current image block to be encoded, the prediction unit 11 first predicts the current image block to be encoded by referring to the reconstructed image block, and obtains the prediction information of the current image block to be encoded. Among them, the encoding end can use inter-frame prediction or intra-frame prediction technology to obtain the prediction information.
[0034] Specifically, the motion estimation unit 1111 in the inter-frame prediction unit 111 can search for the reference pictures in the list of reference pictures to find the reference block of the image block to be encoded. The motion estimation unit 1111 can generate an index indicating the reference block, and a motion vector indicating the spatial displacement between the image block to be encoded and the reference block. The motion estimation unit 1111 can output the index of the reference block and the motion vector as the motion information of the image block to be encoded. The motion compensation unit 1112 can obtain the prediction information of the image block to be encoded based on the motion information of the image block to be encoded.
[0035] The intra-frame prediction unit 112 can generate prediction information for the current image block to be encoded by using the intra-frame prediction mode. Currently, there are 15 intra-frame prediction modes, including the Planar mode, the DC mode, and 13 angular prediction modes. The intra-frame prediction unit 112 can also use technologies such as Intra Block Copy (IBC) and Intra String Copy (ISC).
[0036] The residual generation unit 12 is used to subtract the prediction information from the original signal of the current image block to be encoded to obtain a residual signal. After prediction, the amplitude of the residual signal is much smaller than that of the original signal. The transformation unit 13 and the quantization unit 14 are used to perform transformation and quantization operations on the residual signal. After transformation and quantization, transformed quantization coefficients are obtained. The entropy encoding unit 19 is used to encode the quantization coefficients and other indication information in the encoding through entropy encoding technology to obtain a bitstream.
[0037] Further, the encoding end also needs to reconstruct the current image block to be encoded to provide reference pixels for encoding subsequent image blocks to be encoded. Specifically, after obtaining the transform quantization coefficients of the current image block to be encoded, the inverse quantization unit 15 and the inverse transform unit 16 perform inverse quantization and inverse transformation on the transform quantization coefficients of the current image block to be encoded to obtain a reconstructed residual signal. The reconstruction unit 17 adds the reconstructed residual signal to the prediction information corresponding to the current image block to be encoded to obtain a reconstructed signal of the current image block to be encoded, and a reconstructed image block is obtained according to the reconstructed signal. Further, the filtering unit 18 can filter the reconstructed image block, and deblocking filtering, Sample Adaptive Offset (SAO), Adaptive Loop Filter (ALF), etc. can be adopted. Among them, the reconstructed image block can be used to predict subsequent image blocks to be encoded.
[0038] Exemplarily, Figure 2 is a schematic diagram of the decoding framework provided by the embodiment of the present application. As Figure 2 shown, the decoding framework includes: an entropy decoding unit 21, a prediction unit 22, an inverse quantization unit 23, an inverse transform unit 24, a reconstruction unit 25, and a filtering unit 26. The prediction unit 22 includes: a motion compensation unit 221 and an intra prediction unit 222.
[0039] Specifically, after the decoding end obtains the bitstream, first, the entropy decoding unit 21 performs entropy decoding on the bitstream to obtain the transform quantization coefficients of the current image block to be reconstructed. Then, the inverse quantization unit 23 and the inverse transform unit 24 perform inverse quantization and inverse transformation on the transform quantization coefficients to obtain the reconstructed residual signal of the current image block to be reconstructed. The prediction unit 22 predicts the current image block to be reconstructed to obtain the prediction information of the current image block to be reconstructed. If the prediction unit 22 adopts inter prediction, the motion compensation unit 221 can construct a first reference picture list (list 0) and a second reference picture list (list 1) according to the syntax elements parsed from the bitstream. In addition, the entropy decoding unit 21 can parse the motion information of the image block to be reconstructed. The motion compensation unit 221 can determine one or more reference blocks of the image block to be reconstructed according to the motion information. The motion compensation unit 221 can generate the prediction information of the image block to be reconstructed according to one or more reference blocks. If the prediction unit 22 adopts intra prediction, the entropy decoding unit 21 can parse the index of the intra prediction mode used, and the intra prediction unit 222 can perform intra prediction according to the index using the intra prediction mode to obtain the prediction information of the image block to be reconstructed. The intra prediction unit 222 can also adopt technologies such as IBC or ISC.
[0040] Further, the reconstruction unit 25 is configured to add the prediction information and the above-mentioned reconstructed residual signal to obtain a reconstruction signal of the current image block to be reconstructed, and then obtain a current reconstructed image block corresponding to the current image block to be reconstructed according to the reconstruction signal, where the current reconstructed image block can be used to predict other subsequent image blocks to be reconstructed. Similar to the situation at the encoding end described above, optionally, the filtering unit 26 at the decoding end can filter the current reconstructed image block.
[0041] II. IBC Technology
[0042] IBC is an intra-frame coding tool adopted in the HEVC Screen Content Coding (SCC) extension, which significantly improves the coding efficiency of screen content. In AVS3 and VVC, the IBC technology is also adopted to improve the performance of screen content coding. Figure 3 The intra-block copy schematic diagram provided by the embodiments of this application is shown in Figure 3 As shown, IBC utilizes the spatial correlation of screen content videos and uses the encoded image pixels (i.e., reference blocks) on the current image frame to predict the pixels of the block to be encoded, which can effectively save the bits required for encoding pixels. As Figure 3 shown, the displacement between the block to be encoded and its reference block in IBC is called BV. H.266 / VVC adopts a BV prediction technology similar to inter-frame prediction to further save the bits required for encoding BV.
[0043] III. ISC Technology
[0044] ISC divides a block to be encoded into a series of pixel strings or unmatched pixels according to a certain scanning order (such as raster scanning, back-and-forth scanning, or Zig-Zag scanning, etc.). Similar to IBC, the current string searches for a reference string with the same shape in the encoded area of the current image frame. Based on this, the prediction information of the current string is derived. By encoding the original signal of the current string and the prediction information, the residual signal of the current string is obtained, and the residual signal is encoded. For example: Figure 4 is a schematic diagram of intra-frame string copy provided by the embodiments of this application. As Figure 4 shown, the 28 pixels of the slanted stripes are string 1, the 35 pixels of the horizontal stripes are string 2, and the 1 black pixel represents an unmatched pixel. Among them, the reference string of string 1 is on its left side, and the displacement from string 1 to its corresponding reference string is represented by string vector 1. The reference string of string 2 is above it, and the displacement from string 2 to its corresponding reference string is represented by string vector 2.
[0045] The ISC technology needs to encode the SV, string length, and the flag indicating whether there is a reference string corresponding to each string in the block to be encoded.
[0046] It should be noted that in this application, the block to be coded is also referred to as the image block to be coded, the IBC block to be coded, the coding unit, the current coding unit to be coded, the current image block to be coded, the coding unit to be coded, the image block to be coded, etc. This application does not limit this.
[0047] As described above, IBC and ISC are two screen content coding tools in AVS3. They both use the current image frame as a reference and derive the predicted value of the block to be coded through motion compensation. Considering that IBC and ISC have similar reference regions and BV and SV have a high correlation, an intra-prediction historical motion information table can be used to record these two types of displacement vector information, position information, size information, and repetition times, and derive BVP and SVP through this intra-prediction historical motion information table. However, in the prior art, for the block to be coded, the coding end determines the BVP of the block to be coded. When coding, the index of the BVP in the candidate displacement vector list is carried in the bitstream, and the residual information between the BVP and the BV of the block to be coded is also carried in the bitstream. However, this coding method leads to the problem of excessive coding overhead.
[0048] To solve the above technical problem, this application does not carry the residual information between the BVP and the BV of the block to be coded in the bitstream to reduce the coding overhead.
[0049] The technical solution of this application will be elaborated in detail below:
[0050] Embodiment 1
[0051] Figure 5 It is a flowchart of a coding method for a block vector provided by an embodiment of this application. As Figure 5 shown, the execution subject of this method can be the following devices, but not limited to: an encoder, or a device for performing block vector coding, such as a desktop computer, a mobile computing device, a notebook (e.g., laptop) computer, a tablet computer, a set-top box, a smart phone and other handheld devices, a television, a camera, a display device, a digital media player, a video game console, an in-vehicle computer, or the like. As Figure 5 shown, this method includes the following steps:
[0052] S510: Generate a historical copy information list.
[0053] S520: Determine a candidate displacement vector list according to the historical copy information list.
[0054] S530: Determine the BVP of the block to be coded according to the candidate displacement vector list.
[0055] S540: Encode the block to be coded to obtain an output bitstream. The bitstream includes the index of the BVP in the candidate displacement vector list, and the bitstream does not include the residual information of the BVP and the BV of the block to be coded.
[0056] It should be understood that the historical copy information list is used to determine the candidate displacement vector list, and the candidate displacement vector list is used to determine the BVP of the block to be coded.
[0057] Optionally, the historical copy information list includes: information of historical IBC blocks, or information of at least one string in historical ISC blocks, or information of historical IBC and information of at least one string in historical ISC blocks.
[0058] It should be understood that for any historical IBC block, the information of the historical IBC block includes: the BV of the historical IBC block. Optionally, the information of the historical IBC block further includes at least one of the following: size information of the historical IBC block, position information, prediction mode, and repetition times of the BV of the historical IBC block.
[0059] It should be understood that the size information of the historical IBC block refers to the area of the historical IBC block, which can be measured by the number of pixels included in the historical IBC block.
[0060] Optionally, the position information of the historical IBC block can be represented by pixel coordinates at a preset position. For example, the position information of the historical IBC block is represented by the upper left pixel coordinates or the upper right pixel coordinates of the historical IBC block, etc. The present application does not limit this.
[0061] Optionally, the prediction mode of the historical IBC block can be the first block vector prediction mode, the second block vector prediction mode, or the third block vector prediction mode, etc. It should be noted that the present application does not limit the division method of the prediction mode.
[0062] It should be understood that for any block to be coded, the first block vector prediction mode is a prediction mode that does not encode the residual information of the BVP and BV of the block to be coded, and encodes the residual information of the block to be coded and the reference block. The first block vector prediction mode is also called the IBC_DIR mode. The second block vector prediction mode is a prediction mode that does not encode the residual information of the BVP and BV of the block to be coded, and does not encode the residual information of the block to be coded and the reference block. The second block vector prediction mode is also called the IBC_SKIP mode. The third block vector prediction mode is a prediction mode that encodes the residual information of the BVP and BV of the block to be coded, and encodes the residual information of the block to be coded and the reference block. The third block vector prediction mode is also called the original IBC prediction mode.
[0063] It should be understood that, for any string in the historical ISC block, the size information of the string refers to the length of the string, which can be measured by the number of pixels included in the string.
[0064] Optionally, for any string in the historical ISC block, the position information of the string can be represented by the pixel coordinates at a preset position. For example, the position information of the string can be represented by the position information of the first pixel of the string in the string scanning order, or by the position information of the last pixel of the string in the string scanning order, or by the coordinates of the corner points of the circumscribed rectangle of the string, etc. The present application does not limit this.
[0065] Optionally, for any string in the historical ISC block, the prediction mode of the string can be any prediction mode for the string. The present application does not limit this.
[0066] Optionally, after obtaining the historical copy information list, the encoding end can determine the candidate displacement vector list in the following manner, but not limited to this:
[0067] Optionally, the encoding end determines at least one first displacement vector in the historical copy information list, where the first displacement vector satisfies the fourth preset condition. Further, the encoding end determines the candidate displacement vector list according to at least one first displacement vector.
[0068] Optionally, the first displacement vector satisfies the fourth preset condition including: the size of the IBC block or string corresponding to the first displacement vector is greater than the third preset threshold, but not limited to this.
[0069] It should be understood that the first displacement vector can be BV or SV.
[0070] Optionally, after determining at least one first displacement vector, the encoding end can determine the candidate displacement vector list in the following manner, but not limited to this:
[0071] Optional method 1: Derive the candidate displacement vectors from back to front in the encoding order to form the candidate displacement vector list, that is, in the encoding order, the candidate displacement vector closer to the current block to be encoded has a higher priority. On the contrary, the candidate displacement vector farther from the current block to be encoded has a lower priority.
[0072] Optional method 2: If for any IBC block or any string, its information includes size information, then derive the candidate displacement vectors in the order from largest to smallest according to the size information to form the candidate displacement vector list, that is, in the order from largest to smallest according to the size information, the IBC block or string with larger size information has a higher priority for its corresponding candidate displacement vector. On the contrary, the IBC block or string with smaller size information has a lower priority for its corresponding candidate displacement vector.
[0073] Alternative method 3: If for any IBC block or any string, its information includes: position information, then determine the distance between each IBC block or string and the block to be encoded according to the position information. Derive candidate displacement vectors according to this distance to form a list of candidate displacement vectors, that is, the candidate displacement vector closer to the current block to be encoded has a higher priority. On the contrary, the candidate displacement vector farther from the current block to be encoded has a lower priority.
[0074] Alternative method 4: If for any IBC block or any string, its information includes: prediction mode, then derive candidate displacement vectors according to the prediction mode to form a list of candidate displacement vectors. For example: The encoding end can set the priorities of the first block vector prediction mode, the second block vector prediction mode, and the third block vector prediction mode in descending order.
[0075] Furthermore, the encoding end can determine the BVP of the block to be encoded in combination with this list of candidate displacement vectors, and the process can adopt existing technical solutions, which are not limited in this application.
[0076] Optionally, after determining at least one first displacement vector, in addition to using the above four alternative methods to determine the list of candidate displacement vectors, the encoding end can also use the following method to determine the list of candidate displacement vectors, but not limited to this:
[0077] The encoding end classifies at least one first displacement vector according to the auxiliary information of the corresponding IBC block or string, such as size information, position information, or repetition times. For each category of first displacement vectors, sort the first displacement vectors according to any of the following methods:
[0078] Alternative method 1: Sort the first displacement vectors in this category from the back to the front according to the encoding order, that is, according to the encoding order, the first displacement vector closer to the current block to be encoded has a higher priority. On the contrary, the first displacement vector farther from the current block to be encoded has a lower priority.
[0079] Alternative method 2: If for any IBC block or any string, its information includes: size information, then sort the first displacement vectors in this category in descending order of size information, that is, in descending order of size information, the IBC block or string with larger size information has a higher priority for its corresponding first displacement vector. On the contrary, the IBC block or string with smaller size information has a lower priority for its corresponding first displacement vector.
[0080] Alternative method 3: If for any IBC block or any string, its information includes: position information, then according to the position information, determine the distance between each IBC block or string in this category and the block to be encoded. According to this distance, the first displacement vector closer to the current block to be encoded has a higher priority. On the contrary, the first displacement vector farther from the current block to be encoded has a lower priority.
[0081] Alternative method 4: If for any IBC block or any string, its information includes: the number of repetitions, then sort the first displacement vectors in this category according to the number of repetitions. For example: the more the number of repetitions, the higher the priority of the corresponding first displacement vector. On the contrary, the fewer the number of repetitions, the lower the priority of the corresponding first displacement vector.
[0082] Furthermore, the encoding end determines a candidate displacement vector for each category of the first displacement vectors. For example: there are N categories of first displacement vectors, each corresponding to a candidate displacement vector, forming a final list of candidate displacement vectors. Based on this, the encoding end determines the BVP of the block to be encoded from the list of candidate displacement vectors.
[0083] It should be noted that this application does not limit how to determine a candidate displacement vector for each category of the first displacement vectors, and how to determine the BVP of the block to be encoded from the list of candidate displacement vectors.
[0084] Optionally, the encoding end can classify at least one first displacement vector in the following manner, but not limited to this:
[0085] Alternative method 1: Classify according to the size information of the IBC block or string corresponding to the first displacement vector
[0086] For example: The encoding end classifies the IBC blocks or strings whose size information is greater than (or greater than or equal to) the size threshold T S into one category.
[0087] Alternative method 2: Classify according to the position information of the IBC block or string corresponding to the first displacement vector.
[0088] For example: Assume that the upper left pixel coordinates of the block to be encoded are x0, y0, and the width and height are w, h respectively. There are the following optional classification methods:
[0089] Classify the IBC blocks or strings on the left (x i <x0) into one category;
[0090] Classify the IBC blocks or strings above (y i <y0) into one category;
[0091] Classify the IBC blocks or strings directly to the left (x i <x0 and yi ≥ y0 and y i < y0 + h) of the IBC blocks or strings are classified into one category;
[0092] The directly above (y i < y0 and x i ≥ x0 and x i < x0 + w) of the IBC blocks or strings are classified into one category;
[0093] The upper left (y i < y0 and x i < x0) of the IBC blocks or strings are classified into one category;
[0094] The upper right (y i < y0 and x i >= x0 + w) of the IBC blocks or strings are classified into one category;
[0095] The lower left (y i >= y0 + h and x i < x0) of the IBC blocks or strings are classified into one category;
[0096] Optional method 3: Classify according to the BV repetition times of the IBC blocks or strings corresponding to the first displacement vector.
[0097] For example: The encoding end classifies the IBC blocks or strings with repetition times greater than (or greater than or equal to) the repetition time threshold T C into one category.
[0098] Optionally, when the encoding end classifies at least one first displacement vector, if there is an empty category, the encoding end can write the SV of the adjacent string of the block to be encoded or the BV of the not completely adjacent IBC block into this empty category.
[0099] It should be understood that after the encoding end determines the BVP of the block to be encoded, the existing encoding method can be used to encode the block to be encoded to obtain a bitstream, and this application does not limit the existing encoding method.
[0100] It should be understood that after the encoding end finishes encoding the block to be encoded, the historical copy information list can be updated. Specifically, the historical copy information list can be updated in the following ways, but not limited to this:
[0101] In one case, assume that for any IBC block or string, its information only includes: BV or SV. After the encoding end finishes encoding the block to be encoded, it first determines whether the BV of the block to be encoded is repeated with the BV or SV within the preset range in the historical copy information list, or determines whether the BV of the block to be encoded is repeated with the preset BV. If it is repeated, the BV of the block to be encoded is not inserted into the historical copy information list. If it is not repeated and the historical copy information list has not reached the maximum length, the BV of the block to be encoded is inserted at the end or the head of the historical copy information list. If it is not repeated, but the historical copy information list has reached the maximum length, the BV or SV at the end or the head of the historical copy information list is deleted, and the BV of the block to be encoded is inserted at the end or the head of the historical copy information list.
[0102] In another case, assume that for any IBC block or string, in addition to including: BV or SV, its information also includes the above auxiliary information, such as: size information, position information, and repetition times. That is, for any IBC block, the information here includes: the BV and auxiliary information of this IBC block. For any string, the information here includes: the SV and auxiliary information of this string.
[0103] An optional method is that after the encoding end finishes encoding the block to be encoded, it first determines whether the information of the block to be encoded is repeated with the information within the preset range in the historical copy information list, or determines whether the information of the block to be encoded is repeated with the preset information. If it is repeated, the information of the block to be encoded is not inserted into the historical copy information list. If it is not repeated and the historical copy information list has not reached the maximum length, the information of the block to be encoded is inserted at the end or the head of the historical copy information list. If it is not repeated, but the historical copy information list has reached the maximum length, the information at the end or the head of the historical copy information list is deleted, and the information of the block to be encoded is inserted at the end or the head of the historical copy information list.
[0104] Another optional way is that after the coding end finishes coding the block to be coded, it first determines whether the BV of the block to be coded is repeated with the BV or SV within the preset range in the historical replication information list, or, alternatively, determines whether the BV of the block to be coded is repeated with the preset BV. If it is repeated, new information is inserted into the historical replication information list. Optionally, assuming that the IBC block / string in the historical replication information list that has the same BV or SV as the block to be coded is called a specific IBC block / string, then the new information includes: the BV of the block to be coded, the size information of the larger one between the block to be coded and the specific IBC block / string, the position information of the block to be coded, and the BV repetition count plus one. It should be noted that this application does not limit how to form new information based on the information of the block to be coded and the specific IBC block / string. If it is not repeated and the historical replication information list has not reached the maximum length, the information of the block to be coded is inserted at the end or the head of the historical replication information list. If it is not repeated but the historical replication information list has reached the maximum length, the information at the end or the head of the historical replication information list is deleted, and the information of the block to be coded is inserted at the end or the head of the historical replication information list. It should be understood that for any IBC block, the information here includes: the BV of this IBC block and auxiliary information. For any string, the information here includes: the SV of this string and auxiliary information.
[0105] Optionally, the above preset range can be the entire range of the historical replication information list, or, it is the range where the information of the last N or the first N IBC blocks or strings in the historical replication information list is located, but not limited to this.
[0106] Optionally, the above preset BV can be (0, 1), etc., and this application does not limit this.
[0107] Optionally, the above preset information includes a preset BV and preset auxiliary information. The preset BV can be (0, 1), etc., and this application does not limit this, and this application also does not limit the preset auxiliary information.
[0108] In summary, in this application, the coding end does not need to code the residual information of the BVP and BV of the block to be coded, thereby reducing the coding overhead. Further, since there is no need to code the residual information of the BVP and BV of the block to be coded, for the decoding end, it can make the BVP equal to the BV. Based on this, it is crucial to improve the accuracy of the BVP. Based on this, the coding end determines that the first displacement vector in the historical replication information list satisfies the fourth preset condition. For example: the size of the IBC block or string corresponding to the first displacement vector is greater than the third preset threshold. That is, the size of the IBC block or string corresponding to the first displacement vector is larger, making the first displacement vector closer to the BV of the block to be coded, thereby improving the accuracy of the BVP.
[0109] Embodiment 2
[0110] As described above, since there is no need to encode the residual information of the BVP and BV of the block to be encoded, for the decoder, it can set the BVP equal to the BV. Based on this, it is crucial to improve the accuracy of the BVP. In the present application, when generating the historical copy information list, the encoder can impose certain restrictions on the historical copy information list to filter out some invalid BV or SV in the historical copy information list. The following provides a detailed description:
[0111] Figure 6 The flowchart of a method for generating a historical copy information list provided by an embodiment of the present application is shown in Figure 6 As shown, the execution subject of this method can be the following devices, but is not limited thereto: an encoder, or a device for performing block vector coding, such as a desktop computer, a mobile computing device, a notebook (e.g., laptop) computer, a tablet computer, a set-top box, a handheld device such as a smart phone, a television, a camera, a display device, a digital media player, a video game console, an in-vehicle computer, or the like. As Figure 6 shown, this method includes the following steps:
[0112] S610: If the encoding of the first IBC block is completed, write the information of the first IBC block into the historical copy information list, or, if the encoding of the first IBC block is completed and the first IBC meets the first preset condition, write the information of the first IBC block into the historical copy information list.
[0113] S620: If the encoding of the first ISC block is completed, write the information of at least one string of the first ISC block into the historical copy information list, or, if the encoding of the first ISC block is completed and the first ISC meets the second preset condition, write the information of at least one string of the first ISC block into the historical copy information list.
[0114] It should be understood that the first IBC block is any encoded IBC block, and the first ISC block is any encoded ISC block. The information of the first IBC block includes the BV of the first IBC block. For any one of the at least one string of the first ISC block, the information of the string includes the string vector SV of the string.
[0115] Optionally, the information of the first IBC block further includes at least one of the following: the size information of the first IBC block, the position information, the prediction mode, the repetition times of the BV of the first IBC block. For any one of the at least one string of the first ISC block, the information of the string further includes at least one of the following: the size information of the string, the position information, the prediction mode, the repetition times of the SV of the string.
[0116] Optionally, the first preset condition includes at least one of the following, but is not limited thereto:
[0117] 1. The size of the first IBC block is greater than or equal to a first preset threshold;
[0118] 2. The width of the first IBC block is greater than or equal to a first preset width;
[0119] 3. The height of the first IBC block is greater than or equal to a first preset height;
[0120] 4. The absolute value of the abscissa of the BV of the first IBC block is greater than or equal to the width of the block to be coded;
[0121] 5. The absolute value of the ordinate of the BV of the first IBC block is greater than or equal to the height of the block to be coded.
[0122] It should be noted that the greater than or equal to involved in each item of the first preset condition can be replaced by greater than.
[0123] It should be understood that the first preset threshold, the first preset width, and the first preset height can be set according to the actual situation, and the present application does not limit this.
[0124] Optionally, at least one string of the first ISC block is any one of the following, but not limited to this:
[0125] 1. All strings in the first ISC block.
[0126] 2. Strings in the first ISC block with a length greater than a first preset length.
[0127] 3. The longest string in the first ISC block.
[0128] 4. The first string in the first ISC block.
[0129] 5. The last string in the first ISC block.
[0130] It should be noted that in the present application, the first string and the last string in the first ISC block are determined according to the scanning order of the first ISC block. For example: according to the scanning order, the first scanned string is the first string, and the last scanned string is the last string.
[0131] It should be understood that the first preset length can be set according to the actual situation, and the present application does not limit this.
[0132] Optionally, the second preset condition includes at least one of the following, but not limited to this:
[0133] 1. The size of the first ISC block is greater than or equal to a second preset threshold;
[0134] 2. The length of the longest string in the first ISC block is greater than or equal to a second preset length;
[0135] 3. The width of the first ISC block is greater than or equal to a second preset width;
[0136] 4. The height of the first ISC block is greater than or equal to a second preset height;
[0137] 5. The absolute value of the abscissa of the BV of the first ISC block is greater than or equal to the width of the block to be encoded;
[0138] 6. The absolute value of the ordinate of the BV of the first ISC block is greater than or equal to the height of the block to be encoded.
[0139] It should be noted that the greater than or equal to involved in each item of the second preset condition can be replaced by greater than.
[0140] It should be understood that the second preset threshold, the second preset length, the second preset width, and the second preset height can be set according to actual situations, and the present application does not limit this.
[0141] Figure 7 For another flowchart of the method for generating a historical copy information list provided by an embodiment of the present application, as Figure 7 shown, the execution subject of the method may be the following devices, but is not limited thereto: an encoder, or a device for performing block vector coding, such as a desktop computer, a mobile computing device, a notebook (e.g., laptop) computer, a tablet computer, a set-top box, a handheld device such as a smart phone, a television, a camera, a display device, a digital media player, a video game console, an in-vehicle computer, or the like. As Figure 7 shown, the method includes the following steps:
[0142] S710: If the encoding of the first IBC block is completed, write the information of the first IBC block into the historical copy information list, or, if the encoding of the first IBC block is completed and the first IBC satisfies the first preset condition, write the information of the first IBC block into the historical copy information list.
[0143] S720: If the encoding of the first string in the first ISC block is completed, write the information of the first string into the historical copy information list, or, if the encoding of the first string is completed and the first string satisfies the third preset condition, write the information of the first string into the historical copy information list, or, if the encoding of the first string is completed and the first ISC block satisfies the second preset condition, write the information of the first string into the historical copy information list.
[0144] It should be understood that the first IBC block is any encoded IBC block, and the first ISC block is any encoded ISC block. The information of the first IBC block includes the BV of the first IBC block. The information of the first string includes the SV of the first string.
[0145] Optionally, the information of the first IBC block further includes at least one of the following: the size information of the first IBC block, the position information, the prediction mode, and the number of repetitions of the BV of the first IBC block. The information of the first string further includes at least one of the following: the size information of the first string, the position information, the prediction mode, and the number of repetitions of the SV of the first string.
[0146] It should be understood that for the first preset condition and the second preset condition, reference can be made to Figure 6 the corresponding embodiments, and the present application will not elaborate on this.
[0147] Optionally, the third preset condition includes any one of the following, but is not limited thereto:
[0148] 1. The length of the first string is greater than the third preset length.
[0149] 2. The first string is the first string in the first ISC block.
[0150] 3. The first string is the last string in the first ISC block.
[0151] It should be understood that the third preset length can be set according to the actual situation, and the present application does not limit this.
[0152] It should be noted that Figure 6 the corresponding embodiments and Figure 7 the differences from the corresponding embodiments are that in Figure 6 the corresponding embodiments, after the encoding end finishes encoding the first ISC block, it writes the information of at least one string of the first ISC block into the historical copy information list, or, if the encoding of the first ISC block is completed and the first ISC meets the second preset condition, it writes the information of at least one string of the first ISC block into the historical copy information list. While in Figure 7 the corresponding embodiments, after the encoding end finishes encoding any string in the first ISC block, it writes the information of this string into the historical copy information list, or, when this string or the first ISC block meets the corresponding preset condition, it writes the information of this string into the historical copy information list.
[0153] In summary, in the present application, since there is no need to encode the residual information of the BVP and BV of the block to be encoded, for the decoding end, it can set the BVP equal to the BV. Based on this, it is crucial to improve the accuracy of the BVP. Based on this, when generating the historical copy information list, the encoding end can write the information of the IBC block or string that meets the corresponding preset condition into the historical copy information list, so as to filter out some invalid BV or SV in the historical copy information list, thereby improving the accuracy of the BVP.
[0154] Embodiment 3
[0155] In this application, both the encoding end and the decoding end can default to using the above-mentioned first block vector prediction mode or the second block vector prediction mode. Of course, they can also not default to using the above-mentioned first block vector prediction mode or the second block vector prediction mode, but determine whether to use the above-mentioned first block vector prediction mode or the second block vector prediction mode through a display indication method. The following will explain this display indication method:
[0156] Optionally, the bitstream output by the encoding end includes: a first identifier or a second identifier. The first identifier is used to identify that the first block vector prediction mode is to be used for the block to be encoded. The second identifier is used to identify that the second block vector prediction mode is to be used for the block to be encoded.
[0157] Optionally, if the bitstream includes the first identifier, the encoding of the preset identifier ctp_zero_flag is skipped; the preset identifier is used to identify whether the residual information of the block to be encoded and the reference block is both 0.
[0158] It should be understood that the bitstream output by the encoding end can also include: a fourth identifier, or a fifth identifier, or the fourth identifier and the fifth identifier. The fourth identifier is used to identify that the first block vector prediction mode is not to be used for the block to be encoded. The fifth identifier is used to identify that the second block vector prediction mode is not to be used for the block to be encoded.
[0159] Optionally, if the bitstream output by the encoding end includes: the fourth identifier, or the fifth identifier, or the fourth identifier and the fifth identifier, the bitstream output by the encoding end can include: the residual information of the BVP and BV of the block to be encoded.
[0160] Optionally, if the bitstream output by the encoding end includes: the fourth identifier, or the fifth identifier, or the fourth identifier and the fifth identifier, at this time the encoding end defaults to using the third block vector prediction mode, where the third block vector prediction mode is to encode the residual information of the BVP and BV of the block to be encoded and the residual information of the block to be encoded and the reference block.
[0161] Optionally, the bitstream output by the encoding end can include both the first identifier and the fifth identifier at the same time, and at this time the first block vector prediction mode is used for the block to be encoded. Or the bitstream output by the encoding end can include both the second identifier and the fourth identifier at the same time, and at this time the second block vector prediction mode is used for the block to be encoded.
[0162] Optionally, if the bitstream includes the first identifier, the encoding end selects a context model according to the prediction mode of the adjacent reference block of the block to be encoded to encode the first identifier. If the bitstream includes the second identifier, the encoding end selects a context model according to the prediction mode of the adjacent reference block of the block to be encoded to encode the second identifier.
[0163] Exemplarily, the encoding end selects a context model according to whether the adjacent reference block of the block to be encoded is in the first block vector prediction mode; if so, context model A is selected, and if not, context model B is selected. Alternatively, the encoding end selects a context model according to whether the adjacent reference block of the block to be encoded is in the second block vector prediction mode; if so, context model A is selected, and if not, context model B is selected. Alternatively, the encoding end selects a context model according to whether the adjacent reference block of the block to be encoded is in the third block vector prediction mode; if so, context model A is selected, and if not, context model B is selected. Alternatively, the encoding end selects a context model according to whether the adjacent reference block of the block to be encoded is in the ISC prediction mode; if so, context model A is selected, and if not, context model B is selected. Alternatively, the encoding end selects a context model according to whether the adjacent reference block of the block to be encoded is in the SKIP prediction mode; if so, context model A is selected, and if not, context model B is selected.
[0164] Optionally, when encoding, the encoding end may also not carry at least one of the above-mentioned first identifier, second identifier, fourth identifier, and fifth identifier, but determine to adopt the first block vector prediction mode, the second block vector prediction mode, or the third block vector prediction mode according to the length of the candidate displacement vector list.
[0165] Exemplarily, if the length of the candidate displacement vector list is greater than the fourth preset length, the encoding end encodes the block to be encoded using the first block vector prediction mode or the second block vector prediction mode; if the length of the candidate displacement vector list is less than or equal to the fourth preset length, the encoding end adopts the third block vector prediction mode for the block to be encoded.
[0166] In summary, in the present application, the encoding end may default to adopting the above-mentioned first block vector prediction mode or the second block vector prediction mode, may also determine whether to adopt the above-mentioned first block vector prediction mode or the second block vector prediction mode through an explicit indication method, and may also determine the block vector prediction mode according to the length of the candidate displacement vector list, thereby improving the encoding flexibility. Further, when encoding the first identifier or the second identifier, the encoding end may select the corresponding context model, further improving the encoding flexibility.
[0167] Embodiment 4
[0168] As described above, since there is no need to encode the residual information of the BVP and BV of the block to be encoded, in order to improve the accuracy of the BVP, the encoding end may indicate the adjustment amount of the BVP to the decoding end so that the decoding end can make an adaptive adjustment to the BVP, as follows:
[0169] Optionally, the bitstream output by the encoding end includes: a third identifier, which is used to identify whether BVP needs to be adjusted. Correspondingly, if the third identifier is used to indicate that BVP needs to be adjusted, the bitstream further includes: an index of the adjustment amount corresponding to BVP.
[0170] Optionally, the adjustment amount includes: the adjustment amount bvd_distance in terms of distance and the adjustment amounts bvd_sign_x and bvd_sign_y in terms of direction. Among them, the encoding end stores a list bvd_distance_list of distance adjustment amounts and a list bvd_sign_list of direction adjustment amounts. The following uses examples to illustrate these two tables:
[0171] Exemplarily, bvd_distance_list is shown in Table 1:
[0172] Table 1
[0173] bvd_distance_index bvd_distance 0 4 1 8 2 16 3 32
[0174] Exemplarily, bvd_sign_list is shown in Table 2:
[0175] Table 2
[0176] bvd_sign_idx bvd_sign_x bvd_sign_y 0 +1 0 1 -1 0 2 0 +1 3 0 -1
[0177] In summary, in the present application, the bitstream output by the encoding end may include: a third identifier to identify whether BVP needs to be adjusted. Correspondingly, if the third identifier is used to indicate that BVP needs to be adjusted, the bitstream further includes: an index of the adjustment amount corresponding to BVP. Thus, the decoding end can adjust BVP according to this index, thereby improving the accuracy of BVP.
[0178] Embodiment 5
[0179] Figure 8 The flowchart of a method for decoding a block vector provided in an embodiment of the present application, where the execution subject of the method may be the following devices, but not limited to: a decoder, or a device for performing block vector decoding, such as a desktop computer, a mobile computing device, a notebook (e.g., laptop) computer, a tablet computer, a set-top box, a handheld device such as a smart phone, a television, a camera, a display device, a digital media player, a video game console, an in-vehicle computer, or the like. As Figure 8 shown, the method includes the following steps:
[0180] S810: Generate a list of historical copy information.
[0181] S820: Determine a list of candidate displacement vectors according to the list of historical copy information.
[0182] S830: Obtain an encoded bitstream, where the bitstream includes the index of the BVP of the encoded block corresponding to the block to be decoded in the candidate displacement vector list, and the bitstream does not include the residual information of the BVP and the BV of the encoded block.
[0183] S840: Parse the bitstream to obtain the index of the BVP of the encoded block corresponding to the block to be decoded in the candidate displacement vector list.
[0184] S850: Determine the BVP according to the index and the historical copy information list.
[0185] S860: Determine the BV of the block to be decoded according to the BVP.
[0186] It should be understood that the historical copy information list is used to determine the candidate displacement vector list, and the candidate displacement vector list is used to determine the BVP of the encoded block.
[0187] Optionally, the historical copy information list includes: information of historical IBC blocks, or information of at least one string in historical ISC blocks, or information of historical IBC and information of at least one string in historical ISC blocks.
[0188] It should be understood that for any historical IBC block, the information of the historical IBC block includes: the BV of the historical IBC block. Optionally, the information of the historical IBC block further includes at least one of the following: size information of the historical IBC block, position information, prediction mode, and repetition times of the BV of the historical IBC block.
[0189] It should be understood that the size information of the historical IBC block refers to the area of the historical IBC block, which can be measured by the number of pixels included in the historical IBC block.
[0190] Optionally, the position information of the historical IBC block can be represented by pixel coordinates at a preset position. For example: the position information of the historical IBC block is represented by the upper left pixel coordinates or the upper right pixel coordinates of the historical IBC block, etc., and this application does not limit this.
[0191] Optionally, the prediction mode of the historical IBC block can be the first block vector prediction mode, the second block vector prediction mode, or the third block vector prediction mode, etc. It should be noted that this application does not limit the division method of the prediction mode.
[0192] It should be understood that the explanations of the first block vector prediction mode, the second block vector prediction mode, and the third block vector prediction mode can be referred to the above text, and this application will not elaborate on this.
[0193] It should be understood that for any string in the historical ISC block, the size information of the string refers to the length of the string, which can be measured by the number of pixels included in the string.
[0194] Optionally, for any string in the historical ISC block, the position information of the string can be represented by pixel coordinates at a preset position. For example, the position information of the string can be represented by the position information of the first pixel of the string in the string scanning order, or by the position information of the last pixel of the string in the string scanning order, or by the coordinates of the corner points of the circumscribed rectangle of the string, etc. The present application does not limit this.
[0195] Optionally, for any string in the historical ISC block, the prediction mode of the string can be any prediction mode for the string. The present application does not limit this.
[0196] Optionally, after obtaining the historical copy information list, the decoding end can determine the candidate displacement vector list in the following ways, but not limited to this:
[0197] Optionally, the decoding end determines at least one first displacement vector in the historical copy information list, and the first displacement vector here satisfies the fourth preset condition. Further, the decoding end determines the candidate displacement vector list according to at least one first displacement vector.
[0198] Optionally, the first displacement vector satisfies the fourth preset condition including: the size of the IBC block or string corresponding to the first displacement vector is greater than the third preset threshold, but not limited to this.
[0199] It should be understood that the first displacement vector can be BV or SV.
[0200] Optionally, after determining at least one first displacement vector, the decoding end can determine the candidate displacement vector list in the following ways, but not limited to this:
[0201] Optional method one: Derive candidate displacement vectors from back to front in the decoding order to form a candidate displacement vector list, that is, in the decoding order, the candidate displacement vector closer to the currently to-be-decoded block has a higher priority. On the contrary, the candidate displacement vector farther from the currently to-be-decoded block has a lower priority.
[0202] Optional method two: If for any IBC block or any string, its information includes: size information, then derive candidate displacement vectors in the order from largest to smallest according to the size information to form a candidate displacement vector list, that is, in the order from largest to smallest according to the size information, the IBC block or string with larger size information has a higher priority for its corresponding candidate displacement vector. On the contrary, the IBC block or string with smaller size information has a lower priority for its corresponding candidate displacement vector.
[0203] Optional method 3: If for any IBC block or any string, its information includes: position information, then determine the distance between each IBC block or string and the block to be decoded according to the position information. Derive candidate displacement vectors according to this distance to form a candidate displacement vector list, that is, the candidate displacement vector closer to the current block to be decoded has a higher priority. On the contrary, the candidate displacement vector farther from the current block to be decoded has a lower priority.
[0204] Optional method 4: If for any IBC block or any string, its information includes: prediction mode, then derive candidate displacement vectors according to the prediction mode to form a candidate displacement vector list. For example: The decoding end can set the priorities of the first block vector prediction mode, the second block vector prediction mode, and the third block vector prediction mode in descending order.
[0205] Furthermore, the decoding end can determine the BVP of the block to be decoded in combination with this candidate displacement vector list, and the process can adopt existing technical solutions, which are not limited in this application.
[0206] Optionally, after the decoding end determines at least one first displacement vector, in addition to using the above four optional methods to determine the candidate displacement vector list, the following method can also be used to determine the candidate displacement vector list, but not limited to this:
[0207] The decoding end classifies at least one first displacement vector according to the auxiliary information of the corresponding IBC block or string, such as size information, position information, or repetition times. For each class of first displacement vectors, sort the first displacement vectors according to any of the following methods:
[0208] Optional method 1: Sort the first displacement vectors in this class from the back to the front according to the decoding order, that is, according to the decoding order, the first displacement vector closer to the current block to be decoded has a higher priority. On the contrary, the first displacement vector farther from the current block to be decoded has a lower priority.
[0209] Optional method 2: If for any IBC block or any string, its information includes: size information, then sort the first displacement vectors in this class in descending order of size information, that is, in descending order of size information, the IBC block or string with larger size information has a higher priority for its corresponding first displacement vector. On the contrary, the IBC block or string with smaller size information has a lower priority for its corresponding first displacement vector.
[0210] Alternative method 3: If for any IBC block or any string, its information includes: position information, then according to the position information, determine the distance between each IBC block or string in this category and the block to be decoded. According to this distance, the first displacement vector closer to the current block to be decoded has a higher priority. On the contrary, the first displacement vector farther from the current block to be decoded has a lower priority.
[0211] Alternative method 4: If for any IBC block or any string, its information includes: the number of repetitions, then sort the first displacement vectors in this category according to the number of repetitions. For example: the more the number of repetitions, the higher the priority of the corresponding first displacement vector. On the contrary, the fewer the number of repetitions, the lower the priority of the corresponding first displacement vector.
[0212] Furthermore, the decoding end determines a candidate displacement vector for each category of the first displacement vectors. For example: there are N categories of first displacement vectors, and each of them corresponds to a candidate displacement vector, forming a final list of candidate displacement vectors. Based on this, the decoding end determines the BVP from the list of candidate displacement vectors.
[0213] It should be noted that this application does not limit how to determine a candidate displacement vector for each category of the first displacement vectors, and how to determine the BVP from the list of candidate displacement vectors.
[0214] Optionally, the decoding end can classify at least one first displacement vector in the following manner, but not limited to this:
[0215] Alternative method 1: Classify according to the size information of the IBC block or string corresponding to the first displacement vector
[0216] For example: the decoding end classifies the IBC blocks or strings whose size information is greater than (or greater than or equal to) the size threshold T S into one category.
[0217] Alternative method 2: Classify according to the position information of the IBC block or string corresponding to the first displacement vector.
[0218] For example: Assume that the pixel coordinates of the upper left corner of the block to be decoded are x0, y0, and the width and height are w, h respectively. There are the following optional classification methods:
[0219] Classify the IBC blocks or strings on the left (x i <x0) into one category;
[0220] Classify the IBC blocks or strings above (y i <y0) into one category;
[0221] Classify the IBC blocks or strings directly on the left (x i <x0 and y i ≥y0 and yi The IBC blocks or strings with (y0 + h) are classified into one category;
[0222] Those directly above (y i <y0 and x i ≥ x0 and x i <(x0 + w) are classified into one category;
[0223] Those in the upper left corner (y i <y0 and x i <x0) are classified into one category;
[0224] Those in the upper right corner (y i <y0 and x i ≥ x0 + w) are classified into one category;
[0225] Those in the lower left corner (y i ≥ y0 + h and x i <x0) are classified into one category;
[0226] Optional method three: Classify according to the BV repetition times of the IBC blocks or strings corresponding to the first displacement vector.
[0227] For example: The decoding end classifies the IBC blocks or strings with repetition times greater than (or greater than or equal to) the repetition times threshold T C into one category.
[0228] Optionally, when the decoding end classifies at least one first displacement vector, if there is an empty category, the decoding end can write the SV of the adjacent string of the block to be decoded or the BV of the not completely adjacent IBC block into this empty category.
[0229] It should be understood that after the decoding end finishes decoding the block to be decoded, it can update the historical copy information list. Specifically, the historical copy information list can be updated in the following ways, but not limited to this:
[0230] In one case, assume that for any IBC block or string, its information only includes: BV or SV. Then after the decoding end finishes decoding the block to be decoded, it first judges whether the BV of the block to be decoded repeats with the BV or SV within the preset range in the historical copy information list, or judges whether the BV of the block to be decoded repeats with the preset BV. If it repeats, the BV of the block to be decoded is not inserted into the historical copy information list. If it does not repeat, and the historical copy information list has not reached the maximum length, the BV of the block to be decoded is inserted at the end or the head of the historical copy information list. If it does not repeat, but the historical copy information list has reached the maximum length, the BV or SV at the end or the head of the historical copy information list is deleted, and the BV of the block to be decoded is inserted at the end or the head of the historical copy information list.
[0231] In another case, assume that for any IBC block or string, its information includes, in addition to BV or SV, the above-mentioned auxiliary information, such as size information, position information, and repetition times. That is, for any IBC block, the information here includes the BV of the IBC block and the auxiliary information. For any string, the information here includes the SV of the string and the auxiliary information.
[0232] In an optional manner, after the decoding end finishes decoding the block to be decoded, it first determines whether the information of the block to be decoded is repeated with the information within the preset range in the historical replication information list, or determines whether the information of the block to be decoded is repeated with the preset information. If it is repeated, the information of the block to be decoded is not inserted into the historical replication information list. If it is not repeated and the historical replication information list has not reached the maximum length, the information of the block to be decoded is inserted at the end or the head of the historical replication information list. If it is not repeated, but the historical replication information list has reached the maximum length, the information at the end or the head of the historical replication information list is deleted, and the information of the block to be decoded is inserted at the end or the head of the historical replication information list.
[0233] In another optional manner, after the decoding end finishes decoding the block to be decoded, it first determines whether the BV of the block to be decoded is repeated with the BV or SV within the preset range in the historical replication information list, or determines whether the BV of the block to be decoded is repeated with the preset BV. If it is repeated, new information is inserted into the historical replication information list. Optionally, assume that the IBC block / string in the historical replication information list that has the same BV or SV as the block to be decoded is called a specific IBC block / string. Then the new information includes: the BV of the block to be decoded, the size information of the larger one between the block to be decoded and the specific IBC block / string, the position information of the block to be decoded, and the BV repetition times plus one. It should be noted that this application does not limit how to form new information based on the information of the block to be decoded and the specific IBC block / string. If it is not repeated and the historical replication information list has not reached the maximum length, the information of the block to be decoded is inserted at the end or the head of the historical replication information list. If it is not repeated, but the historical replication information list has reached the maximum length, the information at the end or the head of the historical replication information list is deleted, and the information of the block to be decoded is inserted at the end or the head of the historical replication information list. It should be understood that for any IBC block, the information here includes the BV of the IBC block and the auxiliary information. For any string, the information here includes the SV of the string and the auxiliary information.
[0234] Optionally, the above-mentioned preset range can be the entire range of the historical replication information list, or the range of the information of the last N or the first N IBC blocks or strings in the historical replication information list, but not limited thereto.
[0235] Optionally, the above preset BV may be (0, 1), etc., and the present application does not limit this.
[0236] Optionally, the above preset information includes a preset BV and preset auxiliary information. The preset BV may be (0, 1), etc., and the present application does not limit this, and the present application also does not limit the preset auxiliary information.
[0237] In summary, in the present application, the BVP and the residual information of the BV of the coding block corresponding to the block to be decoded are not carried in the bitstream, thereby reducing the decoding overhead. Further, since the BVP and the residual information of the BV of the coding block corresponding to the block to be decoded are not carried in the bitstream, for the decoding end, it can make the BVP equal to the BV. Based on this, it is crucial to improve the accuracy of the BVP. Based on this, the decoding end determines that the first displacement vector in the historical copy information list satisfies the fourth preset condition, for example: the size of the IBC block or string corresponding to the first displacement vector is greater than the third preset threshold. That is, the size of the IBC block or string corresponding to the first displacement vector is relatively large, making the first displacement vector closer to the BV of the block to be decoded, thereby improving the accuracy of the BVP.
[0238] Embodiment 6
[0239] As described above, since the BVP and the residual information of the BV of the coding block corresponding to the block to be decoded are not carried in the bitstream, for the decoding end, it can make the BVP equal to the BV. Based on this, it is crucial to improve the accuracy of the BVP. In the present application, when generating the historical copy information list, the decoding end can impose certain restrictions on the historical copy information list to filter out some invalid BVs or SVs in the historical copy information list. The following gives a detailed description:
[0240] Figure 9 It is a flowchart of still another method for generating a historical copy information list provided by an embodiment of the present application. As Figure 9 shown, the execution subject of this method may be the following devices, but is not limited thereto: a decoder, or a device for performing block vector decoding, such as a desktop computer, a mobile computing device, a notebook (e.g., laptop) computer, a tablet computer, a set-top box, a handheld device such as a smart phone, a television, a camera, a display device, a digital media player, a video game console, an in-vehicle computer, or the like. As Figure 9 shown, this method includes the following steps:
[0241] S910: If the decoding of the second IBC block is completed, write the information of the second IBC block into the historical copy information list, or, if the decoding of the second IBC block is completed and the second IBC meets the fifth preset condition, write the information of the second IBC block into the historical copy information list.
[0242] S920: If the decoding of the second ISC block is completed, the information of at least one string of the second ISC block is written into the historical copy information list; or, if the decoding of the second ISC block is completed and the second ISC meets the sixth preset condition, the information of at least one string of the second ISC block is written into the historical copy information list.
[0243] It should be understood that the second IBC block is any reconstructed IBC block, and the second ISC block is any reconstructed ISC block. The information of the second IBC block includes the BV of the second IBC block. For any one of at least one string of the second ISC block, the information of the string includes the SV of the string.
[0244] Optionally, the information of the second IBC block further includes at least one of the following: the size information of the second IBC block, the position information, the prediction mode, the repetition times of the BV of the second IBC block. For any one of at least one string of the second ISC block, the information of the string further includes at least one of the following: the size information of the string, the position information, the prediction mode, the repetition times of the SV of the string.
[0245] Optionally, the fifth preset condition includes at least one of the following, but is not limited thereto:
[0246] 1. The size of the second IBC block is greater than or equal to the first preset threshold;
[0247] 2. The width of the second IBC block is greater than or equal to the first preset width;
[0248] 3. The height of the second IBC block is greater than or equal to the first preset height;
[0249] 4. The absolute value of the abscissa of the BV of the second IBC block is greater than or equal to the width of the block to be decoded;
[0250] 5. The absolute value of the ordinate of the BV of the second IBC block is greater than or equal to the height of the block to be decoded.
[0251] It should be understood that the first preset threshold, the first preset width, and the first preset height can be set according to the actual situation, and the present application does not limit this.
[0252] Optionally, at least one string of the second ISC block is any one of the following, but is not limited thereto:
[0253] 1. All strings in the second ISC block.
[0254] 2. Strings in the second ISC block with a length greater than the first preset length.
[0255] 3. The longest string in the second ISC block.
[0256] 4. The first string in the second ISC block.
[0257] 5. The last string in the second ISC block.
[0258] It should be noted that in this application, the first string and the last string in the second ISC block are determined according to the scanning order of the second ISC block. For example, in the scanning order, the first scanned string is the first string, and the last scanned string is the last string.
[0259] It should be understood that the first preset length can be set according to the actual situation, and this application does not limit this.
[0260] Optionally, the sixth preset condition includes any one of the following, but is not limited thereto:
[0261] 1. The size of the second ISC block is greater than or equal to the second preset threshold;
[0262] 2. The length of the longest string in the second ISC block is greater than or equal to the second preset length;
[0263] 3. The width of the second ISC block is greater than or equal to the second preset width;
[0264] 4. The height of the second ISC block is greater than or equal to the second preset height;
[0265] 5. The absolute value of the abscissa of the BV of the second ISC block is greater than or equal to the width of the block to be decoded;
[0266] 6. The absolute value of the ordinate of the BV of the second ISC block is greater than or equal to the height of the block to be decoded.
[0267] It should be understood that the second preset threshold, the second preset length, the second preset width, and the second preset height can be set according to the actual situation, and this application does not limit this.
[0268] Figure 10 This is a flowchart of another method for generating a historical copy information list provided by an embodiment of this application. As Figure 10 shown, the execution subject of this method can be the following devices, but is not limited thereto: a decoder, or a device for performing block vector decoding, such as a desktop computer, a mobile computing device, a notebook (e.g., laptop) computer, a tablet computer, a set-top box, a handheld device such as a smart phone, a TV, a camera, a display device, a digital media player, a video game console, an in-vehicle computer, or the like. As Figure 10 shown, this method includes the following steps:
[0269] S1010: If the decoding of the second IBC block is completed, write the information of the second IBC block into the historical copy information list. Or, if the decoding of the second IBC block is completed and the second IBC meets the fifth preset condition, write the information of the second IBC block into the historical copy information list.
[0270] S1020: If the decoding of the second string in the second ISC block is completed, write the information of the second string into the historical copy information list. Or, if the decoding of the second string is completed and the second string meets the seventh preset condition, write the information of the second string into the historical copy information list. Or, if the decoding of the second string is completed and the second ISC block meets the sixth preset condition, write the information of the second string into the historical copy information list.
[0271] It should be understood that the second IBC block is any reconstructed IBC block, and the second ISC block is any reconstructed ISC block. The information of the second IBC block includes the BV of the second IBC block. The information of the second string includes the SV of the second string.
[0272] Optionally, the information of the second IBC block further includes at least one of the following: the size information of the second IBC block, the location information, the prediction mode, the repetition times of the BV of the second IBC block. The information of the second string further includes at least one of the following: the size information of the second string, the location information, the prediction mode, the repetition times of the SV of the second string.
[0273] It should be understood that for the fifth preset condition and the sixth preset condition, reference can be made to Figure 9 the corresponding embodiments, and the present application will not elaborate on this.
[0274] Optionally, the seventh preset condition includes any one of the following, but is not limited thereto:
[0275] 1. The length of the second string is greater than the third preset length.
[0276] 2. The second string is the first string in the second ISC block.
[0277] 3. The second string is the last string in the second ISC block.
[0278] It should be understood that the third preset length can be set according to the actual situation, and the present application does not limit this.
[0279] It should be noted that Figure 9 compared with the corresponding embodiments and Figure 10 the differences in the corresponding embodiments are that in Figure 9In the corresponding embodiment, when the decoding end finishes decoding the second ISC block, the information of at least one string of the second ISC block is written into the historical copy information list. Alternatively, if the decoding of the second ISC block is completed and the second ISC meets the sixth preset condition, the information of at least one string of the second ISC block is written into the historical copy information list. And in Figure 10 In the corresponding embodiment, when the decoding end finishes encoding any string in the second ISC block, the information of the string is written into the historical copy information list. Alternatively, when the string or the second ISC block meets the corresponding preset condition, the information of the string is written into the historical copy information list.
[0280] It should be noted that in the embodiments of the present application, the block to be encoded corresponds to the block to be encoded at the encoding end above, and the second IBC block corresponds to the first IBC block, that is, the second IBC block is the image block reconstructed by the decoding end for the first IBC block. The second ISC string corresponds to the first ISC string, that is, the second ISC string is the string reconstructed by the decoding end for the first ISC string.
[0281] In summary, in the present application, since the bitstream does not carry the residual information of the BVP and BV of the encoded block corresponding to the block to be decoded, for the decoding end, it can make BVP equal to BV. Based on this, it is crucial to improve the accuracy of BVP. Based on this, when generating the historical copy information list, the decoding end can write the information of the IBC block or string that meets the corresponding preset condition into the historical copy information list, so as to filter out some invalid BV or SV in the historical copy information list, thereby improving the accuracy of BVP.
[0282] Embodiment 7
[0283] In the present application, both the encoding end and the decoding end can default to adopt the above first block vector prediction mode or the second block vector prediction mode. Of course, they can also not default to adopt the above first block vector prediction mode or the second block vector prediction mode, but determine whether to adopt the above first block vector prediction mode or the second block vector prediction mode through a display indication method. The following will describe this display indication method:
[0284] Optionally, the bitstream parsed by the decoding end includes: a first identifier or a second identifier. The first identifier is used to identify the adoption of the first block vector prediction mode for the block to be encoded. The second identifier is used to identify the adoption of the second block vector prediction mode for the block to be encoded. If the bitstream includes: the first identifier. Then the decoding end determines the BV of the block to be decoded according to the first block vector prediction mode and BVP, that is, makes BV = BVP. If the bitstream includes: the second identifier. Then the decoding end determines the BV of the block to be decoded according to the second block vector prediction mode and BVP, that is, makes BV = BVP.
[0285] Optionally, if the bitstream includes a first identifier, decoding of the preset identifier ctp_zero_flag is skipped, where the preset identifier is used to indicate whether the residual information of the block to be encoded and the reference block is both 0.
[0286] It should be understood that the bitstream parsed by the decoding end may also include: a fourth identifier, or a fifth identifier, or a fourth identifier and a fifth identifier, where the fourth identifier is used to indicate that the first block vector prediction mode is not used for the encoded block. The fifth identifier is used to indicate that the second block vector prediction mode is not used for the encoded block.
[0287] Optionally, if the bitstream parsed by the decoding end includes: a fourth identifier, or a fifth identifier, or a fourth identifier and a fifth identifier, then the bitstream parsed by the decoding end may include: the residual information of the BVP and BV of the encoded block.
[0288] Optionally, if the bitstream parsed by the decoding end includes: a fourth identifier, or a fifth identifier, or a fourth identifier and a fifth identifier, in this case, the decoding end defaults to using the third block vector prediction mode.
[0289] Optionally, the bitstream parsed by the decoding end may include both a first identifier and a fifth identifier, and in this case, the first block vector prediction mode is used for the block to be decoded. Or the bitstream parsed by the decoding end may include both a second identifier and a fourth identifier, and in this case, the second block vector prediction mode is used for the block to be decoded.
[0290] Optionally, if the bitstream includes a first identifier, the decoding end selects a context model according to the prediction mode of the adjacent reference block of the block to be decoded to decode the first identifier. If the bitstream includes a second identifier, the decoding end selects a context model according to the prediction mode of the adjacent reference block of the block to be decoded to decode the second identifier.
[0291] Exemplarily, the decoding end selects a context model according to whether the adjacent reference block of the block to be decoded is in the first block vector prediction mode; if so, context model A is selected, if not, context model B is selected. Or, the decoding end selects a context model according to whether the adjacent reference block of the block to be decoded is in the second block vector prediction mode; if so, context model A is selected, if not, context model B is selected. Or, the decoding end selects a context model according to whether the adjacent reference block of the block to be decoded is in the third block vector prediction mode; if so, context model A is selected, if not, context model B is selected. Or, the decoding end selects a context model according to whether the adjacent reference block of the block to be decoded is in the ISC prediction mode; if so, context model A is selected, if not, context model B is selected. Or, the decoding end selects a context model according to whether the adjacent reference block of the block to be decoded is in the SKIP prediction mode; if so, context model A is selected, if not, context model B is selected.
[0292] Optionally, the above bitstream may not carry at least one of the above first identifier, second identifier, fourth identifier, and fifth identifier. Instead, the decoding end determines whether to use the first block vector prediction mode, the second block vector prediction mode, or the third block vector prediction mode to parse the bitstream according to the length of the candidate displacement vector list.
[0293] Exemplarily, if the length of the candidate displacement vector list is greater than the fourth preset length, the decoding end uses the first block vector prediction mode or the second block vector prediction mode to parse the bitstream; if the length of the candidate displacement vector list is less than or equal to the fourth preset length, the decoding end uses the third block vector prediction mode to parse the bitstream.
[0294] In summary, in this application, the decoding end can default to using the above first block vector prediction mode or the second block vector prediction mode, or can determine whether to use the above first block vector prediction mode or the second block vector prediction mode through a display indication method, and can also determine the block vector prediction mode according to the length of the candidate displacement vector list, thereby improving the decoding flexibility. Further, when decoding the first identifier or the second identifier, the decoding end can select the corresponding context model to further improve the decoding flexibility.
[0295] Embodiment 8
[0296] As described above, since the bitstream does not carry the BVP and the residual information of the BV of the coded block corresponding to the block to be decoded, in order to improve the accuracy of the BVP, the decoding end can adaptively adjust the BVP as follows:
[0297] Optionally, the bitstream parsed by the decoding end includes: a third identifier, and the third identifier is used to identify whether the BVP needs to be adjusted. Correspondingly, if the third identifier is used to identify that the BVP needs to be adjusted, the bitstream further includes: an index of the adjustment amount corresponding to the BVP.
[0298] Optionally, the adjustment amount includes: the adjustment amount bvd_distance in distance and the adjustment amounts bvd_sign_x and bvd_sign_y in direction. Among them, the encoding end stores a distance adjustment amount list bvd_distance_list and a direction adjustment amount list bvd_sign_list. The following uses examples to illustrate these two tables:
[0299] Exemplarily, the bvd_distance_list is shown in Table 1:
[0300] Table 1
[0301] bvd_distance_index bvd_distance 0 4 1 8 2 16 3 32
[0302] Exemplarily, the bvd_sign_list is shown in Table 2:
[0303] Table 2
[0304] bvd_sign_idx bvd_sign_x bvd_sign_y 0 +1 0 1 -1 0 2 0 +1 3 0 -1
[0305] Assume that the BVP coordinates of the block to be encoded are (bvp_x, bvp_y), and the BVP can be adjusted based on the following formula.
[0306] bv_x = bvp_x + bvd_distance * bvd_sign_x.
[0307] bv_y = bvp_y + bvd_distance * bvd_sign_y.
[0308] In summary, in the present application, the bitstream parsed by the decoding end includes: a third identifier to identify whether the BVP needs to be adjusted. Correspondingly, if the third identifier is used to indicate that the BVP needs to be adjusted, the bitstream further includes: an index of the adjustment amount corresponding to the BVP. Thus, the decoding end can adjust the BVP according to the index, thereby improving the accuracy of the BVP.
[0309] Embodiment 9
[0310] Figure 11 is a schematic diagram of an encoding device provided by an embodiment of the present application, as Figure 11 shown, the device includes:
[0311] A generation module 1110, configured to generate a historical copy information list.
[0312] A first determination module 1120, configured to determine a candidate displacement vector list according to the historical copy information list;
[0313] A second determination module 1130, configured to determine the BVP of the block to be encoded according to the candidate displacement vector list;
[0314] An encoding module 1140, configured to encode the block to be encoded to obtain an output bitstream.
[0315] Wherein, the bitstream includes the index of the BVP in the candidate displacement vector list, and the bitstream does not include the residual information of the BVP and the BV of the block to be encoded.
[0316] Optionally, the generating module 1110 is specifically configured to: if the encoding of the in-frame block copy (IBC) block in the first frame is completed, write the information of the first IBC block into the historical copy information list; or, if the encoding of the first IBC block is completed and the first IBC meets the first preset condition, write the information of the first IBC block into the historical copy information list. If the encoding of the in-frame string copy (ISC) block in the first frame is completed, write the information of at least one string of the first ISC block into the historical copy information list; or, if the encoding of the first ISC block is completed and the first ISC meets the second preset condition, write the information of at least one string of the first ISC block into the historical copy information list. Wherein, the first IBC block is any encoded IBC block, and the first ISC block is any encoded ISC block. The information of the first IBC block includes the BV of the first IBC block. For any one of the at least one string of the first ISC block, the information of the string includes the string vector (SV) of the string.
[0317] Optionally, the information of the first IBC block further includes at least one of the following: the size information of the first IBC block, the position information, the prediction mode, and the repetition times of the BV of the first IBC block. For any one of the at least one string of the first ISC block, the information of the string further includes at least one of the following: the size information of the string, the position information, the prediction mode, and the repetition times of the SV of the string.
[0318] Optionally, the generating module 1110 is specifically configured to: if the encoding of the first IBC block is completed, write the information of the first IBC block into the historical copy information list; or, if the encoding of the first IBC block is completed and the first IBC meets the first preset condition, write the information of the first IBC block into the historical copy information list. If the encoding of the first string in the first ISC block is completed, write the information of the first string into the historical copy information list; or, if the encoding of the first string is completed and the first string meets the third preset condition, write the information of the first string into the historical copy information list; or, if the encoding of the first string is completed and the first ISC block meets the second preset condition, write the information of the first string into the historical copy information list. Wherein, the first IBC block is any encoded IBC block, and the first ISC block is any encoded ISC block. The information of the first IBC block includes the BV of the first IBC block. The information of the first string includes the SV of the first string.
[0319] Optionally, the information of the first IBC block further includes at least one of the following: the size information of the first IBC block, the position information, the prediction mode, and the repetition times of the BV of the first IBC block. The information of the first string further includes at least one of the following: the size information of the first string, the position information, the prediction mode, and the repetition times of the SV of the first string.
[0320] Optionally, the first preset condition includes at least one of the following:
[0321] The size of the first IBC block is greater than or equal to a first preset threshold;
[0322] The width of the first IBC block is greater than or equal to a first preset width;
[0323] The height of the first IBC block is greater than or equal to a first preset height;
[0324] The absolute value of the abscissa of the BV of the first IBC block is greater than or equal to the width of the block to be encoded;
[0325] The absolute value of the ordinate of the BV of the first IBC block is greater than or equal to the height of the block to be encoded.
[0326] Optionally, at least one string of the first ISC block is any of the following:
[0327] All strings in the first ISC block.
[0328] Strings in the first ISC block with a length greater than a first preset length.
[0329] The longest string in the first ISC block.
[0330] The first string in the first ISC block.
[0331] The last string in the first ISC block.
[0332] Optionally, the second preset condition includes at least one of the following:
[0333] The size of the first ISC block is greater than or equal to a second preset threshold;
[0334] The length of the longest string in the first ISC block is greater than or equal to a second preset length;
[0335] The width of the first ISC block is greater than or equal to a second preset width;
[0336] The height of the first ISC block is greater than or equal to a second preset height;
[0337] The absolute value of the abscissa of the BV of the first ISC block is greater than or equal to the width of the block to be encoded;
[0338] The absolute value of the ordinate of the BV of the first ISC block is greater than or equal to the height of the block to be encoded.
[0339] Optionally, the third preset condition includes any of the following:
[0340] The length of the first string is greater than a third preset length.
[0341] The first string is the first string in the first ISC block.
[0342] The first string is the last string in the first ISC block.
[0343] Optionally, the first determination module 1120 is specifically configured to: determine at least one first displacement vector in the historical replication information list, where the first displacement vector satisfies a fourth preset condition; and determine a candidate displacement vector list according to the at least one first displacement vector.
[0344] Optionally, the size of the IBC block or string corresponding to the first displacement vector is greater than a third preset threshold.
[0345] Optionally, the bitstream further includes: a first identifier or a second identifier. The first identifier is used to identify that the block to be encoded adopts a first block vector prediction mode, where the first block vector prediction mode is a prediction mode that does not encode the residual information of the BVP and the BV of the block to be encoded, and encodes the residual information of the block to be encoded and the reference block. The second identifier is used to identify that the block to be encoded adopts a second block vector prediction mode, where the second block vector prediction mode is a prediction mode that does not encode the residual information of the BVP and the BV of the block to be encoded, and does not encode the residual information of the block to be encoded and the reference block.
[0346] Optionally, the encoding module 1140 is further configured to: if the bitstream includes the first identifier, skip encoding the preset identifier; where the preset identifier is used to identify whether the residual information of the block to be encoded and the reference block are both 0.
[0347] Optionally, the encoding module 1140 is specifically configured to: if the bitstream includes the first identifier, select a context model according to the prediction mode of the adjacent reference block of the block to be encoded to encode the first identifier; if the bitstream includes the second identifier, select a context model according to the prediction mode of the adjacent reference block of the block to be encoded to encode the second identifier.
[0348] Optionally, the encoding module 1140 is specifically configured to: if the length of the candidate displacement vector list is greater than a fourth preset length, encode the block to be encoded using the first block vector prediction mode or the second block vector prediction mode; where the first block vector prediction mode is a prediction mode that does not encode the residual information of the BVP and the BV of the block to be encoded, and encodes the residual information of the block to be encoded and the reference block; the second block vector prediction mode is a prediction mode that does not encode the residual information of the BVP and the BV of the block to be encoded, and does not encode the residual information of the block to be encoded and the reference block.
[0349] Optionally, the bitstream further includes: a third identifier, where the third identifier is used to identify whether it is necessary to adjust the BVP. Correspondingly, if the third identifier is used to identify that it is necessary to adjust the BVP, the bitstream further includes: an index of the adjustment amount corresponding to the BVP.
[0350] It should be understood that the device embodiments and the method embodiments can correspond to each other, and similar descriptions can refer to the method embodiments. To avoid repetition, they will not be elaborated here. Specifically, Figure 11 The encoding device shown can execute the corresponding method embodiment of the encoding end, and the foregoing and other operations and / or functions of each module in the encoding device respectively implement the corresponding processes of the corresponding method embodiment of the encoding end. For the sake of brevity, they will not be elaborated here.
[0351] The encoding device of the embodiment of the present application has been described above from the perspective of functional modules in combination with the drawings. It should be understood that the functional modules can be implemented in the form of hardware, or in the form of instructions in software, or in a combination of hardware and software modules. Specifically, each step of the method embodiment in the embodiment of the present application can be completed by the integrated logic circuit in the hardware in the processor and / or instructions in the form of software. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by the combination of the hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps in the above method embodiment.
[0352] Embodiment 10
[0353] Figure 12 is a schematic diagram of a decoding device provided by an embodiment of the present application. As Figure 12 shown, the device includes:
[0354] A generation module 1210, configured to generate a historical copy information list.
[0355] A first determination module 1220, configured to determine a candidate displacement vector list according to the historical copy information list;
[0356] An acquisition module 1230, configured to acquire an encoded bitstream.
[0357] An analysis module 1240, configured to analyze the bitstream to obtain the index of the BVP of the encoded block corresponding to the block to be decoded in the candidate displacement vector list;
[0358] A second determination module 1250, configured to determine the BVP according to the index and the candidate displacement vector list;
[0359] A third determination module 1260, configured to determine the BV of the block to be decoded according to the BVP;
[0360] Wherein, the bitstream includes an index, and the bitstream does not include the residual information of the BVP and the BV of the encoded block.
[0361] Optionally, the generating module 1210 is specifically configured to: if the decoding of the second IBC block is completed, write the information of the second IBC block into the historical copy information list; or, if the decoding of the second IBC block is completed and the second IBC meets the fifth preset condition, write the information of the second IBC block into the historical copy information list. If the decoding of the second ISC block is completed, write the information of at least one string of the second ISC block into the historical copy information list; or, if the decoding of the second ISC block is completed and the second ISC meets the sixth preset condition, write the information of at least one string of the second ISC block into the historical copy information list. Wherein, the second IBC block is any reconstructed IBC block, and the second ISC block is any reconstructed ISC block. The information of the second IBC block includes the BV of the second IBC block. For any one of the at least one string of the second ISC block, the information of the string includes the SV of the string.
[0362] Optionally, the information of the second IBC block further includes at least one of the following: the size information of the second IBC block, the position information, the prediction mode, and the repetition times of the BV of the second IBC block. For any one of the at least one string of the second ISC block, the information of the string further includes at least one of the following: the size information of the string, the position information, the prediction mode, and the repetition times of the SV of the string.
[0363] Optionally, the generating module 1210 is specifically configured to: if the decoding of the second IBC block is completed, write the information of the second IBC block into the historical copy information list; or, if the decoding of the second IBC block is completed and the second IBC meets the fifth preset condition, write the information of the second IBC block into the historical copy information list. If the decoding of the second string in the second ISC block is completed, write the information of the second string into the historical copy information list; or, if the decoding of the second string is completed and the second string meets the seventh preset condition, write the information of the second string into the historical copy information list; or, if the decoding of the second string is completed and the second ISC block meets the sixth preset condition, write the information of the second string into the historical copy information list. Wherein, the second IBC block is any reconstructed IBC block, and the second ISC block is any reconstructed ISC block. The information of the second IBC block includes the BV of the second IBC block. The information of the second string includes the SV of the second string.
[0364] Optionally, the information of the second IBC block further includes at least one of the following: the size information of the second IBC block, the position information, the prediction mode, and the repetition times of the BV of the second IBC block. The information of the second string further includes at least one of the following: the size information of the second string, the position information, the prediction mode, and the repetition times of the SV of the second string.
[0365] Optionally, the fifth preset condition includes at least one of the following:
[0366] The size of the second IBC block is greater than or equal to a first preset threshold;
[0367] The width of the second IBC block is greater than or equal to a first preset width;
[0368] The height of the second IBC block is greater than or equal to a first preset height;
[0369] The absolute value of the abscissa of the BV of the second IBC block is greater than or equal to the width of the block to be decoded;
[0370] The absolute value of the ordinate of the BV of the second IBC block is greater than or equal to the height of the block to be decoded.
[0371] Optionally, at least one string of the second ISC block is any one of the following:
[0372] All strings in the second ISC block.
[0373] Strings in the second ISC block with a length greater than a first preset length.
[0374] The longest string in the second ISC block.
[0375] The first string in the second ISC block.
[0376] The last string in the second ISC block.
[0377] Optionally, the sixth preset condition includes at least one of the following:
[0378] The size of the second ISC block is greater than or equal to a second preset threshold;
[0379] The length of the longest string in the second ISC block is greater than or equal to a second preset length;
[0380] The width of the second ISC block is greater than or equal to a second preset width;
[0381] The height of the second ISC block is greater than or equal to a second preset height;
[0382] The absolute value of the abscissa of the BV of the second ISC block is greater than or equal to the width of the block to be decoded;
[0383] The absolute value of the ordinate of the BV of the second ISC block is greater than or equal to the height of the block to be decoded.
[0384] Optionally, the seventh preset condition includes any one of the following:
[0385] The length of the second string is greater than a third preset length.
[0386] The second string is the first string in the second ISC block.
[0387] The second string is the last string in the second ISC block.
[0388] Optionally, the first determination module 1220 is specifically configured to: determine at least one first displacement vector in the historical replication information list, where the first displacement vector satisfies a fourth preset condition; and determine a candidate displacement vector list according to the at least one first displacement vector.
[0389] Optionally, the size of the IBC block or string corresponding to the first displacement vector is greater than a third preset threshold.
[0390] Optionally, the bitstream further includes: a first identifier or a second identifier. The first identifier is used to identify that the first block vector prediction mode is adopted for the coding block, and the first block vector prediction mode is a prediction mode in which the residual information of the BVP and the BV of the coding block is not encoded, and the residual information of the coding block and the reference block is encoded. The second identifier is used to identify that the second block vector prediction mode is adopted for the coding block, and the second block vector prediction mode is a prediction mode in which the residual information of the BVP and the BV of the coding block is not encoded, and the residual information of the coding block and the reference block is not encoded.
[0391] Optionally, the parsing module 1240 is further configured to: if the bitstream includes the first identifier, skip decoding of a preset identifier; where the preset identifier is used to identify whether the residual information of the coding block and the reference block is both 0.
[0392] Optionally, the parsing module 1240 is specifically configured to: select a context model according to the prediction mode of the adjacent reference block of the block to be decoded to decode the first identifier; or select a context model according to the prediction mode of the adjacent reference block of the block to be decoded to decode the second identifier.
[0393] Optionally, the parsing module 1240 is specifically configured to: if the length of the candidate displacement vector list is greater than a fourth preset length, parse the bitstream using the first block vector prediction mode or the second block vector prediction mode; where the first block vector prediction mode is a prediction mode in which the residual information of the BVP and the BV of the coding block is not encoded, and the residual information of the coding block and the reference block is encoded; and the second block vector prediction mode is a prediction mode in which the residual information of the BVP and the BV of the coding block is not encoded, and the residual information of the coding block and the reference block is not encoded.
[0394] Optionally, the bitstream further includes: a third identifier, and the third identifier is used to identify whether it is necessary to adjust the BVP. Correspondingly, if the third identifier is used to identify that it is necessary to adjust the BVP, the bitstream further includes: an index of the adjustment amount corresponding to the BVP.
[0395] Optionally, the decoding device further includes: an adjustment module 1270, configured to adjust the BVP according to the index of the adjustment amount corresponding to the BVP.
[0396] It should be understood that the device embodiments and the method embodiments can correspond to each other, and similar descriptions can refer to the method embodiments. To avoid repetition, they will not be elaborated here. Specifically, Figure 12 The decoding device shown can execute the corresponding method embodiments at the decoding end, and the foregoing and other operations and / or functions of each module in the decoding device respectively implement the corresponding processes of the corresponding method embodiments at the decoding end. For the sake of brevity, they will not be elaborated here.
[0397] The decoding device of the embodiments of the present application has been described above from the perspective of functional modules in conjunction with the drawings. It should be understood that the functional modules can be implemented in the form of hardware, or in the form of instructions in software, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in the embodiments of the present application can be completed by the integrated logic circuit in the hardware in the processor and / or instructions in software form. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by the combination of the hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the art such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps in the above method embodiments.
[0398] The present application also provides an encoding device, which can be used to execute the corresponding method embodiments at the encoding end. The device can be an encoder, or a device for performing string vector encoding, such as a desktop computer, a mobile computing device, a notebook (e.g., laptop) computer, a tablet computer, a set-top box, a smart phone and other handheld devices, a television, a camera, a display device, a digital media player, a video game console, an in-vehicle computer, or other string vector encoding devices such as the like. If it is a device for performing string vector encoding, the device can include an encoder, a display, and a memory, etc. The encoder is mainly used to execute the corresponding method embodiments at the encoding end.
[0399] The present application also provides a decoding device, which can be used to execute the corresponding method embodiments at the decoding end. The device can be a decoder, or a device for performing string vector decoding, such as a desktop computer, a mobile computing device, a notebook (e.g., laptop) computer, a tablet computer, a set-top box, a smart phone and other handheld devices, a television, a camera, a display device, a digital media player, a video game console, an in-vehicle computer, or other string vector decoding devices such as the like. If it is a device for performing string vector decoding, the device can include a decoder, a display, and a memory, etc. The decoder is mainly used to execute the corresponding method embodiments at the decoding end.
[0400] In some embodiments of the present application, the memory includes, but is not limited to:
[0401] A volatile memory and / or a non-volatile memory. Among them, the non-volatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash memory. The volatile memory can be a Random Access Memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double DataRate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), synch link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0402] In some embodiments of the present application, the computer program can be divided into one or more modules, and the one or more modules are stored in the memory and executed by the processor to complete the method provided by the present application. The one or more modules can be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the image processing device.
[0403] The present application also provides a computer storage medium, on which a computer program is stored, and when the computer program is executed by the computer, the computer can execute the method of the above method embodiments. Or, the embodiments of the present application also provide a computer program product containing instructions, and when the instructions are executed by the computer, the computer executes the method of the above method embodiments.
[0404] When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or a wireless manner (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a digital video disc (DVD)), or a semiconductor medium (such as a solid state disk (SSD)), etc.
[0405] Those of ordinary skill in the art can realize that the modules and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0406] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there can be other division methods. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or modules can be in an electrical, mechanical, or other form.
[0407] The modules described as separate components may or may not be physically separated. The components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network elements. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. For example, in each embodiment of this application, each functional module can be integrated into one processing module, or each module can exist physically alone, or two or more modules can be integrated into one module.
[0408] The above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed in this application can easily think of changes or substitutions, which should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims
1. A method for encoding block vectors, characterized in that Comprising: Generating a historical copy information list, including: writing information of an intra block copy IBC block or a string that meets corresponding preset conditions into the historical copy information list to filter out invalid block vectors BV or string vectors SV in the historical copy information list; Determining a candidate displacement vector list according to the historical copy information list; Determining a predicted block vector BVP of a block to be encoded according to the candidate displacement vector list; Encoding the block to be encoded to obtain an output bitstream; Wherein, the bitstream includes an index of the BVP in the candidate displacement vector list, and the bitstream does not include residual information of the BVP and the block vector BV of the block to be encoded; The bitstream further includes a first identifier or a second identifier; wherein, the first identifier is used to identify that a first block vector prediction mode is adopted for the block to be encoded, and the first block vector prediction mode is a prediction mode that does not encode the residual information of the BVP and the BV of the block to be encoded, but encodes the residual information of the block to be encoded and a reference block; the second identifier is used to identify that a second block vector prediction mode is adopted for the block to be encoded, and the second block vector prediction mode is a prediction mode that does not encode the residual information of the BVP and the BV of the block to be encoded, and does not encode the residual information of the block to be encoded and a reference block; The bitstream further includes a third identifier, and the third identifier is used to identify whether the BVP needs to be adjusted; if the third identifier is used to identify that the BVP needs to be adjusted, the bitstream further includes: an index of an adjustment amount corresponding to the BVP, so as to adjust the BVP according to the index of the adjustment amount corresponding to the BVP during decoding.
2. The method according to claim 1, wherein The generating the historical copy information list includes: If the encoding of the first intra block copy IBC block is completed, writing the information of the first IBC block into the historical copy information list, or, if the encoding of the first IBC block is completed and the first IBC meets a first preset condition, writing the information of the first IBC block into the historical copy information list; If the encoding of the first intra string copy ISC block is completed, writing the information of at least one string of the first ISC block into the historical copy information list, or, if the encoding of the first ISC block is completed and the first ISC meets a second preset condition, writing the information of at least one string of the first ISC block into the historical copy information list; Wherein, the first IBC block is any encoded IBC block, and the first ISC block is any encoded ISC block; The information of the first IBC block includes the BV of the first IBC block; for any one of at least one string of the first ISC block, the information of the string includes the string vector SV of the string.
3. The method according to claim 2, wherein The information of the first IBC block further includes at least one of the following: size information, position information, prediction mode, and the repetition times of the BV of the first IBC block; For any one of the at least one string in the first ISC block, the information of the string further includes at least one of the following: the size information of the string, the position information, the prediction mode, and the number of repetitions of the SV of the string.
4. The method according to claim 1, wherein The generating the historical copy information list includes: If the encoding of the first IBC block is completed, write the information of the first IBC block into the historical copy information list, or if the encoding of the first IBC block is completed and the first IBC meets the first preset condition, write the information of the first IBC block into the historical copy information list; If the encoding of the first string in the first ISC block is completed, write the information of the first string into the historical copy information list, or if the encoding of the first string is completed and the first string meets the third preset condition, write the information of the first string into the historical copy information list, or if the encoding of the first string is completed and the first ISC block meets the second preset condition, write the information of the first string into the historical copy information list; Wherein, the first IBC block is any one of the encoded IBC blocks, and the first ISC block is any one of the encoded ISC blocks; The information of the first IBC block includes the BV of the first IBC block; the information of the first string includes the SV of the first string.
5. The method according to claim 4, wherein, The information of the first IBC block further includes at least one of the following: the size information of the first IBC block, the position information, the prediction mode, and the number of repetitions of the BV of the first IBC block; The information of the first string further includes at least one of the following: the size information of the first string, the position information, the prediction mode, and the number of repetitions of the SV of the first string.
6. The method according to any one of claims 2-5, characterized in that, The first preset condition includes at least one of the following: The size of the first IBC block is greater than or equal to a first preset threshold; The width of the first IBC block is greater than or equal to a first preset width; The height of the first IBC block is greater than or equal to a first preset height; The absolute value of the abscissa of the BV of the first IBC block is greater than or equal to the width of the block to be encoded; The absolute value of the ordinate of the BV of the first IBC block is greater than or equal to the height of the block to be encoded.
7. The method according to claim 2 or 3, characterized in that, At least one string of the first ISC block is any one of the following: All strings in the first ISC block; Strings in the first ISC block with a length greater than a first preset length; The longest string in the first ISC block; The first string in the first ISC block; The last string in the first ISC block.
8. The method according to any one of claims 2-5, characterized in that The second preset condition includes at least one of the following: The size of the first ISC block is greater than or equal to a second preset threshold; The length of the longest string in the first ISC block is greater than or equal to a second preset length; The width of the first ISC block is greater than or equal to a second preset width; The height of the first ISC block is greater than or equal to a second preset height; The absolute value of the abscissa of the BV of the first ISC block is greater than or equal to the width of the block to be encoded; The absolute value of the ordinate of the BV of the first ISC block is greater than or equal to the height of the block to be encoded.
9. The method according to claim 4 or 5, characterized in that, The third preset condition includes any one of the following: The length of the first string is greater than the third preset length; The first string is the first string in the first ISC block; The first string is the last string in the first ISC block.
10. The method according to any one of claims 1 to 5, characterized in that, Determining the candidate displacement vector list according to the historical copy information list includes: Determining at least one first displacement vector in the historical copy information list, where the first displacement vector satisfies the fourth preset condition; Determining the candidate displacement vector list according to the at least one first displacement vector.
11. The method according to claim 10, wherein The size of the IBC block or string corresponding to the first displacement vector is greater than the third preset threshold.
12. The method according to claim 1, wherein It further includes: If the bitstream includes the first identifier, skip encoding the preset identifier; Wherein, the preset identifier is used to identify whether the residual information of the block to be encoded and the reference block is both 0.
13. The method according to claim 1, characterized in that, Encoding the block to be encoded includes: If the bitstream includes the first identifier, select a context model according to the prediction mode of the adjacent reference block of the block to be encoded to encode the first identifier; If the bitstream includes the second identifier, select a context model according to the prediction mode of the adjacent reference block of the block to be encoded to encode the second identifier.
14. The method according to any one of claims 1-5, characterized in that, Encoding the block to be encoded to obtain a bitstream includes: If the length of the candidate displacement vector list is greater than the fourth preset length, encode the block to be encoded using the first block vector prediction mode or the second block vector prediction mode; Wherein, the first block vector prediction mode is a prediction mode that does not encode the residual information of the BVP and the BV of the block to be encoded, and encodes the residual information of the block to be encoded and the reference block; the second block vector prediction mode is a prediction mode that does not encode the residual information of the BVP and the BV of the block to be encoded, and does not encode the residual information of the block to be encoded and the reference block.
15. A method for decoding a block vector, characterized in that, It includes: Generating a historical copy information list, including: writing the information of the intra-block copy IBC block or string that meets the corresponding preset condition into the historical copy information list to filter out the invalid block vector BV or string vector SV in the historical copy information list; Determining the candidate displacement vector list according to the historical copy information list; Obtaining an encoded bitstream; Parsing the bitstream to obtain the index of the BVP of the encoded block corresponding to the block to be decoded in the candidate displacement vector list; Determining the BVP according to the index and the candidate displacement vector list; Determining the BV of the block to be decoded according to the BVP; Wherein, the bitstream includes the index, and the bitstream does not include the residual information of the BVP and the BV of the encoded block; The bitstream further includes a first identifier or a second identifier; wherein, the first identifier is used to identify that a first block vector prediction mode is adopted for the block to be encoded, and the first block vector prediction mode is a prediction mode that does not encode the residual information of the BVP and the BV of the block to be encoded, and encodes the residual information of the block to be encoded and the reference block; the second identifier is used to identify that a second block vector prediction mode is adopted for the block to be encoded, and the second block vector prediction mode is a prediction mode that does not encode the residual information of the BVP and the BV of the block to be encoded, and does not encode the residual information of the block to be encoded and the reference block; The bitstream further includes a third identifier, and the third identifier is used to identify whether the BVP needs to be adjusted; if the third identifier is used to identify that the BVP needs to be adjusted, the bitstream further includes: an index of the adjustment amount corresponding to the BVP, so as to adjust the BVP according to the index of the adjustment amount corresponding to the BVP during decoding.
16. The method according to claim 15, characterized in that The generating the historical copy information list includes: If the decoding of the second IBC block is completed, write the information of the second IBC block into the historical copy information list, or, if the decoding of the second IBC block is completed and the second IBC meets the fifth preset condition, write the information of the second IBC block into the historical copy information list; If the decoding of the second ISC block is completed, write the information of at least one string of the second ISC block into the historical copy information list, or, if the decoding of the second ISC block is completed and the second ISC meets the sixth preset condition, write the information of at least one string of the second ISC block into the historical copy information list; wherein, the second IBC block is any reconstructed IBC block, and the second ISC block is any reconstructed ISC block; The information of the second IBC block includes the BV of the second IBC block; for any one of at least one string of the second ISC block, the information of the string includes the SV of the string.
17. The method according to claim 16, wherein, The information of the second IBC block further includes at least one of the following: the size information, position information, prediction mode, and the repetition times of the BV of the second IBC block; For any one of at least one string of the second ISC block, the information of the string further includes at least one of the following: the size information, position information, prediction mode, and the repetition times of the SV of the string.
18. The method according to claim 15, wherein The generating the historical copy information list includes: If the decoding of the second IBC block is completed, write the information of the second IBC block into the historical copy information list, or, if the decoding of the second IBC block is completed and the second IBC meets the fifth preset condition, write the information of the second IBC block into the historical copy information list; If the decoding of the second string in the second ISC block is completed, the information of the second string is written into the historical copy information list. Or, if the decoding of the second string is completed and the second string meets the seventh preset condition, the information of the second string is written into the historical copy information list. Or, if the decoding of the second string is completed and the second ISC block meets the sixth preset condition, the information of the second string is written into the historical copy information list; Wherein, the second IBC block is any reconstructed IBC block, and the second ISC block is any reconstructed ISC block; The information of the second IBC block includes the BV of the second IBC block; the information of the second string includes the SV of the second string.
19. The method according to claim 18, wherein The information of the second IBC block further includes at least one of the following: the size information of the second IBC block, the position information, the prediction mode, the repetition times of the BV of the second IBC block; The information of the second string further includes at least one of the following: the size information of the second string, the position information, the prediction mode, the repetition times of the SV of the second string.
20. The method according to any one of claims 16-19, characterized in that, The fifth preset condition includes at least one of the following: The size of the second IBC block is greater than or equal to the first preset threshold; The width of the second IBC block is greater than or equal to the first preset width; The height of the second IBC block is greater than or equal to the first preset height; The absolute value of the abscissa of the BV of the second IBC block is greater than or equal to the width of the block to be decoded; The absolute value of the ordinate of the BV of the second IBC block is greater than or equal to the height of the block to be decoded.
21. The method according to claim 16 or 17, characterized in that At least one string of the second ISC block is any one of the following: All strings in the second ISC block; Strings in the second ISC block with a length greater than the first preset length; The longest string in the second ISC block; The first string in the second ISC block; The last string in the second ISC block.
22. The method according to any one of claims 16 - 19, characterized in that, The sixth preset condition includes at least one of the following: The size of the second ISC block is greater than or equal to the second preset threshold; The length of the longest string in the second ISC block is greater than or equal to the second preset length; The width of the second ISC block is greater than or equal to the second preset width; The height of the second ISC block is greater than or equal to the second preset height; The absolute value of the abscissa of the BV of the second ISC block is greater than or equal to the width of the block to be decoded; The absolute value of the ordinate of the BV of the second ISC block is greater than or equal to the height of the block to be decoded.
23. The method according to claim 18 or 19, characterized in that The seventh preset condition includes any one of the following: The length of the second string is greater than the third preset length; The second string is the first string in the second ISC block; The second string is the last string in the second ISC block.
24. The method according to any one of claims 15 - 19, characterized in that, Determining the candidate displacement vector list according to the historical copy information list includes: Determining at least one first displacement vector in the historical copy information list, and the first displacement vector meets the fourth preset condition; Determining the candidate displacement vector list according to the at least one first displacement vector.
25. The method according to claim 24, wherein The size of the IBC block or string corresponding to the first displacement vector is greater than a third preset threshold.
26. The method according to claim 15, wherein It further includes: If the bitstream includes the first identifier, decoding of a preset identifier is skipped; wherein, the preset identifier is used to identify whether the residual information of the coded block and the reference block is both 0.
27. The method according to claim 15, wherein Said parsing of the bitstream includes: Selecting a context model according to the prediction mode of adjacent reference blocks of the block to be decoded to decode the first identifier; or, Selecting a context model according to the prediction mode of adjacent reference blocks of the block to be decoded to decode the second identifier.
28. The method according to any one of claims 15 - 19, characterized in that, Said parsing of the bitstream includes: If the length of the candidate displacement vector list is greater than a fourth preset length, the bitstream is parsed using a first block vector prediction mode or a second block vector prediction mode; wherein, the first block vector prediction mode is a prediction mode in which the residual information of the BVP and the BV of the coded block is not encoded, and the residual information of the coded block and the reference block is encoded; the second block vector prediction mode is a prediction mode in which the residual information of the BVP and the BV of the coded block is not encoded, and the residual information of the coded block and the reference block is not encoded.
29. A coding device, characterized in that, It includes: A generation module, configured to generate a historical copy information list, including: writing information of an intra-block copy IBC block or string that meets corresponding preset conditions into the historical copy information list to filter out invalid block vectors BV or string vectors SV in the historical copy information list; A first determination module, configured to determine a candidate displacement vector list according to the historical copy information list; A second determination module, configured to determine the BVP of the block to be coded according to the candidate displacement vector list; An encoding module, configured to encode the block to be coded to obtain an output bitstream; wherein, the bitstream includes the index of the BVP in the candidate displacement vector list, and the bitstream does not include the residual information of the BVP and the BV of the block to be coded; The bitstream further includes a first identifier or a second identifier; wherein, the first identifier is used to identify that the first block vector prediction mode is adopted for the block to be coded, and the first block vector prediction mode is a prediction mode in which the residual information of the BVP and the BV of the block to be coded is not encoded, and the residual information of the block to be coded and the reference block is encoded; the second identifier is used to identify that the second block vector prediction mode is adopted for the block to be coded, and the second block vector prediction mode is a prediction mode in which the residual information of the BVP and the BV of the block to be coded is not encoded, and the residual information of the block to be coded and the reference block is not encoded; The bitstream further includes a third identifier, and the third identifier is used to identify whether the BVP needs to be adjusted; if the third identifier is used to identify that the BVP needs to be adjusted, the bitstream further includes: the index of the adjustment amount corresponding to the BVP, so as to adjust the BVP according to the index of the adjustment amount corresponding to the BVP during decoding.
30. A decoding device, characterized in that, It includes: A generation module, configured to generate a list of historical copy information, including: writing information of an intra-block copy IBC block or string that meets corresponding preset conditions into the list of historical copy information, so as to filter out invalid block vectors BV or string vectors SV in the list of historical copy information; A first determination module, configured to determine a list of candidate displacement vectors according to the list of historical copy information; An acquisition module, configured to acquire an encoded bitstream; An analysis module, configured to analyze the bitstream to obtain an index of the BVP of the encoded block corresponding to the block to be decoded in the list of candidate displacement vectors; A second determination module, configured to determine the BVP according to the index and the list of candidate displacement vectors; A third determination module, configured to determine the BV of the block to be decoded according to the BVP; Wherein, the bitstream includes the index, and the bitstream does not include residual information of the BVP and the BV of the encoded block; The bitstream further includes a first identifier or a second identifier; wherein, the first identifier is used to identify that a first block vector prediction mode is adopted for the block to be encoded, and the first block vector prediction mode is a prediction mode that does not encode the residual information of the BVP and the BV of the block to be encoded, and encodes the residual information of the block to be encoded and the reference block; the second identifier is used to identify that a second block vector prediction mode is adopted for the block to be encoded, and the second block vector prediction mode is a prediction mode that does not encode the residual information of the BVP and the BV of the block to be encoded, and does not encode the residual information of the block to be encoded and the reference block; The bitstream further includes a third identifier, and the third identifier is used to identify whether the BVP needs to be adjusted; if the third identifier is used to identify that the BVP needs to be adjusted, the bitstream further includes: an index of the adjustment amount corresponding to the BVP, so as to adjust the BVP according to the index of the adjustment amount corresponding to the BVP during decoding.
31. An encoding device, characterized in that, The encoding device includes an encoder and a memory, and a computer program is stored in the memory. The encoder is configured to execute the method according to any one of claims 1 to 14 by calling the computer program stored in the memory.
32. A decoding device, characterized in that, The decoding device includes a decoder and a memory, and a computer program is stored in the memory. The decoder is configured to execute the method according to any one of claims 15 to 28 by calling the computer program stored in the memory.
33. A computer-readable storage medium, characterized in that, For storing a computer program, which causes a computer to execute the method according to any one of claims 1 to 28.
Citation Information
Patent Citations
Encoding and decoding method, device and equipment
CN112118451A