Data encoding and decoding method and device for limiting number of storage elements occupied by reference strings or blocks

By limiting the number of reference primitives, the inefficiency problem caused by the limitation of reference area in the existing string prediction technology is solved, efficient video encoding and decoding is achieved, and video processing with high pixel resolution is supported.

CN119728963APending Publication Date: 2025-03-28郭萍
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311252741.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-26
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the existing string prediction technology, the reference area is usually limited to a small range, resulting in low encoding efficiency and insufficient throughput of reading reference elements, and the inability to support video encoding and decoding with high pixel resolution.

Method used

By limiting the number of reference primitives, it is ensured that the number of primitives occupied by reference elements that the entire compression unit or its components fall within a predetermined reference area or sub-region does not exceed a predetermined threshold, thereby improving the throughput and coding efficiency of reading the reference element.

Benefits of technology

It realizes that the encoding efficiency of string prediction is greatly improved without increasing the implementation complexity and cost, and the throughput of reading reference elements is much greater than 1 element per clock, and supports video encoding and decoding with high pixel resolution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728963A_ABST
    Figure CN119728963A_ABST
Patent Text Reader

Abstract

The present invention provides a method and apparatus for encoding and decoding that limits the number of primitives occupied or partially occupied by reference elements of a reference string comprising a reference block, referred to as reference primitives. When string prediction coding and decoding are carried out on one whole compression unit or one whole compression unit group, namely at least two whole compression units or one partial whole compression unit in one group. The number of primitives occupied or partially occupied by reference elements of the whole compression unit or the whole compression unit group or part of the whole compression units, which fall within a predetermined reference range or a sub-range thereof, does not exceed a predetermined threshold value. After the primitive number is limited, if the size of the reference range is kept unchanged, the throughput of reading the reference elements can be improved; if the reference range is expanded, the coding efficiency of string prediction can be improved, and the throughput of reading the reference elements can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a coding and decoding system for lossy or lossless data compression, in particular to a coding method and device and a decoding method and device for compressing data using point prediction. 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, ultra-high compression ratio and extremely high quality data compression for various data, including big data, image data, video data, and various new forms of data has become an indispensable technology.

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

[0004] 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 prescribed order, and encoding and decoding are performed in this order.

[0005] When data compression is performed on 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 when data compression is performed on a two-dimensional or larger data set (and corresponding decoding), the data set is generally divided into a number of compressed subsets with predetermined shapes and / or sizes (i.e., the number of elements), and the compressed subsets are used as units and in a predetermined order, one compressed subset after another, for encoding or decoding.

[0006] When encoding or decoding a compression subset, the compression subset is usually divided into a number of maximum compression units with a predetermined shape and / or size (i.e., the number of elements), and the encoding or decoding is performed in sequence, one maximum compression unit after another, in a predetermined order, with the maximum compression units as units. The maximum compression units arranged in a row from left to right constitute a maximum compression unit row.

[0007] In a maximum compression unit, the maximum compression unit is further divided into several sub-units with predetermined shapes and / or sizes (i.e., the number of elements), which are called whole compression units. The whole compression units are encoded or decoded one by one in a predetermined order, with the whole compression unit as the unit. The maximum compression unit is usually divided into whole compression units with multiple layers of depth in a tree structure: the maximum compression unit itself is allowed to be a whole compression unit with a depth of 0; a whole compression unit with a depth of i is allowed to be divided into at least two smaller whole compression units with a depth of i+1, and the whole compression unit with a depth of i itself disappears, where i≥0; the whole compression units with a depth of i+1 generated by the division of the same whole compression unit with a depth of i that disappears are called blocks with the same parent node. The whole compression unit with a depth of i+1 itself can be further divided into smaller whole compression units with a depth of i+2. Generally, a whole compression unit at one depth can be further divided into smaller whole compression units at the next depth, until a predetermined whole compression unit that cannot be further divided is reached. The smaller-sized whole compression units generated by one or more levels of division from the same initial whole compression unit B(W, H) with a width of W and a height of H are called blocks with the same parent node B(W, H). The largest compression unit is also called a coding tree unit.

[0008] In short, the above process eventually divides the data set into several subsets with predetermined shapes and / or sizes (i.e., the number of elements), called whole compression units, and encodes or decodes the whole compression units one by one in a predetermined order.

[0009] At any time, the compression subset being encoded or decoded is called the current compression subset. The maximum compression unit being encoded or decoded is called the current maximum compression unit. The maximum compression unit row being encoded or decoded is called the current maximum compression unit row. The entire compression unit being encoded or decoded is called the current entire compression unit. The data element (sometimes also simply called the element) being encoded or decoded is called the current encoded data element or the current decoded data element, collectively referred to as the current data element, or simply the current element. An element consists of N components (usually 1≤N≤5), so data sets, compression subsets, maximum compression units, and entire compression units also consist of N components. The components of an element are also called component elements.

[0010] For example, a compression subset is a frame of an image whose elements, i.e., pixels, are arranged in a rectangular shape, have a size (resolution) of 3840 (width) × 2160 (height), and are composed 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. A frame of an image is divided into multiple maximum compression units of a size of 128×128 in width × height. Each maximum compression unit is further divided into square or rectangular integral compression units of varying sizes from 128×64 or 64×128 to 4×4. An example of a 128×128 maximum compression unit being divided into a tree-like structure and its parent node blocks ( Figure 1 (a) is: the upper left 64×64 area is a 64×64 integer compression unit with a depth of 1; the upper right 64×64 area consists of a 64×32 integer compression unit with a depth of 2 and two 32×32 integer compression units with a depth of 3 having the same B(64, 32) parent node block; the lower left 64×64 area consists of three 32×32 integer compression units with a depth of 2 and four 16×16 integer compression units with a depth of 3 having the same B(32, 32) parent node block; the lower right 64×64 area consists of three 32×32 integer compression units with a depth of 2, three 16×16 integer compression units with a depth of 3, and two 16×8 integer compression units with a depth of 4 having the same B(16, 16) parent node block. In this example, there is a 128x128 parent node block (divided into 19 full compression units), three 64x64 parent node blocks (divided into 3, 7, and 8 full compression units respectively), one 64x32 parent node block (divided into 2 full compression units), two 32x32 parent node blocks (divided into 4 and 5 full compression units respectively), and one 16x16 parent node block (divided into 2 full compression units).

[0011] When a data set is divided into compression subsets, maximum compression units, and whole compression units, a predetermined rule for sorting elements is to sort the compression subsets first, then sort the maximum compression units within each compression subset, then sort the whole compression units within each maximum compression unit, and finally sort the elements within each whole compression unit.

[0012] That is, in the case where the data set is finally divided into whole compression units, a predetermined rule for sorting is to sort the whole compression units first, and then sort the elements within each whole compression unit.

[0013] 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 in sampling format. Data with N components having the same sampling rate and size (i.e., the number of component samples) is called full sampling format data. N components have different sampling rates and sizes, where N1 The sampling rate and size of the components are N-N 1The data with the sampling rate and size of the components, called sub-components, is called down-sampled format data. The integer multiples are usually 2 times, 4 times, 8 times, 2×2 times, 4×2 times, etc. In the full sampling format data, all components are considered to be main components, and there are no sub-components. In the down-sampled format data, at least one component is a main component and at least one component is a sub-component. For example, for an array of a type 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 adopted, 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 two-dimensional data element array including natural images and videos captured by cameras, a sampling format called 4:2:0 (abbreviated as 420) is usually adopted, that is, the sampling rate and size of the two components (D component and E component) called sub-components 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 (F component) called the main component, that is, there is a 4:1 downsampling relationship between the main component and the sub-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 and 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 and 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} respectively. In situations 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 (such as an image or video) with a rectangular shape and 3 components 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 the horizontal direction) of the data set (such as an image or video), a D component D[i][j] and an 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. In images and videos using RGB color formats, the above-mentioned F, D, and E components are usually G, B, and R components or G, R, and B components. When the data is an image or video, the sampling format is often also 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.

[0014] 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.

[0015] An effective way of data compression is string prediction, also known as string matching. String prediction divides the elements of a current whole compression unit into element strings of variable length. For a current element string being encoded or decoded, 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 or a subset of elements that have completed a predetermined degree of encoding and decoding, called a reference set, referred to as a reference string, also called a reference string or a predicted string or a matching string of the current string. For a reference string of a current string, only a number of parameters are needed 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 that all elements and their numerical values ​​of the current string can be fully represented and reconstructed anytime and anywhere when needed, thereby achieving the purpose of data compression. The elements of the current string generated by reconstruction are called reconstructed elements, and their numerical values ​​are called the reconstructed values ​​of the current string and its elements. Data compression in which the reconstructed value of an element is equal to the original value of the element is called lossless compression. Data compression in which the reconstructed value of an element is not equal to the original value of the element is called lossy compression.

[0016] For example, if a current string that is continuously sorted according to a certain scanning method can find a corresponding reference string in the reference set, it is only necessary to use the position relationship between the first element of the current string and the first element of the reference string and the string length 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. This can completely represent and reconstruct all elements and their values ​​of the current string anytime and anywhere when needed, and obtain the reconstructed value of the current string and its elements. The number of bits consumed by recording the two 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.

[0017] In string prediction, the reconstruction operation is usually completed by reading the reference element and copying it to the position of the current element. Therefore, string prediction is also called string copying. The throughput of generating reconstructed elements basically depends on the throughput of reading reference elements.

[0018] In string prediction, unpredictable (also called unmatched or mismatched or unmatched) elements may also appear for which no reference element can be found in the reference set. The component, main component, and secondary component of the unpredictable element are respectively called unpredictable component, unpredictable main component, and unpredictable secondary component. For the unpredictable element, only its exact or approximate value itself can be recorded, compressed in a predetermined manner, and reconstructed anytime and anywhere when needed to obtain the reconstructed value of the unpredictable element.

[0019] Scanning methods commonly used in string prediction include: Horizontal raster 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, and the scanning direction of all rows is arranged from left to right or the scanning direction of all rows is arranged from right to left; or, 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 row in 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 rows arranged from left to right are called forward rows, and the rows arranged from right to left are called reverse rows; or, 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, and 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; or, 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.

[0020] 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.

[0021] A special case of string prediction is block prediction, also known as block matching. In this special case, each string forms a rectangular block, and even a string or a block is a whole compression unit. In this special case, encoding and decoding may not be performed in the form and order of element scanning, but directly in the form of blocks, but blocks and strings may also be performed in the form and order of element scanning. Another form of block is microblock or strip or triangle or triangle chain or trapezoid or quadrilateral, collectively referred to as geometric block. Therefore, string prediction and block prediction also include microblock prediction or strip prediction or triangle prediction or triangle chain prediction or trapezoid prediction or quadrilateral prediction, collectively referred to as geometric block prediction.

[0022] The string prediction or block prediction includes intra-frame string prediction or intra-frame block prediction when the reference element and the current element are in the same frame, and inter-frame string prediction or inter-frame block prediction when the reference element and the current element are not in the same frame. Inter-frame block prediction is commonly referred to as inter-frame prediction.

[0023] Therefore, there are many different types of string prediction methods, including at least the following types: intra-frame string prediction, intra-frame block prediction, inter-frame string prediction, inter-frame block prediction, and inter-frame prediction. String prediction methods also have various mixed types, including at least the following types: block-intra-frame prediction, block-inter-frame prediction, and block-geometry block prediction. String prediction methods also have various types of prediction and compensation combinations, including at least the following types: string-local illumination compensation prediction, and block-local illumination compensation prediction.

[0024] In this application, strings and blocks are collectively referred to as strings. Therefore, string prediction is also a general term for string prediction and block prediction, especially including intra-frame string prediction, intra-frame block prediction, inter-frame string prediction, inter-frame block prediction, and traditional inter-frame prediction.

[0025] An important factor affecting the coding efficiency of string prediction is the size of the reference set, which is also commonly referred to as the reference area or reference range, that is, the range of the position of the reference element pointed to by the string vector. The larger the reference area, the more candidate reference elements there are, the more suitable reference elements can be found, and the higher the coding efficiency. However, the larger the reference area, the higher the implementation complexity and cost. In particular, when the reference area is large to a certain extent, the reference elements cannot be placed inside the codec chip, but must be placed in a dedicated storage chip outside the codec chip. Not only does the cost increase, but the read and write bandwidth and pixel processing throughput will become serious bottlenecks, and it may even be impossible to support the encoding and decoding of high-pixel resolution images and videos.

