Image encoding and decoding method and device using restricted general string prediction coding mode

By conditionally encoding the presence flag in the integral compression unit of the restricted universal string prediction coding mode, the problem of low coding efficiency in the prior art is solved, and the bit consumption is reduced and the coding efficiency is improved.

CN115134605BActive Publication Date: 2024-10-01TONGJI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210543875.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-19
Publication Date
2024-10-01
Estimated Expiration
2042-05-19

AI Technical Summary

Technical Problem

When encoding the integral compression unit of the restricted universal string prediction coding mode, the existing technology always encodes the coordinate string existence flag and the unpredictable element string existence flag, resulting in waste of data processing and reduced coding efficiency.

Method used

Using the conditional encoding method, the unpredictable element string existence flag or coordinate string existence flag is first encoded. If it exists, it is further encoded. Otherwise, it is set to the default value, which reduces the number of written bits and thus reduces the bit consumption.

Benefits of technology

It effectively improves the coding efficiency, reduces the bit consumption by 50%, and improves the coding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0003651313680000111
    Figure BDA0003651313680000111
  • Figure BDA0003651313680000181
    Figure BDA0003651313680000181
  • Figure BDA0003651313680000201
    Figure BDA0003651313680000201
Patent Text Reader

Abstract

The present invention discloses an image encoding and decoding method and device using a restricted general string prediction encoding mode, the encoding method: encoding an unpredictable element string existence flag or a coordinate string existence flag, if the value of the unpredictable element string existence flag or the coordinate string existence flag indicates that an unpredictable element string or a coordinate string exists in the current whole compression unit, then encoding the coordinate string existence flag or the unpredictable element string existence flag, otherwise, not encoding the coordinate string existence flag or the unpredictable element string existence flag and setting the value of the coordinate string existence flag or the unpredictable element string existence flag to a default value, the default value indicates that a coordinate string or an unpredictable element string exists in the current whole compression unit. The method of the present invention conditionally encodes the coordinate string existence flag and the unpredictable element string existence flag of the whole compression unit of the restricted general string prediction encoding mode, reduces the number of bits required, improves encoding efficiency, and has great application prospects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image coding and decoding technology, and to a decoding method and device for compressing images and videos using general string prediction, and in particular to a coding and decoding method, device and application thereof for conditionally encoding a coordinate string existence flag and an unpredictable element string existence flag of a whole compression unit in a restricted general string prediction coding mode. Background Art

[0002] As human society enters the era of artificial intelligence, big data, virtual reality, augmented reality, mixed reality, cloud computing, mobile computing, cloud-mobile computing, ultra-high definition (4K) and ultra-ultra-high definition (8K) video image resolution, and 4G / 5G communications, it has become an indispensable technology to perform ultra-high compression ratio and extremely high quality data compression on various data, including big data, image data, image sequence data, i.e. video data, and various new forms of data, such as mixed video (including images, i.e. single-frame video) containing computer-generated content and photoelectric sensor-captured content.

[0003] A data set is a collection of data elements (eg, bytes, bits, pixels, pixel components, spatial sampling points, transform domain coefficients).

[0004] In data compression, the encoder encodes the input data set, also known as the original data set, to generate a compressed data stream; and the decoder decodes the compressed data stream to generate an output data set, also known as a reconstructed data set or a reconstructed data set. Compression in which the input data set and the output data set are exactly the same, that is, lossless, is called lossless compression. Compression in which the input data set and the output data set are not exactly the same, that is, there is distortion, is called lossy compression.

[0005] When encoding or decoding a data set (referred to as encoding and decoding for short), the data elements are usually sorted according to a predetermined rule, that is, a predetermined order, and encoding and decoding are performed in this order.

[0006] When encoding (and correspondingly decoding) a data set arranged in a certain spatial (one-dimensional, two-dimensional, or multi-dimensional) shape (for example: a one-dimensional data queue, a two-dimensional data file, a frame of image, a video sequence, a transform domain, a transform block, multiple transform blocks, a three-dimensional scene, a sequence of continuously changing three-dimensional scenes), especially a two-dimensional or larger data set, the data set is generally divided into a number of subsets with a predetermined shape and / or size (i.e., the number of elements), called whole compression units, and the whole compression units are encoded or decoded one by one in a predetermined order. At any time, the whole compression unit being encoded or decoded is called the current whole compression unit. The data element being encoded or decoded (sometimes also referred to as the element) is called the current encoded data element or the current decoded data element, collectively referred to as the current data element, referred to as the current element. An element consists of N components (usually 1≤N≤5), so the data set and the whole compression unit are also composed of N components. The components of an element are also called component elements.

[0007] For example, the elements of a frame of image, i.e., pixels, are arranged in a rectangular shape with a size (resolution) of 1920 (width) x 1080 (height), and consist of 3 components: G (green) component, B (blue) component, R (red) component or Y (luminance) component, U (Cb chrominance) component, and V (Cr chrominance) component.