[0026] The reference area is usually composed of an integer number of reference units. The shape and size of the reference unit are usually equal to the shape and size of the maximum compression unit; or equal to a predetermined shape and size; or equal to the shape and size of the maximum compression unit when the width and height of the maximum compression unit are less than or equal to a predetermined value and equal to the predetermined shape and size when the width and height of the maximum compression unit are greater than the predetermined value. For example, when the width and height of the maximum compression unit are 16×16 or 32×32 or 64×64, the width and height of the reference unit are equal to the width and height of the maximum compression unit, and when the width and height of the maximum compression unit are 128×128 or 256×256 or 512×512, the width and height of the reference unit are equal to 64×64. For another example, when the width and height of the maximum compression unit are 16×16 or 32×32 or 64×64 or 128×128, the width and height of the reference unit are equal to the width and height of the maximum compression unit, and when the width and height of the maximum compression unit are 256×256 or 512×512, the width and height of the reference unit are equal to 128×128. The current entire compression unit may fall within a reference unit, in which case the reference unit is called the current reference unit. Within the current reference unit, elements that have completed at least part of the encoding and decoding are allowed to become (be used for) reference elements of the elements being encoded and decoded, while elements that have not yet completed at least part of the encoding and decoding cannot be used as reference elements of the elements being encoded and decoded.

[0027] In string prediction technology, in order to reduce implementation complexity and cost, the reference area is usually limited and has a predetermined fixed size (i.e., the number of elements), such as being limited to the maximum compression unit where the current full compression unit is located or the largest compression unit nearby; or being limited to the quarter of the maximum compression unit where the current full compression unit is located or the quarter of the largest compression unit nearby. Even if the reference area is limited and its elements are all inside the codec chip, the read and write bandwidth and element processing throughput, especially the throughput of reading reference elements, are still bottlenecks. For example, if each clock cycle can only read reference elements that can generate at most one reconstructed element, the throughput of generating reconstructed elements will never exceed one element per clock.

[0028] The fundamental reason why the throughput of reading reference elements always becomes a bottleneck is the inherent access characteristics of the element data memory. The memory and the processor are always connected through a bus. The bit width of the bus is limited, so the amount of data accessed at one time is limited. Moreover, the data accessed by a bus at one time are all in adjacent locations in the memory and cannot be scattered in different locations in the memory. Therefore, the reference area, as a memory, is divided into fixed basic blocks of the same size P×Q, referred to as base blocks. Only one base block can be accessed at a time through a bus. Examples of block sizes include 4×1 (i.e., 4 elements adjacent horizontally and 1 element adjacent vertically), 4×2, 4×4, 2×4, 1×4, 8×1, 8×2, 8×4, 8×8, 4×8, 2×8, 1×8, 16×1, 16×2, 16×4, 16×8, 16×16, 8×16, 4×16, 2×16, 1×16, 32×8, 32×16, 32×32, 16×32, 8×32, and so on. If R buses are used in parallel, R blocks can be accessed in parallel at one time. R blocks are called a basic unit, or primitive for short, and their size is recorded as P×Q×R. R is usually 1, 2, or 4. R blocks are usually adjacent. For example, when R=2, a primitive of size P×Q×2 is two adjacent blocks left and right or up and down. When R=1, primitives are equivalent to blocks. Therefore, a block can be considered as a special case of a primitive. In this application, a primitive includes a block, and P×Q×1 is also abbreviated as P×Q. The most common primitive sizes include 4×1, 4×1×2 (indicating two 4×1 primitives adjacent to each other left and right or up and down), 4×2, 4×2×2 (indicating two 4×2 primitives adjacent to each other left and right or up and down), 8×1, 8×1×2 (indicating two 8×1 primitives adjacent to each other left and right or up and down), 8×2, 16×8, 16×16, 8×16, 32×16, 32×32, 16×32.

[0029] Generally, the access includes one-clock access or multiple-clock access or one-burst access, that is, continuous N-clock access or M-burst access, that is, continuous M×N-clock access, where M and N are integers greater than 1. In the case of a burst of N consecutive clocks accessing a primitive, the primitive is also called a burst primitive, and its size is recorded as P×Q×R N , abbreviated as P×Q×R, in the case of R=1, abbreviated as P×Q N or P×Q. Therefore, both burst primitives and non-burst primitives are called primitives. In the case of burst primitives, the primitive size is P×Q×R or P×Q is P×Q×R N or P×Q N Abbreviation of .

[0030] The one or more or N or M×N clock accesses include one or more or N or M×N clock rising edge accesses, or one or more or N or M×N clock falling edge accesses, or one or more or N or M×N clock rising edges plus clock falling edges, that is, one or more or N or M×N dual clock edge accesses.

[0031] Since the memory is accessed with primitives as the smallest unit, when X reference elements are read to generate X reconstructed elements, in the worst case, the X reference elements are scattered in X primitives, which requires X read operations, and each operation takes at least one clock or a burst of N clocks. Therefore, it takes at least X clocks or X×N clocks to read X reference elements to generate X reconstructed elements, resulting in a throughput of generating reconstructed elements that will never exceed 1 element per clock or 1 element per N clocks.

[0032] In the existing string prediction technology, the reference area is usually limited to an area of ​​no more than, for example, 128×128 elements, so that the reference elements can be placed in the on-chip memory, which seriously affects the coding efficiency of the string prediction. Even if placed in the on-chip memory (usually using SRAM), the theoretical worst case can only achieve a reconstruction element throughput of 1 element per clock, which is far from supporting 8K resolution video encoding and decoding. In order to alleviate this problem, in the existing string prediction technology, the length of the string, that is, the number of elements in the string, is limited to a multiple of 4, and the number of strings allowed in an entire compression unit is limited to no more than one-fourth of the total number of elements in the entire compression unit. However, even with these restrictions, the theoretical worst case can only achieve a reconstruction element throughput of 2 elements per clock, which still cannot support 8K resolution video encoding and decoding. When the reference elements are allowed to be placed in the off-chip memory (usually using DRAM), the situation is even worse. The theoretical worst case can only achieve a reconstruction element throughput of 1 element per N clocks of each burst, which cannot support 8K resolution video encoding and decoding, and even cannot support 4K resolution video encoding and decoding. Summary of the invention

[0033] In order to solve this problem in the string prediction technology, so as to significantly improve the coding efficiency of the string prediction and achieve a throughput of reading reference elements far greater than 1 element per clock, the present invention provides a method and device for encoding and decoding that limits the number of primitives occupied or partially occupied by reference elements of a reference string including a reference block, referred to as reference primitives. When string prediction encoding and decoding is performed on an entire compression unit or an entire compression unit group, i.e., at least two entire compression units or a partial entire compression unit forming a group, the number of primitives occupied or partially occupied by reference elements of the entire compression unit or the entire compression unit group or the partial entire compression unit that fall within a predetermined reference area or a sub-area thereof does not exceed a predetermined threshold. After the primitive number limitation is performed, if the size of the reference area remains unchanged, the throughput of reading reference elements can be improved; if the reference area is enlarged, both the coding efficiency of the string prediction and the throughput of reading reference elements can be improved.

[0034] Preferably, the predetermined reference area or a sub-area thereof is divided into a first reference area and a second reference area. the number of primitives occupied or partially occupied by reference elements on the reference string that are completely within the first reference area does not exceed a first set of predetermined thresholds corresponding to a first set of primitive sizes, and / or The number of primitives occupied or partially occupied by reference elements on the reference string partially or fully within the second reference area does not exceed a second set of predetermined thresholds corresponding to a second set of primitive sizes.

[0035] Preferably, the predetermined reference area or its sub-area includes at least part or all of the current maximum compression unit and the K maximum compression units to its left, a total of K+1 maximum compression units, where K is an integer satisfying 0 ≤ K ≤ 256, The first reference area is part or all of the current maximum compression unit and the J maximum compression units to its left, a total of J+1 maximum compression units, where J is an integer satisfying 0 ≤ J < K, The second reference region is a region of the predetermined reference region or a subregion thereof that does not belong to the first reference region.

[0036] Preferably, the maximum compression unit is equally divided into four quarter maximum compression units, namely, upper left, upper right, lower left, and lower right, and the units are encoded and decoded in a predetermined order. The predetermined reference area or its sub-area includes at least part or all of the current quarter maximum compression unit and K quarter maximum compression units before the current quarter maximum compression unit in the coding and decoding order, a total of K+1 quarter maximum compression units, where K is an integer satisfying 0 ≤ K ≤ 512, The first reference area is part or all of the current quarter maximum compression unit and J quarter maximum compression units before the current quarter maximum compression unit in the coding and decoding order, a total of J+1 quarter maximum compression units, where J is an integer satisfying 0 ≤ J < K, The second reference region is a region of the predetermined reference region or a subregion thereof that does not belong to the first reference region.

[0037] Preferably, the predetermined reference area or its sub-area includes at least the current reference unit and part or all of K+1 reference units, which are K reference units before the current reference unit in the coding and decoding order, where K is an integer satisfying 0 ≤ K ≤ 512. The first reference area is part or all of the current reference unit and J reference units before the current reference unit in the coding and decoding order, a total of J+1 reference units, where J is an integer satisfying 0 ≤ J < K, The second reference region is a region of the predetermined reference region or a subregion thereof that does not belong to the first reference region.

[0038] Preferably, the predetermined reference area or its sub-area includes at least the current reference unit and part or all of K+1 reference units, which are K reference units before the current reference unit in the coding and decoding order, where K is an integer satisfying 0 ≤ K ≤ 512; the shape and size of the reference unit are one of the following: equal to the shape and size of the largest compression unit, or, equal to a predetermined shape and size, or, When the width and height of the maximum compression unit are less than or equal to a predetermined value, the shape and size of the maximum compression unit are equal to the predetermined shape and size when the width and height of the maximum compression unit are greater than the predetermined value, or, When the width and height of the maximum compression unit are 16×16 or 32×32 or 64×64, the width and height of the reference unit are equal to the width and height of the maximum compression unit, and when the width and height of the maximum compression unit are 128×128 or 256×256 or 512×512, the width and height of the reference unit are equal to 64×64, or, When the width and height of the maximum compression unit are 16×16 or 32×32 or 64×64 or 128×128, the width and height of the reference unit are equal to the width and height of the maximum compression unit, and when the width and height of the maximum compression unit are 256×256 or 512×512, the width and height of the reference unit are equal to 128×128; The first reference area is part or all of the current reference unit and J reference units before the current reference unit in the coding and decoding order, a total of J+1 reference units, where J is an integer satisfying 0 ≤ J < K, The second reference region is a region of the predetermined reference region or a subregion thereof that does not belong to the first reference region.

[0039] Preferably, the predetermined reference area or its sub-area includes at least the current reference unit and part or all of K+1 reference units, which are K reference units before the current reference unit in the coding and decoding order, wherein K is an integer satisfying 0 ≤ K ≤ 512 and the total number of elements of the K+1 reference units is equal to the number of elements of the M maximum compression unit rows plus the number of elements of the N maximum compression units, wherein M is equal to 0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9, and N is equal to -2 or -1 or 0 or 1 or 2 or 3 or 4; The first reference area is part or all of the current reference unit and J reference units before the current reference unit in the coding and decoding order, a total of J+1 reference units, where J is an integer satisfying 0 ≤ J < K, The second reference region is a region of the predetermined reference region or a subregion thereof that does not belong to the first reference region.

[0040] Preferably, the predetermined reference area or its sub-area includes at least the current reference unit and K reference units before the current reference unit in the coding and decoding order, a total of K+1 reference units, wherein K is an integer satisfying 0 ≤ K ≤ 512 and the total number of elements of the K+1 reference units is equal to the number of elements of the M maximum compression unit rows plus the number of elements of the N reference units, wherein M is equal to 0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9, N is equal to -2×C or -C or 0 or C or 2×C or 3×C or 4×C and C is equal to 1 or 2 or 4 or 8 or 16; The first reference area is part or all of the current reference unit and J reference units before the current reference unit in the coding and decoding order, a total of J+1 reference units, where J is an integer satisfying 0 ≤ J < K, The second reference region is a region of the predetermined reference region or a subregion thereof that does not belong to the first reference region.

[0041] According to one aspect of the present invention, there is provided a coding method or apparatus using at least a predetermined type of string prediction mode, characterized in that it comprises at least steps or modules for performing the following functions and operations: Inputting raw data of at least one whole compression unit or one whole compression unit group, i.e. at least two whole compression units or one partial whole compression unit constituting a group; At least a part or all of the whole compression unit or the whole compression unit group or the part of the whole compression unit are subjected to string prediction coding. In the string prediction coding process, the number of primitives occupied or partially occupied by reference elements of any one of the whole compression unit or the whole compression unit group or the part of the whole compression unit falling within a predetermined reference area or a sub-area thereof, referred to as reference primitives, satisfies a predetermined reference primitive number restriction condition; the predetermined reference primitive number restriction condition includes: the number of reference primitives, referred to as the reference primitive number, does not exceed a predetermined threshold value; Outputting at least the compressed data code stream of the entire compression unit or the entire compression unit group or part of the entire compression unit; The predetermined type of string prediction method includes intra-frame string prediction and / or intra-frame block prediction and / or inter-frame string prediction and / or inter-frame block prediction and / or inter-frame prediction; the primitives include burst primitives and non-burst primitives, and the reference primitives include reference burst primitives and reference non-burst primitives.

[0042] From a first perspective, the present invention provides a coding method using at least a predetermined type of string prediction method, characterized in that it comprises at least the following steps: Inputting raw data of at least one whole compression unit or one whole compression unit group, i.e. at least two whole compression units or one partial whole compression unit constituting a group; At least a part or all of the whole compression unit or the whole compression unit group or the part of the whole compression unit are subjected to string prediction coding. In the string prediction coding process, the number of primitives occupied or partially occupied by reference elements of any one of the whole compression unit or the whole compression unit group or the part of the whole compression unit falling within a predetermined reference area or a sub-area thereof, referred to as reference primitives, satisfies a predetermined reference primitive number restriction condition; the predetermined reference primitive number restriction condition includes: the number of reference primitives, referred to as the reference primitive number, does not exceed a predetermined threshold value; Outputting at least the compressed data code stream of the entire compression unit or the entire compression unit group or part of the entire compression unit; The predetermined type of string prediction method includes intra-frame string prediction and / or intra-frame block prediction and / or inter-frame string prediction and / or inter-frame block prediction and / or inter-frame prediction; the primitives include burst primitives and non-burst primitives, and the reference primitives include reference burst primitives and reference non-burst primitives.

[0043] From a second perspective, the present invention provides an encoding device that adopts at least a predetermined type of string prediction method, characterized in that it includes at least the following modules: Original data input module: inputs original data of at least one whole compression unit or one whole compression unit group, i.e., at least two whole compression units or a partial whole compression unit constituting a group; A string prediction coding module: at least a part or all of the whole compression unit or the whole compression unit group or the part of the whole compression unit is subjected to string prediction coding. In the string prediction coding process, the number of primitives occupied or partially occupied by the reference elements of any one of the whole compression unit or the whole compression unit group or the part of the whole compression unit falling within the predetermined reference area or its sub-area, referred to as reference primitives, satisfies a predetermined reference primitive number restriction condition; the predetermined reference primitive number restriction condition includes: the number of the reference primitives, referred to as the reference primitive number, does not exceed a predetermined threshold value; A compressed data code stream output module: outputs at least the compressed data code stream of the entire compression unit or the entire compression unit group or part of the entire compression unit; The predetermined type of string prediction method includes intra-frame string prediction and / or intra-frame block prediction and / or inter-frame string prediction and / or inter-frame block prediction and / or inter-frame prediction; the primitives include burst primitives and non-burst primitives, and the reference primitives include reference burst primitives and reference non-burst primitives.

[0044] According to another aspect of the present invention, there is also provided a decoding method or device using at least a predetermined type of string prediction mode, characterized in that it includes at least steps or modules to perform the following functions and operations: At least one whole compression unit or one whole compression unit group, i.e., a compressed data code stream of at least two whole compression units or a partial whole compression unit, is input; At least a part or all of the whole compression unit or the whole compression unit group or the part of the whole compression unit are subjected to string prediction decoding. In the string prediction decoding process, the number of primitives occupied or partially occupied by reference elements of any one of the whole compression unit or the whole compression unit group or the part of the whole compression unit falling within a predetermined reference area or a sub-area thereof, referred to as reference primitives, satisfies a predetermined reference primitive number restriction condition; the predetermined reference primitive number restriction condition includes: the number of reference primitives, referred to as the reference primitive number, does not exceed a predetermined threshold value; outputting at least the reconstructed elements of the entire compression unit or the entire compression unit group or part of the entire compression unit; The predetermined type of string prediction method includes intra-frame string prediction and / or intra-frame block prediction and / or inter-frame string prediction and / or inter-frame block prediction and / or inter-frame prediction; the primitives include burst primitives and non-burst primitives, and the reference primitives include reference burst primitives and reference non-burst primitives.

[0045] From a third perspective, the present invention provides a decoding method using at least a predetermined type of string prediction method, characterized in that it comprises at least the following steps: At least one whole compression unit or one whole compression unit group, i.e., a compressed data code stream of at least two whole compression units or a partial whole compression unit, is input; At least a part or all of the whole compression unit or the whole compression unit group or the part of the whole compression unit are subjected to string prediction decoding. In the string prediction decoding process, the number of primitives occupied or partially occupied by reference elements of any one of the whole compression unit or the whole compression unit group or the part of the whole compression unit falling within a predetermined reference area or a sub-area thereof, referred to as reference primitives, satisfies a predetermined reference primitive number restriction condition; the predetermined reference primitive number restriction condition includes: the number of reference primitives, referred to as the reference primitive number, does not exceed a predetermined threshold value; outputting at least the reconstructed elements of the entire compression unit or the entire compression unit group or part of the entire compression unit; The predetermined type of string prediction method includes intra-frame string prediction and / or intra-frame block prediction and / or inter-frame string prediction and / or inter-frame block prediction and / or inter-frame prediction; the primitives include burst primitives and non-burst primitives, and the reference primitives include reference burst primitives and reference non-burst primitives.

[0046] From a fourth perspective, the present invention provides a decoding device that uses at least a predetermined type of string prediction method, characterized in that it includes at least the following modules: Compressed data code stream input module: input at least one whole compression unit or one whole compression unit group, i.e., a compressed data code stream of at least two whole compression units or a partial whole compression unit constituting a group; A string prediction decoding module: performing string prediction decoding on at least a part or all of the whole compression units or the part of the whole compression units, wherein during the string prediction decoding process, the number of primitives occupied or partially occupied by reference elements of any one of the whole compression units or the whole compression unit group or the part of the whole compression units falling within a predetermined reference area or a sub-area thereof, referred to as reference primitives, satisfies a predetermined reference primitive number restriction condition; the predetermined reference primitive number restriction condition includes: the number of reference primitives, referred to as the reference primitive number, does not exceed a predetermined threshold value; Reconstruction element output module: output at least the reconstruction element of the entire compression unit or the entire compression unit group or part of the entire compression unit; The predetermined type of string prediction method includes intra-frame string prediction and / or intra-frame block prediction and / or inter-frame string prediction and / or inter-frame block prediction and / or inter-frame prediction; the primitives include burst primitives and non-burst primitives, and the reference primitives include reference burst primitives and reference non-burst primitives.

[0047] The present invention also provides an electronic device, comprising 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 the string prediction encoding method or encoding device or decoding method or decoding device as described above or any one of the various embodiments thereof described below.

[0048] The present invention also provides a computer-readable storage medium, in which at least one instruction, at least one program, code set or instruction set is stored, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the string prediction encoding method or encoding device or decoding method or decoding device as described above or any one of the various embodiments described below.

[0049] 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.

[0050] In the present invention, the data involved in data compression includes one or a combination of the following types of data: One-dimensional data; Two-dimensional data; Multidimensional data; Graphics; Fractal graphics; image; A sequence of images; video; Audio; document; byte; Bit; Pixels; 3D scenes; Sequences of continuously changing three-dimensional scenes; Virtual reality scenes; A sequence of continuously changing virtual reality scenes Images in pixel form; Transform domain data of the image; A collection of bytes of two or more dimensions; A collection of bits of two or more dimensions; A collection of pixels; A collection of single-component pixels; A collection of three-component pixels (R, G, B, A); A collection of three-component pixels (Y, U, V); A collection of three-component pixels (Y, Cb, Cr); A collection of three-component pixels (Y, Cg, Co); A collection of four-component pixels (C, M, Y, K); A collection of four-component pixels (R, G, B, A); A collection of four-component pixels (Y, U, V, A); A set of four-component pixels (Y, Cb, Cr, A); A collection of four-component pixels (Y, Cg, Co, A).

[0051] 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. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 (a) is an example of a 128×128 maximum compression unit divided into tree blocks and its parent node blocks.

[0053] Figure 1 (b) is a schematic diagram of the encoding method or device of the present invention.

[0054] Figure 1 (c) is a schematic diagram of the decoding method or device of the present invention.

[0055] Figure 1 (d) shows four examples of parent node block pairs. Implementation

[0056] The following are more implementation details of the present invention.

[0057] Embodiment 1. In the encoding method or encoding device or decoding method or decoding device, when the original data is an array or a sequence of arrays of two-dimensional data elements including an image, a sequence of images, or a video, The string prediction methods include intra-frame string prediction, intra-frame block prediction, inter-frame string prediction, inter-frame block prediction, inter-frame prediction, block-intra-frame prediction, block-inter-frame prediction, block-geometry block prediction, and block-local illumination compensation prediction; The predetermined type of string prediction mode is intra-frame string prediction and intra-frame block prediction, or intra-frame string prediction, intra-frame block prediction, and inter-frame prediction, or intra-frame string prediction, intra-frame block prediction, inter-frame string prediction, and inter-frame prediction, or intra-frame string prediction, intra-frame block prediction, inter-frame prediction, block-intra-frame prediction, block-inter-frame prediction, block-geometry block prediction, and / or block-local illumination compensation prediction; The compressed subsets involved in string prediction include images, sub-images of images, tiles, slices, and patches; The largest compression units involved in string prediction include tiles, LCUs, and CTUs. The whole compression unit includes a macroblock, a coding unit CU, a sub-region of a CU, a sub-coding unit SubCU, a prediction block, a prediction unit PU, a sub-region of a PU, a sub-prediction unit SubPU, a transform block, a transform unit TU, a sub-region of a TU, and a sub-transform unit SubTU; The shape of the whole compression unit includes square, rectangle, triangle, quadrilateral, trapezoid, polygon; The shapes of the partially integral compression units include square, rectangle, triangle, quadrilateral, trapezoid, and polygon.

[0058] Example 2. Example 1 of the size of the primitive In the encoding method or encoding device or decoding method or decoding device, The size of the primitive is P×Q×R, where P, Q, and R are integers satisfying 1 ≤ P ≤ 64, 1 ≤ Q ≤ 64, and 1 ≤ R ≤ 16.

[0059] Example 3. Example 2 of the size of the primitive In the encoding method or encoding device or decoding method or decoding device, The size of the primitive is 2 p ×2 q ×2 r , where p, q, r are integers satisfying 0 ≤ p ≤ 6, 0 ≤ q ≤ 6, 0 ≤ r ≤ 4.

[0060] Example 4. Example 3 of the size of the primitive In the encoding method or encoding device or decoding method or decoding device, The size of the primitive includes one or a combination of the following: P×Q, indicating that one primitive is a P×Q basic block; Or, P×Q×2, which means that one primitive is two P×Q blocks adjacent to each other on the left and right or two P×Q blocks adjacent to each other on the top and bottom; Or, P×Q×4, which means that one primitive is four P×Q blocks adjacent to each other in the top, bottom, left and right directions.

[0061] Example 5. Example 4 of the size of the primitive In the encoding method or encoding device or decoding method or decoding device, The size of the primitive includes one or a combination of the following: P×Q, indicating that one primitive is a P×Q basic block; Or, P×Q×2, which means that one primitive is two P×Q blocks adjacent to each other on the left and right or two P×Q blocks adjacent to each other on the top and bottom; Or, P×Q×4, which means that one primitive is four P×Q blocks adjacent to each other above, below, left, and right; Among them, P×Q is 4×1; or, P×Q is 4×2; or, P×Q is 4×4; or, P×Q is 8×1; or, P×Q is 8×2; or, P×Q is 8×8; or, P×Q is 16×8; or, P×Q is 16×16; or, P×Q is 8×16; or, P×Q is 32×16; or, P×Q is 32×32; or, P×Q is 16×32.

[0062] Example 6. Example 1 of a predetermined threshold value In the encoding method or encoding device or decoding method or decoding device, The predetermined threshold is S / 128 of the total number of elements of the entire compression unit or the entire compression unit group or the partial entire compression unit that adopt the predetermined type of string prediction method, where S is an integer satisfying 1 ≤ S ≤ 64; or, The predetermined threshold is S / 256 of the total number of elements of the entire compression unit or the entire compression unit group or the partial entire compression unit that adopt the predetermined type of string prediction method, where S is an integer satisfying 1 ≤ S ≤ 128; or, The predetermined threshold is S / 512 of the total number of elements of the entire compression unit or the entire compression unit group or part of the entire compression unit that adopts the predetermined type of string prediction method, where S is an integer satisfying 1 ≤ S ≤ 256.