[0008] The relationship between the multi-component data set as the encoding object and the sampling rate of each component of the entire compression unit is usually expressed by a sampling format. Data in which N components have the same sampling rate and size (i.e., the number of component sample values) is called full sampling format data. Data in which N components have different sampling rates and sizes, where the sampling rate and size of N1 components, called primary components, are integer multiples of the sampling rates and sizes of the remaining N-N1 components, called secondary components, is called down-sampled format data. The integer multiple is usually 2 times, 4 times, 8 times, 2x2 times, 4x2 times, etc. In the full sampling format data, all components are considered to be primary components and there are no secondary components. In the down-sampled format data, at least one component is a primary component and at least one component is a secondary component. For example, for an array of two-dimensional data elements including computer-generated images containing graphics and text, a sampling format called 4:4:4 (abbreviated as 444) is usually used, that is, the three components of the data set have the same sampling rate and size (i.e., the number of component sample values). For another type of array of two-dimensional data elements, including natural images and videos captured by cameras, a sampling format called 4:2:0 (abbreviated as 420) is usually used, that is, the sampling rate and size of two components called secondary components (D component and E component) of a data set (such as an image or video) with a rectangular shape and 3 components are respectively one-fourth of the other component called primary component (F component), that is, there is a 4:1 downsampling relationship between the primary component and the secondary component. In this case, one D component D[i][j] and one E component E[i][j] correspond to four (2×2) F components F[2i][2j], F[2i+1][2j], F[2i][2j+1], F[2i+1][2j+1]. If the resolution of the F component is 2M×2N (2M component elements horizontally, 2N component elements vertically), that is, the F component of the data set is F={F[m][n]: m=0~2M-1, n=0~2N-1}, then the resolutions of the D component and the E component are both M×N (M component elements horizontally, N component elements vertically), that is, the D component and the E component of the data set are D={D[m][n]: m=0~M-1, n=0~N-1} and E={E[m][n]: m=0~M-1, n=0~N-1}. In cases where a higher quality is also required for the secondary components, a sampling format called 4:2:2 (abbreviated as 422) is often used, that is, the sampling rate and size of the two secondary components (D component and E component) of a data set with a rectangular shape and three components (such as an image or video) are half of the other main component (F component), that is, there is a 2:1 downsampling relationship between the main component and the secondary component.In this case, in one direction (such as horizontal direction) of a data set (such as an image or video), one D component D[i][j] and one E component E[i][j] correspond to two (2×1) F components F[2i][j] and F[2i+1][j]. If the resolution of the F component is 2M×N, that is, the F component of the data set is F={F[m][n]: m=0~2M-1, n=0~N-1}, then the resolutions of the D component and the E component are both M×N, that is, the D component and the E component of the data set are D={D[m][n]: m=0~M-1, n=0~N-1} and E={E[m][n]: m=0~M-1, n=0~N-1}. In images and videos using YUV or YCbCr or YCgCo color formats, the above-mentioned F, D, and E components are usually Y, U, and V components or Y, Cb, Cr components or Y, Cg, and Co components, respectively. In images and videos using RGB color format, the above-mentioned F, D, and E components are usually G, B, and R components or G, R, and B components respectively. When the data is an image or video, the sampling format is often called a chroma format. A chroma format in which each component has the same sampling rate is called a full chroma format. A chroma format in which one component has a downsampling relationship with another component is called a downsampled chroma format.

[0009] In the case where the data set is divided into integer compression units, a predetermined rule for sorting is to sort the integer compression units first and then sort the elements within each integer compression unit.

[0010] An effective means of data compression is universal string prediction, also known as universal string matching. Universal string prediction arranges the elements of a current whole compression unit in a predetermined scanning manner and then divides them into element strings of variable length. For a current element string, referred to as the current string, a reference element string with the same or similar numerical value as the current string is obtained from a set of elements or a subset thereof that have completed a predetermined degree of encoding and decoding, called a reference set. It is also called the reference string or predicted string or matching string of the current string. For a reference string of a current string, it is only necessary to use a number of encoding parameters to record the position and / or shape and / or size and / or dimension of the reference string in the reference set, without having to record the numerical value of each element in the current string one by one, so as to fully represent all elements and their numerical values ​​of the current string, thereby achieving the purpose of data compression.

[0011] For example, if a current string sorted in a predetermined scanning mode can find a corresponding reference string in the reference set, it is only necessary to use two encoding parameters, namely, the positional relationship between the first element of the current string, i.e., the starting element, and the first element of the reference string, i.e., the starting element, and the string length (the number of elements in the string), to record the position and size of the reference string in the reference set, without having to record the value of each element in the current string one by one, so that all elements and their values ​​of the current string can be fully represented. The number of bits consumed by recording the two encoding parameters is often much less than the number of bits consumed by recording the value of each element in the current string one by one, thereby achieving the purpose of data compression.

[0012] In general string prediction, unpredictable elements may also appear for which no reference element can be found in the reference set. The components, main components, and subcomponents of unpredictable elements are respectively called unpredictable components, unpredictable main components, and unpredictable subcomponents.

[0013] Scanning methods commonly used in general string prediction include:

[0014] Horizontal raster scanning: The elements in a whole compression unit are arranged one by one in the horizontal direction. After one row is arranged, the next row is arranged. All the scanning directions within the row are arranged from left to right or all the scanning directions within the row are arranged from right to left.

[0015] or

[0016] Horizontal back-and-forth scanning is also called round-trip scanning or arc scanning: the elements in a whole compression unit are arranged one by one in the horizontal direction, and the next row is arranged after one row is arranged. The intra-row scanning direction of one of any two adjacent rows is arranged from left to right and the intra-row scanning direction of the other row is arranged from right to left. The row arranged from left to right is called the forward row, and the row arranged from right to left is called the reverse row.

[0017] or

[0018] Vertical raster scanning: The elements in a whole compression unit are arranged one by one in the vertical direction, and the next column is arranged after one column is arranged. The scanning direction of all columns is arranged from top to bottom or the scanning direction of all columns is arranged from bottom to top.

[0019] or

[0020] Vertical back and forth scanning is also called round-trip scanning or arc scanning: the elements in a whole compression unit are arranged one by one in the vertical direction, and after arranging one column, the next column is arranged. In any two adjacent columns, the intra-column scanning direction of one column is from top to bottom and the intra-column scanning direction of the other column is from bottom to top. The columns arranged from top to bottom are called forward columns, and the columns arranged from bottom to top are called reverse columns.

[0021] The first element in the string scan, that is, the arrangement, is called the starting element, and the last element in the string scan, that is, the arrangement, is called the ending element. Horizontal raster scanning and horizontal back-and-forth scanning are collectively referred to as horizontal scanning, and vertical raster scanning and vertical back-and-forth scanning are collectively referred to as vertical scanning.

[0022] There is a restricted general string prediction coding mode in general string prediction, which only allows the following three strings in the whole compression unit:

[0023] Coordinate string, the reference element of all current elements on a string is the same element in the reference set, and its position in the reference set is represented by an image coordinate;

[0024] Unpredictable element string, a string consists of one or more unpredictable elements; an unpredictable element is a current element without a reference element, and the encoder writes its value into the compressed data stream in a predetermined manner and transmits it to the decoder;

[0025] Copy the string above, and the reference elements of all current elements in the string are located directly above (in the case of horizontal scanning) or directly to the left (in the case of vertical scanning) of the current element, and the reference elements are all inside the current entire compression unit.

[0026] In the prior art, when encoding an entire compression unit of a restricted general string prediction coding mode, the following two syntax elements with existence flags are always written into the starting part of the entire compression unit code stream, i.e., the header information: 1) a coordinate string existence flag of the general string prediction, indicating whether there is a coordinate string in the entire compression unit of the current restricted general string prediction coding mode; 2) an unpredictable element string existence flag of the general string prediction, indicating whether there is an unpredictable pixel string in the entire compression unit of the current restricted general string prediction coding mode.