[0063] Example 7. Example 2 of a predetermined threshold value In the encoding method or encoding device or decoding method or decoding device, The predetermined threshold is S / T of the total number of elements of the entire compression unit or the entire compression unit group or part of the entire compression unit using the predetermined type of string prediction method, wherein S / T includes one of the following situations or a combination thereof: 1 / 2=64 / 128 or 3 / 8=48 / 128 or 1 / 4=32 / 128 or 3 / 16=24 / 128 or 5 / 32=20 / 128 or 1 / 8=16 / 128 or 3 / 32=12 / 128 or 1 / 16=8 / 128 or 1 / 32=4 / 128 or 1 / 64=2 / 128 or (2s+1) / 256, wherein s is an integer greater than 0 and less than 64.

[0064] Example 8. Example 1 of a predetermined reference area In the encoding method or encoding device or decoding method or decoding device, The predetermined reference area or its sub-area includes at least part or all of the current maximum compression unit and the K maximum compression units to its left, a total of K+1 maximum compression units, where K is an integer satisfying 0 ≤ K ≤ 256; or, In the encoding method or encoding device or decoding method or decoding device, The maximum compression unit is divided into four equal parts: upper left, upper right, lower left, and lower right, and encoded and decoded in a predetermined order. The predetermined reference area or its sub-area includes at least part or all of the current quarter maximum compression unit and K quarter maximum compression units before the current quarter maximum compression unit in the coding and decoding order, namely, K+1 quarter maximum compression units, where K is an integer satisfying 0 ≤ K ≤ 2048; or, In the encoding method or encoding device or decoding method or decoding device, The predetermined reference area or its sub-area includes at least a current reference unit and a part or all of K+1 reference units of K reference units before the current reference unit in a coding and decoding order, where K is an integer satisfying 0 ≤ K ≤ 2048; or, In the encoding method or encoding device or decoding method or decoding device, The predetermined reference area or its sub-area includes at least the current reference unit and part or all of K+1 reference units of K reference units preceding the current reference unit in the coding and decoding order, where K is an integer satisfying 0 ≤ K ≤ 2048; the shape and size of the reference unit are one of the following: is equal to the shape and size of the largest compression unit, or Equal to the predetermined shape and size, or When the width and height of the maximum compression unit are less than or equal to a predetermined value, the shape and size of the maximum compression unit are equal to the shape and size of the maximum compression unit, and when the width and height of the maximum compression unit are greater than the predetermined value, the shape and size of the maximum compression unit are equal to the predetermined shape and size. or When the width and height of the maximum compression unit are 16×16 or 32×32 or 64×64, the width and height of the reference unit are equal to the width and height of the maximum compression unit, and when the width and height of the maximum compression unit are 128×128 or 256×256 or 512×512, the width and height of the reference unit are equal to 64×64. or When the width and height of the maximum compression unit are 16×16 or 32×32 or 64×64 or 128×128, the width and height of the reference unit are equal to the width and height of the maximum compression unit, and when the width and height of the maximum compression unit are 256×256 or 512×512, the width and height of the reference unit are equal to 128×128; or, In the encoding method or encoding device or decoding method or decoding device, The predetermined reference area or its sub-area includes at least a current reference unit and K reference units before the current reference unit in a coding and decoding order, a total of K+1 reference units, where K is an integer satisfying 0 ≤ K ≤ 2048 and the total number of elements of the K+1 reference units is equal to the number of elements of the M maximum compression unit rows plus the number of elements of the N maximum compression units, where M is an integer greater than or equal to 0 and less than or equal to 16, and N is an integer greater than or equal to -2 and less than or equal to 4; or, In the encoding method or encoding device or decoding method or decoding device, The predetermined reference area or its sub-area includes at least the current reference unit and part or all of K+1 reference units, which are K reference units before the current reference unit in the coding and decoding order, wherein K is an integer satisfying 0 ≤ K ≤2048 and the total number of elements of the K+1 reference units is equal to the number of elements of the M maximum compression unit rows plus the number of elements of the N reference units, wherein M is an integer greater than or equal to 0 and less than or equal to 16, N is equal to -2×C or -C or 0 or C or 2×C or 3×C or 4×C and C is equal to 1 or 2 or 4 or 8 or 16.

[0065] Example 9. Example 2 of a predetermined reference area In the encoding method or encoding device or decoding method or decoding device, The predetermined reference area is part or all of the current largest compression unit row.

[0066] Example 10, Example 3 of Predetermined Reference Area In the encoding method or encoding device or decoding method or decoding device, The predetermined reference area or its sub-area includes at least part or all of the current maximum compression unit row and the L maximum compression unit rows above it, a total of L+1 maximum compression unit rows, where L is an integer satisfying 0 ≤ L ≤ 128.

[0067] Example 11. There are multiple different primitive sizes and multiple predetermined thresholds In the encoding method or encoding device or decoding method or decoding device, The predetermined reference area or its sub-areas are divided into multiple different primitive sizes at the same time. The predetermined threshold includes a plurality of thresholds, which respectively correspond to and are applicable to the plurality of different primitive sizes. The reference string of the entire compression unit or the entire compression unit group or part of the entire compression unit and its reference elements simultaneously meet the restrictions specified by the multiple different primitive sizes and the corresponding predetermined thresholds.

[0068] Example 12. Example 1 with multiple primitive sizes and multiple predetermined thresholds In the encoding method or encoding device or decoding method or decoding device described in Embodiment 11, The multiple different primitive sizes and the corresponding predetermined thresholds include at least a combination of any two, three, four, five, six, seven or eight of the following eight primitive sizes and their thresholds: The primitive size is P 1 ×Q 1 ×R 1 The threshold is S of the total number of elements of the whole compression unit or the whole compression unit group or the part of the whole compression unit 1 / 512, 1 ≤ S 1 ≤ 256, The primitive size is P 2 ×Q 2 ×R 2 The threshold is S of the total number of elements of the whole compression unit or the whole compression unit group or the part of the whole compression unit 2 / 512, 1 ≤ S 2 ≤ 256, The primitive size is P 3 ×Q 3 ×R 3 The threshold is S of the total number of elements of the whole compression unit or the whole compression unit group or the part of the whole compression unit 3 / 512, 1 ≤ S 3 ≤ 256, The primitive size is P 4 ×Q 4 ×R 4 The threshold is S of the total number of elements of the whole compression unit or the whole compression unit group or the part of the whole compression unit 4 / 512, 1 ≤ S 4 ≤ 256, The primitive size is P 5 ×Q 5 ×R 5 The threshold is S of the total number of elements of the whole compression unit or the whole compression unit group or the part of the whole compression unit 5 / 512, 1 ≤ S 5 ≤ 256, The primitive size is P 6 ×Q 6 ×R 6 The threshold is S of the total number of elements of the whole compression unit or the whole compression unit group or the part of the whole compression unit 6 / 512, 1 ≤ S 6 ≤ 256, The primitive size is P 7 ×Q 7 ×R 7 The threshold is S of the total number of elements of the whole compression unit or the whole compression unit group or the part of the whole compression unit 7 / 512, 1 ≤ S 7 ≤ 256, The primitive size is P 8 ×Q 8 ×R 8 The threshold is S of the total number of elements of the whole compression unit or the whole compression unit group or the part of the whole compression unit 8 / 512, 1 ≤ S 8 ≤ 256.

[0069] Example 13. Example 2 with multiple primitive sizes and multiple predetermined thresholds In the encoding method or encoding device or decoding method or decoding device described in Embodiment 11, The multiple different primitive sizes and the corresponding predetermined thresholds include at least a combination of any two, three, four, five, six, seven or eight of the following eight primitive sizes and their thresholds: The primitive size is 4×1, the threshold is 3 / 8 of the total number of elements of the whole compression unit or whole compression unit group, The primitive size is 4×1×2, the threshold is 3 / 16 of the total number of elements of the whole compression unit or whole compression unit group, The primitive size is 4×2, the threshold is 1 / 4 of the total number of elements of the whole compression unit or whole compression unit group, The primitive size is 4×2×2, the threshold is 1 / 8 of the total number of elements of the whole compression unit or whole compression unit group, The primitive size is 4×4, the threshold is 3 / 16 of the total number of elements of the whole compression unit or whole compression unit group, The primitive size is 8×1, the threshold is 1 / 4 of the total number of elements of the whole compression unit or whole compression unit group, The primitive size is 8×1×2, the threshold is 1 / 8 of the total number of elements of the whole compression unit or whole compression unit group, The primitive size is 8×2, and the threshold is 3 / 16 of the total number of elements of the entire compression unit or the entire compression unit group.

[0070] Embodiment 14: The reference region or its sub-region is divided into a first reference region and a second reference region. In the encoding method or encoding device or decoding method or decoding device, The predetermined reference area or its sub-area is divided into a first reference area and a second reference area, and the predetermined reference primitive number restriction condition further includes the following condition 1 and / or condition 2: Condition 1: the number of primitives occupied or partially occupied by reference elements on the reference string completely within the first reference region does not exceed a first set of predetermined thresholds corresponding to a first set of primitive sizes, Condition 2: The number of primitives occupied or partially occupied by reference elements on the reference string that are partially or entirely within the second reference area does not exceed a second set of predetermined thresholds corresponding to a second set of primitive sizes.

[0071] Example 15 Example 1 in which a reference region or a sub-region thereof is divided into a first reference region and a second reference region In the encoding method or encoding device or decoding method or decoding device described in Embodiment 14, The predetermined reference area or its sub-area includes at least part or all of the current maximum compression unit and the K maximum compression units to its left, which is K+1 maximum compression units in total, where K is an integer satisfying 0 ≤ K ≤ 256. The first reference area includes part or all of the current maximum compression unit and J maximum compression units to its left, a total of J+1 maximum compression units, where J is an integer satisfying 0 ≤ J < K, The second reference area is an area of ​​the predetermined reference area or a sub-area thereof that does not belong to the first reference area; Alternatively, in the encoding method or encoding device or decoding method or decoding device described in Embodiment 14, The predetermined reference area or its sub-area includes at least part or all of the current maximum compression unit row and the L maximum compression unit rows above it, a total of L+1 maximum compression unit rows, where L is an integer satisfying 0 ≤ L ≤ 128, and The maximum compression unit is divided into four equal parts: upper left, upper right, lower left, and lower right, and encoded and decoded in a predetermined order. Part or all of the L+1 maximum compression unit rows include at least the current quarter maximum compression unit and K quarter maximum compression units before the current quarter maximum compression unit in the coding and decoding order, a total of K+1 quarter maximum compression units, where K is an integer satisfying 0 ≤ K ≤ 2048, The first reference area includes part or all of the current quarter-maximum compression unit and J quarter-maximum compression units before the current quarter-maximum compression unit in the coding and decoding order, namely, J+1 quarter-maximum compression units, where J is an integer satisfying 0 ≤ J < K, The second reference area is an area of ​​the predetermined reference area or a sub-area thereof that does not belong to the first reference area; Alternatively, in the encoding method or encoding device or decoding method or decoding device described in Embodiment 14, The predetermined reference area or its sub-area includes at least part or all of the current maximum compression unit row and the L maximum compression unit rows above it, a total of L+1 maximum compression unit rows, where L is an integer satisfying 0 ≤ L ≤ 128, and Part or all of the L+1 maximum compression unit rows at least include the current reference unit and part or all of K+1 reference units, which are K reference units before the current reference unit in the coding and decoding order, wherein K is an integer satisfying 0 ≤ K ≤ 2048, The first reference area includes part or all of the current reference unit and J reference units before the current reference unit in a coding order, namely, J+1 reference units, where J is an integer satisfying 0 ≤ J < K. The second reference area is an area of ​​the predetermined reference area or a sub-area thereof that does not belong to the first reference area; Alternatively, in the encoding method or encoding device or decoding method or decoding device described in Embodiment 14, The predetermined reference area or its sub-area includes at least part or all of the current maximum compression unit row and the L maximum compression unit rows above it, a total of L+1 maximum compression unit rows, where L is an integer satisfying 0 ≤ L ≤ 128, and Part or all of the L+1 maximum compression unit rows include at least the current reference unit and part or all of K+1 reference units, which are K reference units before the current reference unit in the coding and decoding order, where K is an integer satisfying 0 ≤ K ≤ 2048; the shape and size of the reference unit are one of the following: is equal to the shape and size of the largest compression unit, or Equal to the predetermined shape and size, or When the width and height of the maximum compression unit are less than or equal to a predetermined value, the shape and size of the maximum compression unit are equal to the shape and size of the maximum compression unit, and when the width and height of the maximum compression unit are greater than the predetermined value, the shape and size of the maximum compression unit are equal to the predetermined shape and size. or When the width and height of the maximum compression unit are 16×16 or 32×32 or 64×64, the width and height of the reference unit are equal to the width and height of the maximum compression unit, and when the width and height of the maximum compression unit are 128×128 or 256×256 or 512×512, the width and height of the reference unit are equal to 64×64. or When the width and height of the maximum compression unit are 16×16 or 32×32 or 64×64 or 128×128, the width and height of the reference unit are equal to the width and height of the maximum compression unit, and when the width and height of the maximum compression unit are 256×256 or 512×512, the width and height of the reference unit are equal to 128×128; The first reference area includes part or all of the current reference unit and J reference units before the current reference unit in a coding order, namely, J+1 reference units, where J is an integer satisfying 0 ≤ J < K. The second reference area is an area of ​​the predetermined reference area or a sub-area thereof that does not belong to the first reference area; Alternatively, in the encoding method or encoding device or decoding method or decoding device described in Embodiment 14, The predetermined reference area or its sub-area includes at least a current reference unit and K reference units before the current reference unit in a coding and decoding order, a total of K+1 reference units, where K is an integer satisfying 0 ≤ K ≤ 2048 and the total number of elements of the K+1 reference units is equal to the number of elements of the M maximum compression unit rows plus the number of elements of the N maximum compression units, where M is an integer greater than or equal to 0 and less than or equal to 16, and N is an integer greater than or equal to -2 and less than or equal to 4; The first reference area includes part or all of the current reference unit and J reference units before the current reference unit in a coding order, namely, J+1 reference units, where J is an integer satisfying 0 ≤ J < K. The second reference area is an area of ​​the predetermined reference area or a sub-area thereof that does not belong to the first reference area; Alternatively, in the encoding method or encoding device or decoding method or decoding device described in Embodiment 14, The predetermined reference area or a sub-area thereof includes at least a current reference unit and K reference units before the current reference unit in a coding and decoding order, a total of K+1 reference units, wherein K is an integer satisfying 0 ≤ K ≤ 512 and a total number of elements of the K+1 reference units is equal to the number of elements of the M maximum compression unit rows plus the number of elements of the N reference units, wherein M is an integer greater than or equal to 0 and less than or equal to 16, N is equal to -2×C or -C or 0 or C or 2×C or 3×C or 4×C and C is equal to 1 or 2 or 4 or 8 or 16; The first reference area includes part or all of the current reference unit and J reference units before the current reference unit in a coding order, namely, J+1 reference units, where J is an integer satisfying 0 ≤ J < K. The second reference region is a region of the predetermined reference region or a subregion thereof that does not belong to the first reference region.

[0072] Example 16 Example of the first and second groups of primitive sizes when the reference area is divided into a first reference area and a second reference area In the encoding method or encoding device or decoding method or decoding device described in embodiment 14 or 15, The width and height of all primitive sizes in the first set of primitive sizes are less than or equal to 8, The width and / or height of all primitive sizes in the second set of primitive sizes is greater than or equal to 8, or, The first group of primitive sizes includes at least one of the following 15 primitive sizes or any combination thereof: 4×1×R, 4×2×R, 4×4×R, 8×1×R, 8×2×R, where R is equal to 1 or 2 or 4, The second group of primitive sizes includes at least one of the following 21 primitive sizes or any combination thereof: 8x8×R, 16×8×R, 16×16×R, 8×16×R, 32×16×R, 32×32×R, 16×32×R, where R is equal to 1 or 2 or 4.

[0073] Example 17. Example 1 of a whole compression unit group, whole compression units having the same parent node block or parent node block pair The encoding method or encoding device or decoding method or decoding device further includes one of the following features or any combination thereof: Feature 1: The entire compression unit group is composed of non-overlapping entire compression units that partially or completely adopt the predetermined type of string prediction method, which are generated from the same parent node block or parent node block pair that meets the predetermined conditions through one-level or multi-level division or no division; in this case, the parent node block or parent node block pair is a synonym for the entire compression unit group; the parent node block pair is composed of two parent node blocks, respectively called the first parent node block and the second parent node block, and the two parent node blocks are allowed to have the same nominal number of elements, that is, the width multiplied by the height of the block, such as Figure 1 (d) as shown; the nominal number of elements of the parent node block pair is equal to the sum of the width and height of the first parent node block and the width and height of the second parent node block; in the case of no division, only one whole compression unit is actually generated from the parent node block, and the whole compression unit group consists of only one whole compression unit; Feature 2: In Feature 1 or Features 4, 5, and 7 below, the predetermined condition includes one of the following conditions or any combination thereof: Condition 1: The width of the parent node block is one of the following values ​​or any combination thereof: W = 2 w , where 3≤w≤10, Condition 2: The height of the parent node block is one of the following values ​​or any combination thereof: H = 2 h , where 3≤h≤10, Condition 3: The nominal number of elements of the parent node block, i.e., the width multiplied by the height, or the nominal number of elements of the parent node block pair is one of the following values ​​or any combination thereof: P = 2 p , where 6≤p≤20 or P is greater than or equal to 2 6 and less than or equal to 2 20 integer, Condition 4: No condition; Feature 3: Based on Feature 2, w = 6, h = 6, p = 10 or P = 1024; Feature 4: On the basis of Feature 1, the number of reference primitives occupied or partially occupied by a parent node block or a parent node block pair whose width is greater than or equal to a predetermined W and whose height is greater than or equal to a predetermined H or whose nominal element number is greater than or equal to a predetermined W times H satisfies a predetermined reference primitive number restriction condition C, and the number of reference primitives occupied or partially occupied by the parent node block or the parent node block pair is the sum of the numbers of reference primitives occupied or partially occupied by each integral compression unit in the integral compression unit group, i.e., the cumulative number; Feature 4-1: Based on Feature 4, W = 2 6 , H = 2 6 ; or, W = 2 7 , H = 2 7 ; Feature 5: On the basis of Feature 1, the number of reference primitives occupied or partially occupied by a parent node block or a parent node block pair whose width multiplied by height is equal to a predetermined P or whose nominal element number is equal to a predetermined P satisfies a predetermined reference primitive number restriction condition D, and the number of reference primitives occupied or partially occupied by the parent node block or the parent node block pair is the sum of the numbers of reference primitives occupied or partially occupied by each integral compression unit in the integral compression unit group, i.e., the cumulative number; Feature 5-1: Based on Feature 5, P = 1024; or, P = 2048; or, P = 4096; Feature 6: The number of reference primitives occupied or partially occupied by the whole compression unit satisfies a predetermined reference primitive number restriction condition E. If a whole compression unit does not adopt the predetermined type of string prediction method, the number of reference primitives occupied or partially occupied by it is zero; Feature 7: For an entire compression unit whose width multiplied by height is greater than or equal to a predetermined P, the number of reference primitives occupied or partially occupied is limited by the entire compression unit itself, that is, the number of reference primitives occupied or partially occupied by the entire compression unit satisfies the predetermined reference primitive number restriction condition F; for an entire compression unit whose width multiplied by height is less than a predetermined P, the number of reference primitives occupied or partially occupied is limited by the largest parent node block whose width multiplied by height is less than a predetermined P, that is, the entire compression unit group is composed of non-overlapping entire compression units that partially or completely adopt the predetermined type of string prediction method and are generated from the largest parent node block through one or more levels of division or without division; in this case, the largest parent node block and the entire compression unit group are synonymous; the number of reference primitives occupied or partially occupied by the largest parent node block satisfies the predetermined reference primitive number restriction condition G, and the number of reference primitives occupied or partially occupied by the largest parent node block is the sum of the numbers of reference primitives occupied or partially occupied by each entire compression unit in the entire compression unit group, that is, the cumulative number; Feature 7-1: Based on Feature 7, P = 2048, that is, the size of the whole compression unit for limiting the number of reference primitives in units of the whole compression unit itself is 64×32 or 32×64 or 64×64 or larger, and the size of the largest parent node block for limiting the number of reference primitives in units of whole compression unit groups is 32×32 or 64×16 or 16×64 or 32×16 or 16×32; Feature 8: having at least two of the features 4, 5, 6, and 7 at the same time, wherein the conditions specified in the feature 5 that allows two or more items to have different P and D are all satisfied by the entire compression unit group, i.e., the parent node block or parent node block pair; Feature 9: Based on Feature 8, the at least two features include I features 4, where I = 0 or 1 and I = 0 indicates that Feature 4 is not included; the at least two features include J features 5, where J satisfies 0 ≤ J ≤ 5 and J = 0 indicates that Feature 5 is not included; when J > 0, P and D in the jth feature 5, 1 ≤ j ≤ J, are denoted as P j and D j ; The at least two features include K features 6, wherein K = 0 or 1 and K = 0 means that feature 6 is not included; The at least two features include L features 7, wherein L = 0 or 1 and L = 0 means that feature 7 is not included; Feature 9-1: Based on Feature 9, if I = 1, then W = H = 64; if J = 1, then P = 1024; if J = 2, then P 1 = 1024, P 2 = 256, and the corresponding D is denoted as D 1 , D 2 ; If J = 3, then P 1 = 1024, P 2 = 512, P 3 = 256, or P 1 = 1024, P 2 = 256, P 3 = 64, and the corresponding D is denoted as D 1 , D 2 , D 3 ; If L = 1, then P = 2048; Feature 10: In addition to Feature 9 or 9-1, When I > 0, the restriction condition C includes that the number of reference primitives occupied or partially occupied by the parent node block or parent node block pair does not exceed Sc / 512 of the total number of elements of each whole compression unit in the whole compression unit group, where Sc is an integer satisfying 1 ≤ Sc ≤ 256; When J > 0, the constraint D j , 1 ≤ j ≤ J, including the number of reference primitives occupied or partially occupied by the parent node block or parent node block pair does not exceed Sd of the total number of elements of each integral compression unit in the integral compression unit group j / 512, where Sd j is satisfied that 1 ≤ Sd j Integer ≤ 256; When K > 0, the restriction condition E includes that the number of reference primitives occupied or partially occupied by the entire compression unit does not exceed Se / 512 of the total number of elements of the entire compression unit, where Se is an integer satisfying 1 ≤ Se ≤ 256; When L > 0, the restriction condition F includes that the number of reference primitives occupied or partially occupied by the whole compression unit does not exceed Sfg / 512 of the total number of elements of the whole compression unit, where Sfg is an integer satisfying 1 ≤ Sfg ≤ 256; the restriction condition G includes that the number of reference primitives occupied or partially occupied by the largest parent node block does not exceed Sfg / 512 of the total number of elements of each whole compression unit in the whole compression unit group; Feature 10-1: In addition to Feature 10, When I > 0 and J > 0, W, H, P 1 Satisfy W×H > P 1 , Sc and Sd 1 Satisfies Sc < Sd 1 ; When J > 1, P j Satisfy P j > P j+1 , Sd j Meet Sd j < Sd j+1 , 1 ≤ j ≤ J - 1; When J > 0 and K > 0, Sd J and Se satisfies Sd J ≤ Se; When I > 0 and K > 0, Sc and Se satisfy Sc < Se; When L > 0, Sf = Sg; When I > 0 and L > 0, Sc = Sf = Sg; Feature 11: Based on Feature 10, when I > 0, W = 64 and H = 64, Sc = 16, i.e., Sc / 512 = 1 / 32; when J > 0, P 1 = 1024 (= 32×32 = 16×64 = 64×16 = 8×128 = 128×8 = 16×32+32×16), Sd 1 = 32, i.e. Sd 1 / 512 = 2 / 32 = 1 / 16, when J > 1, P 2 = 512 (= 16×32 = 32×16 = 64×8 = 8×64), Sd 2 = 48, i.e. Sd 2 / 512 = 3 / 32, or P 2 = 256 (= 16×16 = 32×8 =8×32 = 8×16+16×8), Sd 2 = 48, i.e. Sd 2 / 512 = 3 / 32 or Sd 2 = 64, i.e. Sd 2 / 512 = 1 / 8; when K > 0, Se = 64, i.e. Se / 512 = 1 / 8; when L > 0, Sfg = 16, i.e. Sfg / 512 = 1 / 32.

[0074] Example 18. Example 2 of the entire compression unit group The encoding method or encoding device or decoding method or decoding device further includes one or any combination of the following features: The whole compression unit group is composed of part or all of the whole compression units encoded using intra-frame string prediction and / or intra-frame block prediction and / or inter-frame prediction in a maximum compression unit; or, The whole compression unit group is composed of part or all of the whole compression units encoded using intra-frame string prediction and / or intra-frame block prediction and / or inter-frame prediction in one quarter of the largest compression unit; or, The whole compression unit group is composed of part or all of the whole compression units encoded using string prediction in a maximum compression unit; or, The whole compression unit group is composed of part or all of the whole compression units encoded using string prediction in one quarter of the maximum compression unit; or, The whole compression unit group is composed of part or all of the whole compression units in a largest compression unit; or, The whole compression unit group is composed of part or all of the whole compression units in a quarter maximum compression unit.