[0027] However, in fact, in the whole compression unit of the restricted general string prediction coding mode, the situation where the two existence flags indicate that the two strings do not exist has no practical significance. The prior art still allocates the codewords of the two existence flags for encoding in such a meaningless situation, which wastes the number of bits that should not be consumed and reduces the coding efficiency.

[0028] Therefore, it is of great practical significance to develop a method for conditionally encoding the coordinate string existence flag and the unpredictable element string existence flag of the entire compression unit of the restricted general string prediction coding mode to improve the coding efficiency. Summary of the invention

[0029] Due to the above-mentioned defects in the prior art, the present invention provides a coding and decoding method and a device for conditionally encoding the coordinate string existence flag and the unpredictable element string existence flag of the entire compression unit of the restricted general string prediction coding mode, which overcomes the defect of the prior art that the coordinate string existence flag and the unpredictable element string existence flag need to be encoded in any state, resulting in waste of data processing and greatly reducing the coding efficiency.

[0030] In order to achieve the above object, the present invention provides the following technical solutions:

[0031] The present invention first encodes the unpredictable element string existence flag (or first encodes the coordinate string existence flag). If the value of the unpredictable element string existence flag (or the coordinate string existence flag) indicates that the unpredictable element string (or the coordinate string) exists in the current entire compression unit, the coordinate string existence flag (or the unpredictable element string existence flag) is further encoded. Otherwise, the coordinate string existence flag (or the unpredictable element string existence flag) is not encoded and the value of the coordinate string existence flag (or the unpredictable element string existence flag) is set to a default value, and the default value indicates that the coordinate string (or the unpredictable element string) exists in the current entire compression unit. In the case that there is no unpredictable element string (or the coordinate string) in the current entire compression unit, the present invention reduces the existence flag written into the compressed data code stream from two to one, thereby reducing the number of bits required to be consumed by 50%, effectively improving the encoding efficiency.

[0032] In a first aspect, the present invention provides a method for encoding an entire compression unit in a general string prediction coding mode, comprising at least the steps of performing the following functions and operations:

[0033] (1) Input at least one full compression unit of data;

[0034] (2) performing general string prediction coding, and writing at least a flag indicating the existence of an unpredictable element string predicted by the general string into the compressed data code stream;

[0035] (3) if the value of the unpredictable element string existence flag of the general string prediction indicates that an unpredictable pixel string exists in the current whole compression unit, the coordinate string existence flag of the general string prediction is written into the compressed data code stream; otherwise, the coordinate string existence flag of the general string prediction is not written into the compressed data code stream and the value of the coordinate string existence flag of the general string prediction is set to a default value, wherein the default value indicates that a coordinate string predicted by the general string exists in the current whole compression unit;

[0036] (4) Output at least a compressed data code stream including information indicating the presence of an unpredictable element string.

[0037] In a second aspect, the present invention provides a method for encoding an entire compression unit in a general string prediction coding mode, comprising at least the steps of performing the following functions and operations:

[0038] (1) Input at least one full compression unit of data;

[0039] (2) performing general string prediction coding, and writing at least a coordinate string existence flag predicted by the general string into the compressed data code stream;

[0040] (3) if the value of the coordinate string existence flag predicted by the general string indicates that the coordinate string exists in the current entire compression unit, then the unpredictable element string existence flag predicted by the general string is written into the compressed data code stream; otherwise, the unpredictable element string existence flag predicted by the general string is not written into the compressed data code stream and the value of the unpredictable element string existence flag predicted by the general string is set to a default value, wherein the default value indicates that the unpredictable element string predicted by the general string exists in the current entire compression unit;

[0041] (4) Outputting at least a compressed data code stream including information indicating the existence of a coordinate string.

[0042] In a third aspect, the present invention provides a method for decoding an entire compression unit in a general string prediction coding mode, comprising at least the steps of performing the following functions and operations:

[0043] (1) Inputting at least one compressed data stream of a whole compression unit;

[0044] (2) performing universal string prediction decoding, at least parsing the compressed data code stream, and at least obtaining a flag indicating the existence of an unpredictable element string predicted by the universal string;

[0045] (3) if the value of the flag for the existence of the unpredictable element string predicted by the general string indicates that an unpredictable pixel string exists in the current whole compression unit, the compressed data code stream is parsed to obtain the flag for the existence of the coordinate string predicted by the general string; otherwise, the compressed data code stream is not parsed and the value of the flag for the existence of the coordinate string predicted by the general string is set to a default value, wherein the default value indicates that a coordinate string predicted by the general string exists in the current whole compression unit;

[0046] (4) Output at least the reconstructed element.

[0047] In a fourth aspect, the present invention provides a method for decoding an entire compression unit in a general string prediction coding mode, comprising at least the steps of performing the following functions and operations:

[0048] (1) Inputting at least one compressed data stream of a whole compression unit;

[0049] (2) performing universal string prediction decoding, at least parsing the compressed data code stream, and at least obtaining a coordinate string existence flag of the universal string prediction;

[0050] (3) if the value of the coordinate string existence flag predicted by the general string indicates that the coordinate string exists in the current entire compression unit, the compressed data code stream is parsed to obtain the unpredictable element string existence flag predicted by the general string; otherwise, the compressed data code stream is not parsed and the value of the unpredictable element string existence flag predicted by the general string is set to a default value, wherein the default value indicates that the unpredictable element string predicted by the general string exists in the current entire compression unit;

[0051] (4) Output at least the reconstructed element.

[0052] Preferably, the original data and the entire compression unit involved in the above four aspects are specifically as follows:

[0053] The raw data is an array or sequence of arrays of two-dimensional data elements including an image, a sequence of images, a video;

[0054] The entire compression unit includes one of the following coding units or a combination thereof: macroblock, coding unit CU, sub-region of CU, sub-coding unit SubCU, prediction block, prediction unit PU, sub-region of PU, sub-prediction unit SubPU, transform block, transform unit TU, sub-region of TU, ​​sub-transform unit SubTU.

[0055] Preferably, the unpredictable element string presence flag of the general string prediction and the coordinate string presence flag of the general string prediction are syntax elements recorded as usp_unpredictable_pixel_str_present_flag and usp_coor_str_present_flag, respectively, and are recorded in the syntax description definition table of the compressed data code stream of the entire compression unit in the general string prediction coding mode in the following order and relationship:

[0056]

[0057] The semantic description of the grammatical elements is:

[0058] The coordinate string of the universal string prediction exists flag usp_coor_str_present_flag

[0059] Flag; a value of the first predetermined value indicates that the coordinate string exists in the entire compression unit of the current universal string prediction coding mode; a value of the second predetermined value indicates that the coordinate string does not exist in the entire compression unit of the current universal string prediction coding mode; the value of the variable uspCoorStrPresentFlag is equal to the value of usp_coor_str_present_flag; if usp_coor_str_present_flag does not exist in the bitstream, the value of the variable uspCoorStrPresentFlag is the second predetermined value;

[0060] Unpredictable pixel presence flag for universal string prediction usp_unpredictable_pixel_str_present_flag

[0061] Flag; a value of the first predetermined value indicates that there is an unpredictable pixel string in the entire compression unit of the current general string prediction coding mode; a value of the second predetermined value indicates that there is no unpredictable pixel string in the entire compression unit of the current general string prediction coding mode; the value of the variable uspUnpredictablePixelStrPresentFlag is equal to the value of usp_unpredictable_pixel_str_present_flag; if usp_unpredictable_pixel_str_present_flag does not exist in the bitstream, the value of the variable uspUnpredictablePixelStrPresentFlag is the first predetermined value.

[0062] The present invention provides a coding device for an entire compression unit of a general string prediction coding mode, which includes a module for implementing a coding method for an entire compression unit of a general string prediction coding mode as described above.

[0063] Specifically, there are two solutions:

[0064] Solution 1: The encoding device includes at least a module for performing the following functions and operations:

[0065] (1) Input at least one full compression unit of data;

[0066] (2) performing general string prediction coding, and writing at least a flag indicating the existence of an unpredictable element string predicted by the general string into the compressed data code stream;

[0067] (3) If the value of the unpredictable element string existence flag predicted by the general string indicates that an unpredictable pixel string exists in the current entire compression unit, then the coordinate string existence flag predicted by the general string is further written into the compressed data code stream; otherwise, the coordinate string existence flag predicted by the general string is not written into the compressed data code stream and the value of the coordinate string existence flag predicted by the general string is set to a default value, wherein the default value indicates that a coordinate string predicted by the general string exists in the current entire compression unit;

[0068] (4) Output at least a compressed data code stream including information indicating the presence of an unpredictable element string.

[0069] Solution 2: The encoding device includes at least a module for completing the following functions and operations:

[0070] (1) Input at least one full compression unit of data;

[0071] (2) performing general string prediction coding, and writing at least a coordinate string existence flag predicted by the general string into the compressed data code stream;

[0072] (3) if the value of the coordinate string existence flag predicted by the general string indicates that the coordinate string exists in the current entire compression unit, then the unpredictable element string existence flag predicted by the general string is further written into the compressed data code stream; otherwise, the unpredictable element string existence flag predicted by the general string is not written into the compressed data code stream and the value of the unpredictable element string existence flag predicted by the general string is set to a default value, wherein the default value indicates that the unpredictable element string predicted by the general string exists in the current entire compression unit;

[0073] (4) Outputting at least a compressed data code stream including information indicating the existence of a coordinate string.

[0074] The present invention provides a decoding device for an entire compression unit of a general string prediction coding mode, which comprises a module for implementing a decoding method for an entire compression unit of a general string prediction coding mode as described above.

[0075] Specifically, there are two solutions:

[0076] Solution 1: The decoding device includes at least a module for performing the following functions and operations:

[0077] (1) Inputting at least one compressed data stream of a whole compression unit;

[0078] (2) performing universal string prediction decoding, at least parsing the compressed data code stream, and at least obtaining a flag indicating the existence of an unpredictable element string predicted by the universal string;

[0079] (3) if the value of the flag for the existence of the unpredictable element string predicted by the general string indicates that an unpredictable pixel string exists in the current whole compression unit, further parse the compressed data code stream to obtain the flag for the existence of the coordinate string predicted by the general string; otherwise, do not parse the compressed data code stream and set the value of the flag for the existence of the coordinate string predicted by the general string to a default value, wherein the default value indicates that a coordinate string predicted by the general string exists in the current whole compression unit;

[0080] (4) Output at least the reconstructed element.

[0081] Solution 2: The decoding device includes at least a module for performing the following functions and operations:

[0082] (1) Inputting at least one compressed data stream of a whole compression unit;

[0083] (2) performing universal string prediction decoding, at least parsing the compressed data code stream, and at least obtaining a coordinate string existence flag of the universal string prediction;

[0084] (3) if the value of the coordinate string existence flag predicted by the general string indicates that the coordinate string exists in the current entire compression unit, further parse the compressed data code stream to obtain the unpredictable element string existence flag predicted by the general string; otherwise, do not parse the compressed data code stream and set the value of the unpredictable element string existence flag predicted by the general string to a default value, wherein the default value indicates that the unpredictable element string predicted by the general string exists in the current entire compression unit;

[0085] (4) Output at least the reconstructed element.

[0086] The present invention also provides an electronic device, the electronic device comprising a processor and a memory, the memory storing at least one instruction, at least one program, a code set or an instruction set, the at least one instruction, the at least one program, the code set or the instruction set being loaded and executed by the processor to implement any of the following methods:

[0087] A method for encoding or decoding an entire compression unit of a general string prediction coding mode as described above.

[0088] In addition, the present invention also provides a computer-readable storage medium, wherein the storage medium stores at least one instruction, at least one program, code set or instruction set, wherein the at least one instruction, the at least one program, the code set or instruction set is loaded by a processor and executes any of the following methods:

[0089] A method for encoding or decoding an entire compression unit of a general string prediction coding mode as described above.

[0090] The present invention is applicable to encoding and decoding of lossy compressed data, and the present invention is also applicable to encoding and decoding of lossless compressed data. The present invention is applicable to encoding and decoding of one-dimensional data such as string data or byte string data or one-dimensional graphics or fractal graphics, and the present invention is also applicable to encoding and decoding of data of two or more dimensions such as images, image sequences or video data.

[0091] In the present invention, the data involved in data compression includes one or a combination of the following types of data:

[0092] One-dimensional data;

[0093] Two-dimensional data;

[0094] Multidimensional data;

[0095] Graphics;

[0096] Fractal graphics;

[0097] image;