[0075] Embodiment 19: A small-size integer compression unit limits the number of reference primitives in units of parent node blocks In the encoding method or encoding device or decoding method or decoding device, The whole compression unit is divided into three categories according to its size or number of elements: the number of elements of the first kind of whole compression unit is greater than the number of elements of the second kind of whole compression unit, the number of elements of the second kind of whole compression unit is greater than the number of elements of the third kind of whole compression unit, and the third kind of whole compression unit is allowed to be empty, that is, the whole compression unit is actually divided into two categories according to its size or number of elements; The first or third type of whole compression unit limits the number of primitives occupied or partially occupied by the reference element with the current whole compression unit as the limiting unit: the number of primitives occupied or partially occupied by the reference element of a whole compression unit of the first or third type falling within the predetermined reference area or its sub-area does not exceed a predetermined threshold; The second type of whole compression unit limits the number of primitives occupied or partially occupied by reference elements using its parent node block as the limiting unit: for an entire compression unit of the second type, the sum of the numbers of primitives occupied or partially occupied by reference elements falling within a predetermined reference area or its sub-area of ​​at least all the entire compression units encoded and decoded in a string prediction manner generated after the division of its parent node block, that is, the cumulative number, does not exceed a predetermined threshold.

[0076] Embodiment 20 Example 1 of limiting the number of reference primitives in a small-size integral compression unit in units of parent node blocks In the encoding method or encoding device or decoding method or decoding device described in Embodiment 19, The first type of integral compression unit is an integral compression unit whose size is not equal to 8×4, 4×8, or 4×4. The second type of integral compression unit is an integral compression unit with a size of 8×4 or 4×8. The third type of integral compression unit is an integral compression unit having a size equal to 4×4.

[0077] Example 21 Example 2 of limiting the number of reference primitives in a small-size integer compression unit in units of parent node blocks In the encoding method or encoding device or decoding method or decoding device described in Embodiment 19, The first type of integral compression unit is an integral compression unit whose size is not equal to 8×4 nor equal to 4×8. The second type of integral compression unit is an integral compression unit with a size of 8×4 or 4×8. The third type of integer compression unit is empty, that is, there is no third type of integer compression unit.

[0078] Example 22. Calculation method for the number of occupied or partially occupied primitive elements In the encoding method, encoding device, decoding method, or decoding device, the calculation method for the number of occupied or partially occupied primitive elements by an integer compression unit, an integer compression unit group, or a partial integer compression unit is as follows: An integer compression unit, an integer compression unit group, or a partial integer compression unit is divided into H strings. For each string Si, where 0 ≤ i < H, the number of occupied or partially occupied primitive elements is NumBUi, where 0 ≤ i < H; the number of occupied or partially occupied primitive elements NumBu of this integer compression unit, integer compression unit group, or partial integer compression unit is the sum of the H NumBUi, where 0 ≤ i < H.

[0079] Example 23. Accessing one primitive element at a time through one or more buses In the encoding method, encoding device, decoding method, or decoding device, one primitive element is accessed at a time through one or more buses.

[0080] Example 24. Examples of one-time access In the encoding method, encoding device, decoding method, or decoding device described in Example 23, the one-time access includes accessing one clock at a time, accessing multiple clocks at a time, accessing one burst (i.e., continuously accessing N clocks), or accessing M bursts (i.e., continuously accessing M×N clocks), where M and N are integers greater than 1.

[0081] Example 25. Examples of clocks for one-time access In the encoding method, encoding device, decoding method, or decoding device described in Example 24, the one or more or N or M×N clock accesses include accessing data only at one or more or N or M×N clock rising edges, that is, accessing data only at the rising edge, or accessing data only at one or more or N or M×N clock falling edges, that is, accessing data only at the falling edge, or accessing data at both the rising edge and the falling edge of one or more or N or M×N clocks, that is, accessing data at both clock edges.

[0082] Example 26. The primitive element is a burst primitive element In the encoding method or encoding device or decoding method or decoding device, the primitive is a burst primitive, the reference primitive is a reference burst primitive, a burst has N clocks, a burst primitive is a primitive accessed by N clocks of a burst, and a reference burst primitive is a reference primitive read by N clocks of a burst.

[0083] Example 27. Example of burst primitive In the encoding method or encoding device or decoding method or decoding device described in Example 26, the value range of N is the following integer range or a subrange thereof: [4, 32]; or, the value range of N is the following integer range or a subrange thereof: {4, 8, 16, 32}.

Claims

1. A coding method or device using at least a predetermined type of string prediction method, characterized in that At least include the steps or modules to complete the following functions and operations: Inputting raw data of at least one whole compression unit or one whole compression unit group, i.e. at least two whole compression units or one partial whole compression unit constituting a group; At least a part or all of the whole compression unit or the whole compression unit group or the part of the whole compression unit is subjected to string prediction coding, and in the string prediction coding process, the number of primitives occupied or partially occupied by reference elements of any one of the whole compression unit or the whole compression unit group or the part of the whole compression unit that fall within a predetermined reference area or a sub-area thereof, referred to as reference primitives, satisfies a predetermined reference primitive number restriction condition; The predetermined reference primitive number restriction condition includes: the number of the reference primitives, referred to as the reference primitive number, does not exceed a predetermined threshold; Outputting at least the compressed data code stream of the entire compression unit or the entire compression unit group or part of the entire compression unit; The predetermined type of string prediction method includes intra-frame string prediction and / or intra-frame block prediction and / or inter-frame string prediction and / or inter-frame block prediction and / or inter-frame prediction; The primitives include a burst primitive and a non-burst primitive, and the reference primitives include a reference burst primitive and a reference non-burst primitive.

2. A decoding method or device using at least a predetermined type of string prediction method, characterized in that At least include the steps or modules to complete the following functions and operations: At least one whole compression unit or one whole compression unit group, i.e., a compressed data code stream of at least two whole compression units or a partial whole compression unit, is input; At least a part or all of the whole compression unit or the whole compression unit group or the part of the whole compression unit are subjected to string prediction decoding, and in the string prediction decoding process, the number of primitives occupied or partially occupied by reference elements of any one of the whole compression unit or the whole compression unit group or the part of the whole compression unit that fall within a predetermined reference area or a sub-area thereof, referred to as reference primitives, satisfies a predetermined reference primitive number restriction condition; The predetermined reference primitive number restriction condition includes: the number of the reference primitives, referred to as the reference primitive number, does not exceed a predetermined threshold; outputting at least the reconstructed elements of the entire compression unit or the entire compression unit group or part of the entire compression unit; The predetermined type of string prediction method includes intra-frame string prediction and / or intra-frame block prediction and / or inter-frame string prediction and / or inter-frame block prediction and / or inter-frame prediction; The primitives include a burst primitive and a non-burst primitive, and the reference primitives include a reference burst primitive and a reference non-burst primitive.

3. The decoding method or device according to claim 2, characterized in that: Raw data is an array or sequence of arrays of two-dimensional data elements including an image, a sequence of images, or a video. The string prediction methods include intra-frame string prediction, intra-frame block prediction, inter-frame string prediction, inter-frame block prediction, inter-frame prediction, block-intra-frame prediction, block-inter-frame prediction, block-geometry block prediction, and block-local illumination compensation prediction; The predetermined type of string prediction mode is intra-frame string prediction and intra-frame block prediction, or intra-frame string prediction, intra-frame block prediction, and inter-frame prediction, or intra-frame string prediction, intra-frame block prediction, inter-frame string prediction, and inter-frame prediction, or intra-frame string prediction, intra-frame block prediction, inter-frame prediction, block-intra-frame prediction, block-inter-frame prediction, block-geometry block prediction, and / or block-local illumination compensation prediction; The compressed subsets involved in string prediction include images, sub-images of images, tiles, slices, and patches; The largest compression units involved in string prediction include tiles, LCUs, and CTUs. The whole compression unit includes a macroblock, a coding unit CU, a sub-region of a CU, a sub-coding unit SubCU, a prediction block, a prediction unit PU, a sub-region of a PU, a sub-prediction unit SubPU, a transform block, a transform unit TU, a sub-region of a TU, and a sub-transform unit SubTU; The shape of the whole compression unit includes square, rectangle, triangle, quadrilateral, trapezoid, polygon; The shapes of the partially integral compression units include square, rectangle, triangle, quadrilateral, trapezoid, and polygon.

4. The decoding method or device according to claim 2, characterized in that Includes one or any combination of the following features, Feature 1: The size of the primitive is P×Q×R, where P, Q, and R are integers satisfying 1 ≤ P ≤ 64, 1 ≤ Q ≤ 64, and 1 ≤ R ≤ 16; Feature 2: The size of the primitive is 2 p ×2 q ×2 r , where p, q, r are integers satisfying 0 ≤ p ≤ 6, 0 ≤ q ≤ 6, 0 ≤ r≤ 4; Feature 3: The size of the primitive includes one or a combination of the following: P×Q, which means that one primitive is a P×Q basic block. or, P×Q×2 means that one primitive is two adjacent P×Q blocks on the left and right or two adjacent P×Q blocks on the top and bottom. or, P×Q×4 means that one primitive is four P×Q blocks adjacent to each other. Feature 4: The size of the primitive includes one or a combination of the following: P×Q, which means that one primitive is a P×Q basic block. or, P×Q×2 means that one primitive is two adjacent P×Q blocks on the left and right or two adjacent P×Q blocks on the top and bottom. or, P×Q×4 means that one primitive is four P×Q blocks adjacent to each other. in, P×Q is 4×1, or, P×Q is 4×2, or, P×Q is 4×4, or, P×Q is 8×1, or, P×Q is 8×2, or, P×Q is 8×8, or, P×Q is 16×8, or, P×Q is 16×16, or, P×Q is 8×16, or, P×Q is 32×16, or, P×Q is 32×32, or, P×Q is 16×32.

5. The decoding method or device according to claim 2, characterized in that Includes one or any combination of the following features, Feature 1: The predetermined threshold is S / 128 of the total number of elements of the entire compression unit or the entire compression unit group or the partial entire compression unit that adopt the predetermined type of string prediction method, where S is an integer satisfying 1 ≤ S ≤ 64; Feature 2: The predetermined threshold is S / 256 of the total number of elements of the entire compression unit or the entire compression unit group or the partial entire compression unit that adopt the predetermined type of string prediction method, where S is an integer satisfying 1 ≤ S ≤ 128; Feature 3: The predetermined threshold is S / 512 of the total number of elements of the entire compression unit or the entire compression unit group or the partial entire compression unit that adopt the predetermined type of string prediction method, where S is an integer satisfying 1 ≤ S ≤ 256; Feature 4: The predetermined threshold is S / T of the total number of elements of the entire compression unit or the entire compression unit group or part of the entire compression unit using the predetermined type of string prediction method, wherein S / T includes one of the following situations or a combination thereof: 1 / 2=64 / 128 or 3 / 8=48 / 128 or 1 / 4=32 / 128 or 3 / 16=24 / 128 or 5 / 32=20 / 128 or 1 / 8=16 / 128 or 3 / 32=12 / 128 or 1 / 16=8 / 128 or 1 / 32=4 / 128 or 1 / 64=2 / 128 or (2s+1) / 256, wherein s is an integer greater than 0 and less than 64.