[0098] A sequence of images;

[0099] video;

[0100] Audio;

[0101] document;

[0102] byte;

[0103] Bit;

[0104] Pixels;

[0105] 3D scenes;

[0106] Sequences of continuously changing three-dimensional scenes;

[0107] Virtual reality scenes;

[0108] A sequence of pixel-based images of a continuously changing virtual reality scene;

[0109] Transform domain data of the image;

[0110] A collection of bytes of two or more dimensions;

[0111] A collection of bits of two or more dimensions;

[0112] A collection of pixels;

[0113] A collection of single-component pixels;

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

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

[0116] A collection of three-component pixels (Y, Cb, Cr);

[0117] A collection of three-component pixels (Y, Cg, Co);

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

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

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

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

[0122] A collection of four-component pixels (Y, Cg, Co, A).

[0123] The technical features of the present invention are described above by using several specific examples. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. DETAILED DESCRIPTION

[0124] The structure of the present invention is further described below in conjunction with specific embodiments, but is not intended to be a limitation of the present invention.

[0125] The units involved in the following methods and devices are specifically as follows:

[0126] The raw data is an array or sequence of arrays of two-dimensional data elements including an image, a sequence of images, a video;

[0127] The entire compression unit includes one or a combination of the following coding units: macroblock, coding unit CU, sub-region of CU, sub-coding unit SubCU, prediction block, prediction unit PU, sub-region of PU, sub-prediction unit SubPU, transform block, transform unit TU, sub-region of TU, ​​sub-transform unit SubTU.

[0128] Example 1

[0129] A method for encoding an entire compression unit in a general string prediction coding mode includes the steps of performing the following functions and operations:

[0130] (1) Input at least one full compression unit of data;

[0131] (2) performing general string prediction coding, and writing at least a flag indicating the existence of an unpredictable element string predicted by the general string into the compressed data code stream;

[0132] (3) If the value of the unpredictable element string existence flag predicted by the general string indicates that an unpredictable pixel string exists in the current entire compression unit, the coordinate string existence flag predicted by the general string is written into the compressed data bitstream; otherwise, the coordinate string existence flag predicted by the general string is not written into the compressed data bitstream and the value of the coordinate string existence flag predicted by the general string is set to a default value, which indicates that a coordinate string predicted by the general string exists in the current entire compression unit;

[0133] (4) outputting at least a compressed data code stream including information indicating the presence of a flag indicating the presence of an unpredictable element string;

[0134] Among them, the unpredictable element string presence flag of the general string prediction and the coordinate string presence flag of the general string prediction are syntax elements recorded as usp_unpredictable_pixel_str_present_flag and usp_coor_str_present_flag respectively, and are recorded in the syntax description definition table of the compressed data code stream of the entire compression unit in the general string prediction coding mode in the following order and relationship:

[0135]

[0136] The semantic description of the syntax elements is:

[0137] The coordinate string of the universal string prediction exists flag usp_coor_str_present_flag

[0138] Flag; a value of the first predetermined value indicates that the coordinate string exists in the entire compression unit of the current universal string prediction coding mode; a value of the second predetermined value indicates that the coordinate string does not exist in the entire compression unit of the current universal string prediction coding mode; the value of the variable uspCoorStrPresentFlag is equal to the value of usp_coor_str_present_flag; if usp_coor_str_present_flag does not exist in the bitstream, the value of the variable uspCoorStrPresentFlag is the second predetermined value;

[0139] Unpredictable pixel presence flag for universal string prediction usp_unpredictable_pixel_str_present_flag

[0140] Flag; a value of the first predetermined value indicates that there is an unpredictable pixel string in the entire compression unit of the current general string prediction coding mode; a value of the second predetermined value indicates that there is no unpredictable pixel string in the entire compression unit of the current general string prediction coding mode; the value of the variable uspUnpredictablePixelStrPresentFlag is equal to the value of usp_unpredictable_pixel_str_present_flag; if usp_unpredictable_pixel_str_present_flag does not exist in the bitstream, the value of the variable uspUnpredictablePixelStrPresentFlag is the first predetermined value.

[0141] Example 2

[0142] A method for encoding an entire compression unit in a general string prediction coding mode includes the steps of performing the following functions and operations:

[0143] (1) Input at least one full compression unit of data;

[0144] (2) performing general string prediction coding, and writing at least a coordinate string existence flag predicted by the general string into the compressed data code stream;

[0145] (3) If the value of the coordinate string existence flag predicted by the general string indicates that the coordinate string exists in the current entire compression unit, then the unpredictable element string existence flag predicted by the general string is written into the compressed data code stream; otherwise, the unpredictable element string existence flag predicted by the general string is not written into the compressed data code stream and the value of the unpredictable element string existence flag predicted by the general string is set to a default value, which indicates that the unpredictable element string predicted by the general string exists in the current entire compression unit;

[0146] (4) outputting at least a compressed data code stream including information indicating the existence of a coordinate string;

[0147] Among them, the unpredictable element string presence flag of the general string prediction and the coordinate string presence flag of the general string prediction are syntax elements recorded as usp_unpredictable_pixel_str_present_flag and usp_coor_str_present_flag respectively, and are recorded in the syntax description definition table of the compressed data code stream of the entire compression unit in the general string prediction coding mode in the following order and relationship:

[0148]

[0149] The semantic description of the syntax elements is:

[0150] The coordinate string of the universal string prediction exists flag usp_coor_str_present_flag

[0151] Flag; a value of the first predetermined value indicates that the coordinate string exists in the entire compression unit of the current universal string prediction coding mode; a value of the second predetermined value indicates that the coordinate string does not exist in the entire compression unit of the current universal string prediction coding mode; the value of the variable uspCoorStrPresentFlag is equal to the value of usp_coor_str_present_flag; if usp_coor_str_present_flag does not exist in the bitstream, the value of the variable uspCoorStrPresentFlag is the second predetermined value;

[0152] Unpredictable pixel presence flag for universal string prediction usp_unpredictable_pixel_str_present_flag

[0153] Flag; a value of the first predetermined value indicates that there is an unpredictable pixel string in the entire compression unit of the current general string prediction coding mode; a value of the second predetermined value indicates that there is no unpredictable pixel string in the entire compression unit of the current general string prediction coding mode; the value of the variable uspUnpredictablePixelStrPresentFlag is equal to the value of usp_unpredictable_pixel_str_present_flag; if usp_unpredictable_pixel_str_present_flag does not exist in the bitstream, the value of the variable uspUnpredictablePixelStrPresentFlag is the first predetermined value.

[0154] Example 3

[0155] A method for decoding an entire compression unit in a general string prediction coding mode includes the steps of performing the following functions and operations:

[0156] (1) Inputting at least one compressed data stream of a whole compression unit;

[0157] (2) performing universal string prediction decoding, at least parsing the compressed data code stream, and at least obtaining a flag indicating the existence of an unpredictable element string predicted by the universal string;

[0158] (3) If the value of the flag for the existence of the unpredictable element string predicted by the general string indicates that an unpredictable pixel string exists in the current whole compression unit, the compressed data code stream is parsed to obtain the flag for the existence of the coordinate string predicted by the general string; otherwise, the compressed data code stream is not parsed and the value of the flag for the existence of the coordinate string predicted by the general string is set to a default value, which indicates that a coordinate string predicted by the general string exists in the current whole compression unit;

[0159] (4) output at least the reconstruction element;

[0160] Among them, the unpredictable element string presence flag of the general string prediction and the coordinate string presence flag of the general string prediction are syntax elements recorded as usp_unpredictable_pixel_str_present_flag and usp_coor_str_present_flag respectively, and are recorded in the syntax description definition table of the compressed data code stream of the entire compression unit in the general string prediction coding mode in the following order and relationship:

[0161]

[0162] The semantic description of the syntax elements is:

[0163] The coordinate string of the universal string prediction exists flag usp_coor_str_present_flag

[0164] Flag; a value of the first predetermined value indicates that the coordinate string exists in the entire compression unit of the current universal string prediction coding mode; a value of the second predetermined value indicates that the coordinate string does not exist in the entire compression unit of the current universal string prediction coding mode; the value of the variable uspCoorStrPresentFlag is equal to the value of usp_coor_str_present_flag; if usp_coor_str_present_flag does not exist in the bitstream, the value of the variable uspCoorStrPresentFlag is the second predetermined value;

[0165] Unpredictable pixel presence flag for universal string prediction usp_unpredictable_pixel_str_present_flag

[0166] Flag; a value of the first predetermined value indicates that there is an unpredictable pixel string in the entire compression unit of the current general string prediction coding mode; a value of the second predetermined value indicates that there is no unpredictable pixel string in the entire compression unit of the current general string prediction coding mode; the value of the variable uspUnpredictablePixelStrPresentFlag is equal to the value of usp_unpredictable_pixel_str_present_flag; if usp_unpredictable_pixel_str_present_flag does not exist in the bitstream, the value of the variable uspUnpredictablePixelStrPresentFlag is the first predetermined value.

[0167] Example 4

[0168] A method for decoding an entire compression unit in a general string prediction coding mode includes the steps of performing the following functions and operations:

[0169] (1) Inputting at least one compressed data stream of a whole compression unit;

[0170] (2) performing universal string prediction decoding, at least parsing the compressed data code stream, and at least obtaining a coordinate string existence flag of the universal string prediction;

[0171] (3) If the value of the coordinate string existence flag predicted by the general string indicates that the coordinate string exists in the current entire compression unit, the compressed data code stream is parsed to obtain the unpredictable element string existence flag predicted by the general string; otherwise, the compressed data code stream is not parsed and the value of the unpredictable element string existence flag predicted by the general string is set to a default value, which indicates that the unpredictable element string predicted by the general string exists in the current entire compression unit;

[0172] (4) output at least the reconstruction element;

[0173] Among them, the unpredictable element string presence flag of the general string prediction and the coordinate string presence flag of the general string prediction are syntax elements recorded as usp_unpredictable_pixel_str_present_flag and usp_coor_str_present_flag respectively, and are recorded in the syntax description definition table of the compressed data code stream of the entire compression unit in the general string prediction coding mode in the following order and relationship:

[0174]

[0175] The semantic description of the syntax elements is:

[0176] The coordinate string of the universal string prediction exists flag usp_coor_str_present_flag

[0177] Flag; a value of the first predetermined value indicates that the coordinate string exists in the entire compression unit of the current universal string prediction coding mode; a value of the second predetermined value indicates that the coordinate string does not exist in the entire compression unit of the current universal string prediction coding mode; the value of the variable uspCoorStrPresentFlag is equal to the value of usp_coor_str_present_flag; if usp_coor_str_present_flag does not exist in the bitstream, the value of the variable uspCoorStrPresentFlag is the second predetermined value;

[0178] Unpredictable pixel presence flag for universal string prediction usp_unpredictable_pixel_str_present_flag

[0179] Flag; a value of the first predetermined value indicates that there is an unpredictable pixel string in the entire compression unit of the current general string prediction coding mode; a value of the second predetermined value indicates that there is no unpredictable pixel string in the entire compression unit of the current general string prediction coding mode; the value of the variable uspUnpredictablePixelStrPresentFlag is equal to the value of usp_unpredictable_pixel_str_present_flag; if usp_unpredictable_pixel_str_present_flag does not exist in the bitstream, the value of the variable uspUnpredictablePixelStrPresentFlag is the first predetermined value.

[0180] Example 5

[0181] A device for encoding an entire compression unit of a general string prediction coding mode, comprising a module for implementing a method for encoding an entire compression unit of a general string prediction coding mode as described in Example 1.

[0182] Example 6

[0183] A device for encoding an entire compression unit of a general string prediction coding mode, comprising a module for implementing a method for encoding an entire compression unit of a general string prediction coding mode as described in Example 2.

[0184] Example 7

[0185] A decoding device for an entire compression unit of a general string prediction coding mode comprises a module for implementing a decoding method for an entire compression unit of a general string prediction coding mode as described in Example 3.

[0186] Example 8

[0187] A decoding device for an entire compression unit of a general string prediction coding mode comprises a module for implementing a decoding method for an entire compression unit of a general string prediction coding mode as described in Example 4.

[0188] Example 9

[0189] An electronic device comprises a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement a method for encoding an entire compression unit of a general string prediction coding mode as described in Example 1.

[0190] Example 10

[0191] An electronic device comprises a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement a method for encoding an entire compression unit of a general string prediction coding mode as described in Example 2.

[0192] Embodiment 11

[0193] An electronic device comprises a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement a decoding method for an entire compression unit of a general string prediction coding mode as described in Example 3.

[0194] Example 12