6. The decoding method or device according to claim 2, characterized in that Includes one or any combination of the following features, Feature 1: The predetermined reference area or its sub-area includes at least part or all of the current maximum compression unit and the K maximum compression units to its left, a total of K+1 maximum compression units, where K is an integer satisfying 0 ≤ K ≤ 256; Feature 2: The maximum compression unit is divided into four equal parts: upper left, upper right, lower left, and lower right, and encoded and decoded in a predetermined order. The predetermined reference area or its sub-area includes at least part or all of the current quarter maximum compression unit and K quarter maximum compression units before the current quarter maximum compression unit in the coding and decoding order, namely, K+1 quarter maximum compression units, where K is an integer satisfying 0 ≤ K ≤ 2048; Feature 3: The predetermined reference area or its sub-area includes at least a current reference unit and a part or all of K+1 reference units that are K reference units before the current reference unit in a coding and decoding order, where K is an integer satisfying 0 ≤ K ≤ 2048; Feature 4: The predetermined reference area or its sub-area includes at least a current reference unit and K reference units before the current reference unit in a coding and decoding order, a total of K+1 reference units, where K is an integer satisfying 0 ≤ K ≤ 2048; the shape and size of the reference unit are one of the following: Equal to the shape and size of the largest compression unit, or Equal to the predetermined shape and size, or When the width and height of the maximum compression unit are less than or equal to a predetermined value, the shape and size of the maximum compression unit are equal to the shape and size of the maximum compression unit, and when the width and height of the maximum compression unit are greater than the predetermined value, the shape and size of the maximum compression unit are equal to the predetermined shape and size. or When the width and height of the maximum compression unit are 16×16 or 32×32 or 64×64, the width and height of the reference unit are equal to the width and height of the maximum compression unit, and when the width and height of the maximum compression unit are 128×128 or 256×256 or 512×512, the width and height of the reference unit are equal to 64×64. or When the width and height of the maximum compression unit are 16×16 or 32×32 or 64×64 or 128×128, the width and height of the reference unit are equal to the width and height of the maximum compression unit, and when the width and height of the maximum compression unit are 256×256 or 512×512, the width and height of the reference unit are equal to 128×128; Feature 5: The predetermined reference area or a sub-area thereof includes at least a current reference unit and K reference units before the current reference unit in a coding and decoding order, a total of K+1 reference units, where K is an integer satisfying 0 ≤ K ≤ 2048 and a total number of elements of the K+1 reference units is equal to the number of elements of the M maximum compression unit rows plus the number of elements of the N maximum compression units, where M is an integer greater than or equal to 0 and less than or equal to 16, and N is an integer greater than or equal to -2 and less than or equal to 4; Feature 6: The predetermined reference area or its sub-area includes at least a current reference unit and K reference units before the current reference unit in a coding and decoding order, a total of K+1 reference units, where K is an integer satisfying 0 ≤ K ≤ 2048 and the total number of elements of the K+1 reference units is equal to the number of elements of the M maximum compression unit rows plus the number of elements of the N reference units, where M is an integer greater than or equal to 0 and less than or equal to 16, N is equal to -2×C or -C or 0 or C or 2×C or 3×C or 4×C and C is equal to 1 or 2 or 4 or 8 or 16; Feature 7: The predetermined reference area is part or all of the current largest compression unit row; Feature 8: The predetermined reference area or its sub-area includes at least part or all of the current maximum compression unit row and the L maximum compression unit rows above it, a total of L+1 maximum compression unit rows, where L is an integer satisfying 0 ≤ L ≤ 128.

7. The decoding method or device according to claim 2, characterized in that Includes one or any combination of the following features, Feature 1: The predetermined reference area or its sub-areas are divided into multiple different primitive sizes at the same time. The predetermined threshold includes a plurality of thresholds, which respectively correspond to and are applicable to the plurality of different primitive sizes. The reference string of the whole compression unit or the whole compression unit group or the reference element of the part of the whole compression unit and the reference element thereof simultaneously satisfy the restriction conditions specified by the plurality of different primitive sizes and the corresponding predetermined thresholds; Feature 2: In addition to feature 1, the present invention also has the following features: The multiple different primitive sizes and the corresponding predetermined thresholds include at least a combination of any two, three, four, five, six, seven or eight of the following eight primitive sizes and their thresholds: The primitive size is P1×Q1×R1, the threshold is S1 / 512 of the total number of elements of the whole compression unit or whole compression unit group or part of the whole compression unit, 1 ≤ S1 ≤ 256, The primitive size is P2×Q2×R2, the threshold is S2 / 512 of the total number of elements of the whole compression unit or whole compression unit group or part of the whole compression unit, 1 ≤ S2 ≤ 256, The primitive size is P3×Q3×R3, the threshold is S3 / 512 of the total number of elements of the whole compression unit or whole compression unit group or part of the whole compression unit, 1 ≤ S3 ≤ 256, The primitive size is P4×Q4×R4, the threshold is S4 / 512 of the total number of elements of the whole compression unit or whole compression unit group or part of the whole compression unit, 1 ≤ S4 ≤ 256, The primitive size is P5×Q5×R5, the threshold is S5 / 512 of the total number of elements of the whole compression unit or whole compression unit group or part of the whole compression unit, 1 ≤ S5 ≤ 256, The primitive size is P6×Q6×R6, the threshold is S6 / 512 of the total number of elements of the whole compression unit or whole compression unit group or part of the whole compression unit, 1 ≤ S6 ≤ 256, The primitive size is P7×Q7×R7, the threshold is S7 / 512 of the total number of elements of the whole compression unit or whole compression unit group or part of the whole compression unit, 1 ≤ S7 ≤ 256, The primitive size is P8×Q8×R8, the threshold is S8 / 512 of the total number of elements of the whole compression unit or the whole compression unit group or the part of the whole compression unit, 1 ≤ S8 ≤ 256; Feature 3: In addition to feature 1, the present invention also has the following features: The multiple different primitive sizes and the corresponding predetermined thresholds include at least a combination of any two, three, four, five, six, seven or eight of the following eight primitive sizes and their thresholds: The primitive size is 4×1, the threshold is 3 / 8 of the total number of elements of the whole compression unit or whole compression unit group or part of the whole compression unit, The primitive size is 4×1×2, the threshold is 3 / 16 of the total number of elements of the whole compression unit or whole compression unit group or part of the whole compression unit, The primitive size is 4×2, the threshold is 1 / 4 of the total number of elements of the whole compression unit or whole compression unit group or part of the whole compression unit, The primitive size is 4×2×2, the threshold is 1 / 8 of the total number of elements of the whole compression unit or whole compression unit group or part of the whole compression unit, The primitive size is 4×4, the threshold is 3 / 16 of the total number of elements of the whole compression unit or whole compression unit group or part of the whole compression unit, The primitive size is 8×1, the threshold is 1 / 4 of the total number of elements of the whole compression unit or whole compression unit group or part of the whole compression unit, The primitive size is 8×1×2, the threshold is 1 / 8 of the total number of elements of the whole compression unit or whole compression unit group or part of the whole compression unit, The primitive size is 8×2, and the threshold is 3 / 16 of the total number of elements of the entire compression unit or the entire compression unit group or the partial entire compression unit.

8. The decoding method or device according to claim 2, characterized in that Includes one or any combination of the following features, Feature 1: The predetermined reference area or its sub-area is divided into a first reference area and a second reference area, and the predetermined reference primitive number restriction condition further includes the following condition 1 and / or condition 2: Condition 1: the number of primitives occupied or partially occupied by reference elements on the reference string completely within the first reference region does not exceed a first set of predetermined thresholds corresponding to a first set of primitive sizes, Condition 2: the number of primitives occupied or partially occupied by reference elements on the reference string that are partially or completely within the second reference area does not exceed a second set of predetermined thresholds corresponding to a second set of primitive sizes; Feature 2: In addition to feature 1, the present invention also has the following features: The predetermined reference area or its sub-area includes at least part or all of the current maximum compression unit and the K maximum compression units to its left, which is K+1 maximum compression units in total, where K is an integer satisfying 0 ≤ K ≤ 256. The first reference area includes part or all of the current maximum compression unit and J maximum compression units to its left, a total of J+1 maximum compression units, where J is an integer satisfying 0 ≤ J < K, The second reference area is an area of ​​the predetermined reference area or a sub-area thereof that does not belong to the first reference area; Feature 3: In addition to feature 1, the present invention also has the following features: The predetermined reference area or its sub-area includes at least part or all of the current maximum compression unit row and the L maximum compression unit rows above it, a total of L+1 maximum compression unit rows, where L is an integer satisfying 0 ≤ L ≤ 128, and The maximum compression unit is divided into four equal parts: upper left, upper right, lower left, and lower right, and encoded and decoded in a predetermined order. Part or all of the L+1 maximum compression unit rows include at least the current quarter maximum compression unit and K quarter maximum compression units before the current quarter maximum compression unit in the coding and decoding order, a total of K+1 quarter maximum compression units, where K is an integer satisfying 0 ≤ K ≤ 2048, The first reference area includes part or all of the current quarter-maximum compression unit and J quarter-maximum compression units before the current quarter-maximum compression unit in the coding and decoding order, namely, J+1 quarter-maximum compression units, where J is an integer satisfying 0 ≤ J < K, The second reference area is an area of ​​the predetermined reference area or a sub-area thereof that does not belong to the first reference area; Feature 4: In addition to feature 1, the present invention also has the following features: The predetermined reference area or its sub-area includes at least part or all of the current maximum compression unit row and the L maximum compression unit rows above it, a total of L+1 maximum compression unit rows, where L is an integer satisfying 0 ≤ L ≤ 128, and Part or all of the L+1 maximum compression unit rows at least include the current reference unit and part or all of K+1 reference units, which are K reference units before the current reference unit in the coding and decoding order, where K is an integer satisfying 0 ≤ K ≤ 2048, The first reference area includes part or all of the current reference unit and J reference units before the current reference unit in a coding order, namely, J+1 reference units, where J is an integer satisfying 0 ≤ J < K. The second reference area is an area of ​​the predetermined reference area or a sub-area thereof that does not belong to the first reference area; Feature 5: In addition to feature 1, the present invention also has the following features: The predetermined reference area or its sub-area includes at least part or all of the current maximum compression unit row and the L maximum compression unit rows above it, a total of L+1 maximum compression unit rows, where L is an integer satisfying 0 ≤ L ≤ 128, and Part or all of the L+1 maximum compression unit rows include at least the current reference unit and part or all of K+1 reference units, which are K reference units before the current reference unit in the coding and decoding order, where K is an integer satisfying 0 ≤ K ≤ 2048; the shape and size of the reference unit are one of the following: Equal to the shape and size of the largest compression unit, or Equal to the predetermined shape and size, or When the width and height of the maximum compression unit are less than or equal to a predetermined value, the shape and size of the maximum compression unit are equal to the shape and size of the maximum compression unit, and when the width and height of the maximum compression unit are greater than the predetermined value, the shape and size of the maximum compression unit are equal to the predetermined shape and size. or When the width and height of the maximum compression unit are 16×16 or 32×32 or 64×64, the width and height of the reference unit are equal to the width and height of the maximum compression unit, and when the width and height of the maximum compression unit are 128×128 or 256×256 or 512×512, the width and height of the reference unit are equal to 64×64. or When the width and height of the maximum compression unit are 16×16 or 32×32 or 64×64 or 128×128, the width and height of the reference unit are equal to the width and height of the maximum compression unit, and when the width and height of the maximum compression unit are 256×256 or 512×512, the width and height of the reference unit are equal to 128×128; The first reference area includes part or all of the current reference unit and J reference units before the current reference unit in a coding order, namely, J+1 reference units, where J is an integer satisfying 0 ≤ J < K. The second reference area is an area of ​​the predetermined reference area or a sub-area thereof that does not belong to the first reference area; Feature 6: In addition to feature 1, the present invention also has the following features: The predetermined reference area or a sub-area thereof includes at least a current reference unit and K reference units before the current reference unit in a coding and decoding order, a total of K+1 reference units, where K is an integer satisfying 0 ≤ K ≤ 2048 and a total number of elements of the K+1 reference units is equal to the number of elements of the M maximum compression unit rows plus the number of elements of the N maximum compression units, where M is an integer greater than or equal to 0 and less than or equal to 16, and N is an integer greater than or equal to -2 and less than or equal to 4; The first reference area includes part or all of the current reference unit and J reference units before the current reference unit in a coding order, namely, J+1 reference units, where J is an integer satisfying 0 ≤ J < K. The second reference area is an area of ​​the predetermined reference area or a sub-area thereof that does not belong to the first reference area; Feature 7: In addition to feature 1, the present invention also has the following features: The predetermined reference area or a sub-area thereof includes at least a current reference unit and K reference units before the current reference unit in a coding and decoding order, a total of K+1 reference units, wherein K is an integer satisfying 0 ≤ K ≤ 512 and a total number of elements of the K+1 reference units is equal to the number of elements of the M maximum compression unit rows plus the number of elements of the N reference units, wherein M is an integer greater than or equal to 0 and less than or equal to 16, N is equal to -2×C or -C or 0 or C or 2×C or 3×C or 4×C and C is equal to 1 or 2 or 4 or 8 or 16; The first reference area includes part or all of the current reference unit and J reference units before the current reference unit in a coding order, namely, J+1 reference units, where J is an integer satisfying 0 ≤ J < K. The second reference area is an area of ​​the predetermined reference area or a sub-area thereof that does not belong to the first reference area; Feature 8: In addition to the above features 1, 2, 3, 4, 5, 6 or 7, the invention also has the following features: The width and height of all primitive sizes in the first set of primitive sizes are less than or equal to 8, The width and / or height of all primitive sizes in the second set of primitive sizes is greater than or equal to 8; Feature 9: In addition to the above features 1, 2, 3, 4, 5, 6 or 7, the invention also has the following features: The first group of primitive sizes includes at least one of the following 15 primitive sizes or any combination thereof: 4×1×R, 4×2×R, 4×4×R, 8×1×R, 8×2×R, where R is equal to 1 or 2 or 4, The second group of primitive sizes includes at least one of the following 21 primitive sizes or any combination thereof: 8x8×R, 16×8×R, 16×16×R, 8×16×R, 32×16×R, 32×32×R, 16×32×R, where R is equal to 1 or 2 or 4.