[0195] An electronic device comprises a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement a decoding method for an entire compression unit of a general string prediction coding mode as described in Example 4.

[0196] Example 13

[0197] A computer-readable storage medium, wherein at least one instruction, at least one program, code set or instruction set is stored in the storage medium, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to encode a whole compression unit of a general string prediction coding mode as described in Example 1.

[0198] Embodiment 14

[0199] A computer-readable storage medium, wherein at least one instruction, at least one program, code set or instruction set is stored in the storage medium, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to encode a whole compression unit of a general string prediction coding mode as described in Example 2.

[0200] Embodiment 15

[0201] A computer-readable storage medium, wherein at least one instruction, at least one program, code set or instruction set is stored in the storage medium, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to decode a whole compression unit of a general string prediction coding mode as described in Example 3.

[0202] Example 16

[0203] A computer-readable storage medium, wherein at least one instruction, at least one program, code set or instruction set is stored in the storage medium, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to decode a whole compression unit of a general string prediction coding mode as described in Example 4.

[0204] Those skilled in the art should understand that those skilled in the art can implement variations by combining the prior art and the above embodiments, which will not be described in detail here. Such variations do not affect the essential content of the present invention, and will not be described in detail here.

[0205] The above describes the preferred embodiments of the present invention. It should be understood that the present invention is not limited to the above-mentioned specific embodiments, and the devices and structures that are not described in detail should be understood to be implemented in a common manner in the art; any technician familiar with the art can use the above-disclosed methods and technical contents to make many possible changes and modifications to the technical solutions of the present invention without departing from the scope of the technical solutions of the present invention, or modify them into equivalent embodiments of equivalent changes, which does not affect the essential content of the present invention. Therefore, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solutions of the present invention are still within the scope of protection of the technical solutions of the present invention.

Claims

1. A method for encoding an entire compression unit in a general string prediction coding mode, characterized in that: At least include the following steps to complete the following functions and operations: (1) Input at least one full compression unit of data; (2) performing general string prediction coding, and writing at least a flag indicating the existence of an unpredictable element string predicted by the general string into the compressed data code stream; (3) if the value of the unpredictable element string existence flag of the general string prediction indicates that an unpredictable pixel string exists in the current whole compression unit, the coordinate string existence flag of the general string prediction is written into the compressed data code stream; otherwise, the coordinate string existence flag of the general string prediction is not written into the compressed data code stream and the value of the coordinate string existence flag of the general string prediction is set to a default value, wherein the default value indicates that a coordinate string predicted by the general string exists in the current whole compression unit; (4) outputting at least a compressed data code stream including information indicating the presence of a flag indicating the presence of an unpredictable element string; The unpredictable element string present flag of the general string prediction and the coordinate string present flag of the general string prediction are syntax elements recorded as usp_unpredictable_pixel_str_present_flag and usp_coor_str_present_flag respectively; The semantic description of the grammatical elements is: The coordinate string of the universal string prediction exists flag usp_coor_str_present_flag Flag; a value of the first predetermined value indicates that the coordinate string exists in the entire compression unit of the current universal string prediction coding mode; a value of the second predetermined value indicates that the coordinate string does not exist in the entire compression unit of the current universal string prediction coding mode; the value of the variable uspCoorStrPresentFlag is equal to the value of usp_coor_str_present_flag; if usp_coor_str_present_flag does not exist in the bitstream, the value of the variable uspCoorStrPresentFlag is the second predetermined value; Unpredictable pixel presence flag for universal string prediction usp_unpredictable_pixel_str_present_flag Flag; a value of the first predetermined value indicates that there is an unpredictable pixel string in the entire compression unit of the current general string prediction coding mode; a value of the second predetermined value indicates that there is no unpredictable pixel string in the entire compression unit of the current general string prediction coding mode; the value of the variable uspUnpredictablePixelStrPresentFlag is equal to the value of usp_unpredictable_pixel_str_present_flag; if usp_unpredictable_pixel_str_present_flag does not exist in the bitstream, the value of the variable uspUnpredictablePixelStrPresentFlag is the first predetermined value.

2. A method for encoding an entire compression unit in a general string prediction coding mode, characterized in that: At least include the following steps to complete the following functions and operations: (1) Input at least one full compression unit of data; (2) performing general string prediction coding, and writing at least a coordinate string existence flag predicted by the general string into the compressed data code stream; (3) if the value of the coordinate string existence flag predicted by the general string indicates that the coordinate string exists in the current entire compression unit, then the unpredictable element string existence flag predicted by the general string is written into the compressed data code stream; otherwise, the unpredictable element string existence flag predicted by the general string is not written into the compressed data code stream and the value of the unpredictable element string existence flag predicted by the general string is set to a default value, wherein the default value indicates that the unpredictable element string predicted by the general string exists in the current entire compression unit; (4) outputting at least a compressed data code stream including information indicating the existence of a coordinate string; The unpredictable element string present flag of the general string prediction and the coordinate string present flag of the general string prediction are syntax elements recorded as usp_unpredictable_pixel_str_present_flag and usp_coor_str_present_flag respectively; The semantic description of the grammatical elements is: The coordinate string of the universal string prediction exists flag usp_coor_str_present_flag Flag; a value of the first predetermined value indicates that the coordinate string exists in the entire compression unit of the current universal string prediction coding mode; a value of the second predetermined value indicates that the coordinate string does not exist in the entire compression unit of the current universal string prediction coding mode; the value of the variable uspCoorStrPresentFlag is equal to the value of usp_coor_str_present_flag; if usp_coor_str_present_flag does not exist in the bitstream, the value of the variable uspCoorStrPresentFlag is the second predetermined value; Unpredictable pixel presence flag for universal string prediction usp_unpredictable_pixel_str_present_flag flag; the value of the first predetermined value indicates that there is an unpredictable pixel string in the entire compression unit of the current universal string prediction coding mode; the value of the second predetermined value indicates that there is no unpredictable pixel string in the entire compression unit of the current universal string prediction coding mode; the value of the variable uspUnpredictablePixelStrPresentFlag is equal to the value of usp_unpredictable_pixel_str_present_flag; if usp_unpredictable_pixel_str_present_flag does not exist in the bitstream, the variable The value of uspUnpredictablePixelStrPresentFlag is a first predetermined value.