9. The decoding method or device according to claim 2, characterized in that Includes one or any combination of the following features, Feature 1: The whole compression unit group is composed of non-overlapping whole compression units that partially or completely adopt the predetermined type of string prediction method, which are generated from the same parent node block or parent node block pair that meets the predetermined conditions through one-level or multi-level division or without division; in this case, the parent node block or parent node block pair is a synonym for the whole compression unit group; the parent node block pair is composed of two parent node blocks, respectively called the first parent node block and the second parent node block, and the two parent node blocks are allowed to have the same nominal number of elements, that is, the width and height of the block, as shown in Figure 1(d); the nominal number of elements of the parent node block pair is equal to the sum of the width and height of its first parent node block and the width and height of its second parent node block; in the case of no division, only one whole compression unit is actually generated from the parent node block, and the whole compression unit group is composed of only one whole compression unit; Feature 2: In the feature 1 or the following features 4, 5, and 7, the predetermined condition includes one of the following conditions or any combination thereof: Condition 1: The width of the parent node block is one of the following values ​​or any combination thereof: W = 2 w , where 3≤w≤10, Condition 2: The height of the parent node block is one of the following values ​​or any combination thereof: H = 2 h , where 3≤h≤10, Condition 3: The nominal number of elements of the parent node block, i.e., the width multiplied by the height, or the nominal number of elements of the parent node block pair is one of the following values ​​or any combination thereof: P = 2 p , where 6≤p≤20 or P is greater than or equal to 2 6 and less than or equal to 2 20 integer, Condition 4: No condition; Feature 3: Based on the feature 2, w = 6, h = 6, p = 10 or P = 1024; Feature 4: On the basis of the feature 1, the number of reference primitives occupied or partially occupied by a parent node block or a parent node block pair whose width is greater than or equal to a predetermined W and whose height is greater than or equal to a predetermined H or whose nominal element number is greater than or equal to a predetermined W times H satisfies a predetermined reference primitive number restriction condition C, and the number of reference primitives occupied or partially occupied by the parent node block or the parent node block pair is the sum of the numbers of reference primitives occupied or partially occupied by each integral compression unit in the integral compression unit group, i.e., the cumulative number; Feature 4-1: Based on Feature 4, W = 2 6 , H = 2 6 ; or, W = 2 7 , H = 2 7 ; Feature 5: On the basis of the feature 1, the number of reference primitives occupied or partially occupied by a parent node block or a parent node block pair whose width multiplied by height is equal to a predetermined P or whose nominal element number is equal to a predetermined P satisfies a predetermined reference primitive number restriction condition D, and the number of reference primitives occupied or partially occupied by the parent node block or the parent node block pair is the sum of the numbers of reference primitives occupied or partially occupied by each integral compression unit in the integral compression unit group, i.e., the cumulative number; Feature 5-1: Based on Feature 5, P = 1024; or, P = 2048; or, P = 4096; Feature 6: The number of reference primitives occupied or partially occupied by the whole compression unit satisfies a predetermined reference primitive number restriction condition E. If a whole compression unit does not adopt the predetermined type of string prediction mode, the number of reference primitives occupied or partially occupied by it is zero; Feature 7: For an entire compression unit whose width times height is greater than or equal to a predetermined P, the number of reference primitives occupied or partially occupied is limited by the entire compression unit itself, that is, the number of reference primitives occupied or partially occupied by the entire compression unit satisfies the predetermined reference primitive number restriction condition F; for an entire compression unit whose width times height is less than a predetermined P, the number of reference primitives occupied or partially occupied is limited by the largest parent node block whose width times height is less than a predetermined P as a restriction unit, that is, the entire compression unit group is composed of non-overlapping entire compression units that partially or completely adopt the predetermined type of string prediction method and are generated from the largest parent node block through one-level or multiple-level division or without division; in this case, the largest parent node block and the entire compression unit group are synonymous; The number of reference primitives occupied or partially occupied by the largest parent node block satisfies a predetermined reference primitive number restriction condition G, and the number of reference primitives occupied or partially occupied by the largest parent node block is the sum of the numbers of reference primitives occupied or partially occupied by each entire compression unit in the entire compression unit group, i.e., the cumulative number; Feature 7-1: Based on Feature 7, P = 2048, that is, the size of the whole compression unit for limiting the number of reference primitives in units of the whole compression unit itself is 64×32 or 32×64 or 64×64 or larger, and the size of the largest parent node block for limiting the number of reference primitives in units of whole compression unit groups is 32×32 or 64×16 or 16×64 or 32×16 or 16×32; Feature 8: At least two of the characteristics 4, 5, 6 and 7 are simultaneously possessed, and among the at least two characteristics, the characteristic 5 that allows two or more characteristics with different P and D, and the conditions specified in the characteristic 5 that allows two or more characteristics with different P and D are all satisfied by the entire compression unit group, that is, the parent node block or the parent node block pair; Feature 9: Based on the feature 8, the at least two features include I feature 4, wherein I = 0 or 1 and I = 0 means that feature 4 is not included; The at least two features include J features 5, where J satisfies 0 ≤ J ≤ 5 and J=0 means that feature 5 is not included; When J > 0, the jth, 1 ≤ j ≤ J, P and D in feature 5 are denoted by P j and D j ; The at least two features include K feature 6, where K = 0 or 1 and K = 0 means that feature 6 is not included; The at least two features include L features 7, where L = 0 or 1 and L = 0 means that feature 7 is not included; Feature 9-1: Based on Feature 9, if I = 1, then W = H = 64; if J = 1, then P = 1024; If J = 2, then P1 = 1024, P2 = 256, and the corresponding D is recorded as D1 and D2 respectively; If J = 3, then P1 = 1024, P2 = 512, P3 = 256, or P1 = 1024, P2 = 256, P3 = 64, and the corresponding D is recorded as D1, D2, and D3 respectively; if L = 1, then P = 2048; Feature 10: In addition to Feature 9 or 9-1, When I > 0, the restriction condition C includes that the number of reference primitives occupied or partially occupied by the parent node block or parent node block pair does not exceed Sc / 512 of the total number of elements of each whole compression unit in the whole compression unit group, where Sc is an integer satisfying 1 ≤ Sc ≤ 256; When J > 0, the constraint D j , 1 ≤ j ≤ J, including the number of reference primitives occupied or partially occupied by the parent node block or parent node block pair does not exceed Sd of the total number of elements of each integral compression unit in the integral compression unit group j / 512, where Sd j is such that 1 ≤ Sd j Integer ≤ 256; When K > 0, the restriction condition E includes that the number of reference primitives occupied or partially occupied by the entire compression unit does not exceed Se / 512 of the total number of elements of the entire compression unit, where Se is an integer satisfying 1 ≤ Se ≤ 256; When L > 0, the restriction condition F includes that the number of reference primitives occupied or partially occupied by the whole compression unit does not exceed Sfg / 512 of the total number of elements of the whole compression unit, where Sfg is an integer satisfying 1 ≤ Sfg ≤ 256; the restriction condition G includes that the number of reference primitives occupied or partially occupied by the largest parent node block does not exceed Sfg / 512 of the total number of elements of each whole compression unit in the whole compression unit group; Feature 10-1: In addition to Feature 10, When I > 0 and J > 0, W, H, and P1 satisfy W×H > P1, and Sc and Sd1 satisfy Sc < Sd1; When J > 1, P j Satisfy P j > P j+1 , Sd j Meet Sd j < Sd j+1 , 1 ≤ j ≤ J - 1; When J > 0 and K > 0, Sd J and Se satisfies Sd J ≤ Se; When I > 0 and K > 0, Sc and Se satisfy Sc < Se; When L > 0, Sf = Sg; When I > 0 and L > 0, Sc = Sf = Sg; Feature 11: Based on feature 10, when I > 0, W = 64 and H = 64, Sc = 16, i.e., Sc / 512 = 1 / 32; when J > 0, P1 = 1024 (= 32×32 = 16×64 = 64×16 = 8×128 = 128×8 = 16×32+32×16), Sd1 = 32, i.e., Sd1 / 512 = 2 / 32 = 1 / 16, when J > 1, P2 = 512 (= 16×32 = 32×16 = 64×8 = 8×64), Sd2 = 48, i.e., Sd2 / 512 = 3 / 32, or P2 = 256 (= 16×16 = 32×8 = 8×32 = 8×16+16×8), Sd2 = 48, that is, Sd2 / 512 = 3 / 32 or Sd2 = 64, that is, Sd2 / 512 = 1 / 8; when K > 0, Se = 64, that is, Se / 512 = 1 / 8; when L > 0, Sfg = 16, that is, Sfg / 512 = 1 / 32; Feature 12: The whole compression unit group is composed of part or all of the whole compression units encoded using intra-frame string prediction and / or intra-frame block prediction and / or inter-frame prediction in a maximum compression unit; Feature 13: The whole compression unit group is composed of part or all of the whole compression units encoded using intra-frame string prediction and / or intra-frame block prediction and / or inter-frame prediction in one quarter of the largest compression unit; Feature 14: The whole compression unit group is composed of part or all of the whole compression units encoded using string prediction in a maximum compression unit; Feature 15: The whole compression unit group is composed of part or all of the whole compression units encoded using string prediction in one quarter of the maximum compression unit; Feature 16: The whole compression unit group is composed of part or all of the whole compression units in a largest compression unit; Feature 17: The whole compression unit group is composed of part or all of the whole compression units in a quarter maximum compression unit.

10. The decoding method or device according to claim 2, characterized in that Includes one or any combination of the following features, Feature 1: The whole compression unit is divided into three categories according to its size or number of elements: the number of elements of the first kind of whole compression unit is greater than the number of elements of the second kind of whole compression unit, the number of elements of the second kind of whole compression unit is greater than the number of elements of the third kind of whole compression unit, and the third kind of whole compression unit is allowed to be empty, that is, the whole compression unit is actually divided into two categories according to its size or number of elements; The first or third type of whole compression unit limits the number of primitives occupied or partially occupied by the reference element with the current whole compression unit as the limiting unit: the number of primitives occupied or partially occupied by the reference element of a whole compression unit of the first or third type falling within the predetermined reference area or its sub-area does not exceed a predetermined threshold; The second type of whole compression unit uses its parent node block as a limiting unit to limit the number of primitives occupied or partially occupied by the reference element: for a whole compression unit of the second type, the sum of the number of primitives occupied or partially occupied by the reference elements of at least all whole compression units encoded and decoded in a string prediction manner that fall within a predetermined reference area or a sub-area thereof generated after the parent node block is divided, i.e., the cumulative number, does not exceed a predetermined threshold; Feature 2: In addition to feature 1, the present invention also has the following features: The first type of integral compression unit is an integral compression unit whose size is not equal to 8×4, 4×8, or 4×4. The second type of integral compression unit is an integral compression unit with a size of 8×4 or 4×8. The third type of integral compression unit is an integral compression unit having a size equal to 4×4; Feature 3: In addition to feature 1, the present invention also has the following features: The first type of integral compression unit is an integral compression unit whose size is not equal to 8×4 nor equal to 4×8. The second type of integral compression unit is an integral compression unit with a size of 8×4 or 4×8. The third type of integral compression unit is empty, that is, there is no third type of integral compression unit; Feature 4: The number of primitives occupied or partially occupied by a whole compression unit, a whole compression unit group, or a part of a whole compression unit is calculated as: A whole compression unit or a whole compression unit group or a part of a whole compression unit is divided into H strings, each string Si, where 0 ≤ i < H, the number of primitives occupied or partially occupied is NumBUi, where 0 ≤ i < H; the number of primitives occupied or partially occupied by the whole compression unit or the whole compression unit group or part of the whole compression unit is the sum of the H NumBUi, where 0 ≤ i < H; Feature 5: Access one primitive at a time via one or several buses; Feature 6: In addition to feature 5, the present invention also has the following features: The one access includes one-clock access or multiple-clock access or one-burst access, i.e., N consecutive clock access or M-burst access, i.e., M×N consecutive clock access, where M and N are integers greater than 1; Feature 7: In addition to feature 6, the present invention also has the following features: The one or more or N or M×N clock accesses include one or more or N or M×N clock rising edge accesses, i.e., accessing data only on the rising edge, or one or more or N or M×N clock falling edge accesses, i.e., accessing data only on the falling edge, or one or more or N or M×N clock rising edge and falling edge dual clock edge accesses, i.e., accessing data on both the rising edge and the falling edge of the clock; Feature 8: The primitive is a burst primitive, and the reference primitive is a reference burst primitive. A burst has N clocks, a burst primitive is a primitive accessed by N clocks of a burst, and a reference burst primitive is a reference primitive read by N clocks of a burst. Feature 9: In addition to feature 8, the present invention also has the following features: The value range of N is the following integer range or a subrange thereof: [4, 32]; or, the value range of N is the following integer range or a subrange thereof: {4, 8, 16, 32}.