3. A method for decoding an entire compression unit in a general string prediction coding mode, characterized in that: At least include the following steps to complete the following functions and operations: (1) Inputting at least one compressed data stream of a whole compression unit; (2) performing universal string prediction decoding, at least parsing the compressed data code stream, and at least obtaining a flag indicating the existence of an unpredictable element string predicted by the universal string; (3) if the value of the flag for the existence of the unpredictable element string predicted by the general string indicates that an unpredictable pixel string exists in the current whole compression unit, the compressed data code stream is parsed to obtain the flag for the existence of the coordinate string predicted by the general string; otherwise, the compressed data code stream is not parsed and the value of the flag for the existence of the coordinate string predicted by the general string is set to a default value, wherein the default value indicates that a coordinate string predicted by the general string exists in the current whole compression unit; (4) output at least the reconstruction element; The unpredictable element string present flag of the general string prediction and the coordinate string present flag of the general string prediction are syntax elements recorded as usp_unpredictable_pixel_str_present_flag and usp_coor_str_present_flag respectively; The semantic description of the grammatical elements is: The coordinate string of the universal string prediction exists flag usp_coor_str_present_flag Flag; a value of the first predetermined value indicates that the coordinate string exists in the entire compression unit of the current universal string prediction coding mode; a value of the second predetermined value indicates that the coordinate string does not exist in the entire compression unit of the current universal string prediction coding mode; the value of the variable uspCoorStrPresentFlag is equal to the value of usp_coor_str_present_flag; if usp_coor_str_present_flag does not exist in the bitstream, the value of the variable uspCoorStrPresentFlag is the second predetermined value; Unpredictable pixel presence flag for universal string prediction usp_unpredictable_pixel_str_present_flag Flag; a value of the first predetermined value indicates that there is an unpredictable pixel string in the entire compression unit of the current general string prediction coding mode; a value of the second predetermined value indicates that there is no unpredictable pixel string in the entire compression unit of the current general string prediction coding mode; the value of the variable uspUnpredictablePixelStrPresentFlag is equal to the value of usp_unpredictable_pixel_str_present_flag; if usp_unpredictable_pixel_str_present_flag does not exist in the bitstream, the value of the variable uspUnpredictablePixelStrPresentFlag is the first predetermined value.

4. The decoding method according to claim 3, characterized in that: The raw data is an array or sequence of arrays of two-dimensional data elements including an image, a sequence of images, a video; The entire compression unit includes one of the following coding units or a combination thereof: macroblock, coding unit CU, sub-region of CU, sub-coding unit SubCU, prediction block, prediction unit PU, sub-region of PU, sub-prediction unit SubPU, transform block, transform unit TU, sub-region of TU, ​​sub-transform unit SubTU.

5. A method for decoding an entire compression unit in a general string prediction coding mode, characterized in that: At least include the following steps to complete the following functions and operations: (1) Inputting at least one compressed data stream of a whole compression unit; (2) performing universal string prediction decoding, at least parsing the compressed data code stream, and at least obtaining a coordinate string existence flag of the universal string prediction; (3) if the value of the coordinate string existence flag predicted by the general string indicates that the coordinate string exists in the current entire compression unit, the compressed data code stream is parsed to obtain the unpredictable element string existence flag predicted by the general string; otherwise, the compressed data code stream is not parsed and the value of the unpredictable element string existence flag predicted by the general string is set to a default value, wherein the default value indicates that the unpredictable element string predicted by the general string exists in the current entire compression unit; (4) output at least the reconstruction element; The unpredictable element string present flag of the general string prediction and the coordinate string present flag of the general string prediction are syntax elements recorded as usp_unpredictable_pixel_str_present_flag and usp_coor_str_present_flag respectively; The semantic description of the grammatical elements is: The coordinate string of the universal string prediction exists flag usp_coor_str_present_flag Flag; a value of the first predetermined value indicates that the coordinate string exists in the entire compression unit of the current universal string prediction coding mode; a value of the second predetermined value indicates that the coordinate string does not exist in the entire compression unit of the current universal string prediction coding mode; the value of the variable uspCoorStrPresentFlag is equal to the value of usp_coor_str_present_flag; if usp_coor_str_present_flag does not exist in the bitstream, the value of the variable uspCoorStrPresentFlag is the second predetermined value; Unpredictable pixel presence flag for universal string prediction usp_unpredictable_pixel_str_present_flag Flag; a value of the first predetermined value indicates that there is an unpredictable pixel string in the entire compression unit of the current general string prediction coding mode; a value of the second predetermined value indicates that there is no unpredictable pixel string in the entire compression unit of the current general string prediction coding mode; the value of the variable uspUnpredictablePixelStrPresentFlag is equal to the value of usp_unpredictable_pixel_str_present_flag; if usp_unpredictable_pixel_str_present_flag does not exist in the bitstream, the value of the variable uspUnpredictablePixelStrPresentFlag is the first predetermined value.

6. The decoding method according to claim 5, characterized in that: The raw data is an array or sequence of arrays of two-dimensional data elements including an image, a sequence of images, a video; The entire compression unit includes one of the following coding units or a combination thereof: macroblock, coding unit CU, sub-region of CU, sub-coding unit SubCU, prediction block, prediction unit PU, sub-region of PU, sub-prediction unit SubPU, transform block, transform unit TU, sub-region of TU, ​​sub-transform unit SubTU.

7. The decoding method according to claim 5, characterized in that: The unpredictable element string existence flag of the general string prediction and the coordinate string existence flag of the general string prediction are recorded in the syntax description definition table of the compressed data code stream of the entire compression unit in the general string prediction coding mode in the following order and relationship:

8. A coding device for an entire compression unit in a general string prediction coding mode, characterized in that: A module comprising a method for encoding an entire compression unit of a general string prediction coding mode as described in claim 1 or 2.

9. A decoding device for an entire compression unit in a general string prediction coding mode, characterized in that: A module is included to implement a method for decoding an entire compression unit of a general string prediction coding mode as described in any one of claims 3 to 7.

10. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement any one of the following methods: A method for encoding an entire compression unit of a universal string prediction coding mode as described in any one of claims 1 or 2, or a method for decoding an entire compression unit of a universal string prediction coding mode as described in any one of claims 3 to 7.

11. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded by the processor and executes any one of the following methods: A method for encoding an entire compression unit of a universal string prediction coding mode as described in any one of claims 1 or 2, or a method for decoding an entire compression unit of a universal string prediction coding mode as described in any one of claims 3 to 7.