Method and device for encoding and decoding point prediction chrominance reconstruction values from multiple reference positions
By obtaining the secondary component values from multiple reference positions and calculating the chroma reconstruction value, the problem of low secondary component reconstruction accuracy in the existing technology is solved, and the coding efficiency of the point prediction technology is improved.
Patent Information
- Application Number
- CN202111190758.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-13
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-10-13
AI Technical Summary
When the existing point prediction technology reconstructs chroma, the accuracy and quality of the reconstructed elements of the sub-components are low, resulting in a significant reduction in coding efficiency, because it only considers the reference elements at the positive positions and ignores the sub-components at other principal component positions.
Using the method of point prediction chromaticity reconstruction values from multiple reference positions, by obtaining the sub-component values of the reference element from multiple positions corresponding to a sub-component position, the sub-component reconstruction value is calculated according to predetermined rules, including using the average or default value to improve reconstruction accuracy.
The accuracy and quality of reconstructed elements of sub-components are improved, and the coding efficiency of point prediction technology is significantly improved, making data compression more efficient.
Smart Images

Figure QLYQS_1 
Figure QLYQS_2 
Figure RE-GDA0003382597230000291
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data decoding and encoding, and in particular to an encoding method and device and a decoding method and device for compressing data by 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 (eg, 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 predetermined order, and encoding and decoding are performed in this order.
[0005] When data sets 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 two-dimensional or more data sets are encoded (and correspondingly decoded), sometimes the data set is divided into a number of subsets with a predetermined shape and / or size (i.e., the number of elements), called whole compression units, and the whole compression units are encoded or decoded one by one in a predetermined order. At any time, the whole compression unit being encoded or decoded is called the current whole compression unit. The data element being encoded or decoded (sometimes also referred to as the element) is called the current encoded data element or the current decoded data element, collectively referred to as the current data element, referred to as the current element. The element consists of N components (usually 1≤N≤5), so the data set and the whole compression unit are also composed of N components. The components of an element are also called component elements.
[0006] For example, the elements of a frame image, i.e., pixels, are arranged in a rectangular shape with a size (resolution) of 1920 (width) x 1080 (height), and consist of 3 components: G (green) component, B (blue) component, R (red) component or Y (luminance) component, U (Cb chrominance) component, and V (Cr chrominance) component.
[0007] The relationship between the multi-component data set as the encoding object and the sampling rate of each component of the entire compression unit is usually expressed by a sampling format. Data in which N components have the same sampling rate and size (i.e., the number of component sample values) is called full sampling format data. Data in which N components have different sampling rates and sizes, where the sampling rate and size of N1 components, called primary components, are integer multiples of the sampling rates and sizes of the remaining N-N1 components, called secondary components, is called down-sampled format data. The integer multiple is usually 2 times, 4 times, 8 times, 2x2 times, 4x2 times, etc. In the full sampling format data, all components are considered to be primary components and there are no secondary components. In the down-sampled format data, at least one component is a primary component and at least one component is a secondary component. For example, for an array of two-dimensional data elements including computer-generated images containing graphics and text, a sampling format called 4:4:4 (abbreviated as 444) is usually used, that is, the three components of the data set have the same sampling rate and size (i.e., the number of component sample values). For another type of array of two-dimensional data elements, including natural images and videos captured by cameras, a sampling format called 4:2:0 (abbreviated as 420) is usually used, that is, the sampling rate and size of two components called secondary components (D component and E component) of a data set (such as an image or video) with a rectangular shape and 3 components are respectively one-fourth of the other component called primary component (F component), that is, there is a 4:1 downsampling relationship between the primary component and the secondary component. In this case, one D component D[i][j] and one E component E[i][j] correspond to four (2×2) F components F[2i][2j], F[2i+1][2j], F[2i][2j+1], F[2i+1][2j+1]. If the resolution of the F component is 2M×2N (2M component elements horizontally 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 higher quality is also required for the secondary components, a sampling format called 4:2:2 (abbreviated as 422) is often used, that is, the sampling rate and size of the two secondary components (D component and E component) of a data set with a rectangular shape and three components (such as an image or video) are respectively half of the other main component (F component), that is, there is a 2:1 downsampling relationship between the main component and the secondary component.In this case, in one direction (such as horizontal direction) of a data set (such as an image or video), one D component D[i][j] and one E component E[i][j] correspond to two (2×1) F components F[2i][j] and F[2i+1][j]. If the resolution of the F component is 2M×N, that is, the F component of the data set is F={F[m][n]: m=0~2M-1, n=0~N-1}, then the resolutions of the D component and the E component are both M×N, that is, the D component and the E component of the data set are D={D[m][n]: m=0~M-1, n=0~N-1} and E={E[m][n]: m=0~M-1, n=0~N-1}. In images and videos using YUV or YCbCr or YCgCo color formats, the above-mentioned F, D, and E components are usually Y, U, and V components or Y, Cb, Cr components or Y, Cg, and Co components, respectively. In images and videos using the RGB color format, the F, D, and E components mentioned above are usually G, B, and R components or G, R, and B components respectively. When the data is an image or video, the sampling format is often called a chroma format. A chroma format in which each component has the same sampling rate is called a full chroma format. A chroma format in which one component has a downsampling relationship with another component is called a downsampled chroma format.
[0008] In the down-sampling format, the position of a secondary component (usually referred to as the secondary component position) and its elements correspond to the positions of multiple primary components (usually referred to as the primary component positions, and even if they are simply referred to as positions, there will be no confusion) and their elements. This one-to-many correspondence has uncertainty. In order to eliminate this uncertainty, a primary component positive position and its positive elements are usually pre-specified among the multiple positions corresponding to a secondary component position and its elements (such as 2x2 positions in the 420 format or 2x1 positions in the 422 format) and their elements (such as specifying the position and its elements located in the upper left corner of the 2x2 positions and their elements or the position and its elements located on the left of the 2x1 positions and their elements as the primary component positive position and its positive elements) as the only regular primary component position and its elements corresponding one-to-one to the secondary component position and its elements. There is a one-to-one correspondence between the positive position of the principal component and the position of the secondary component. Therefore, the positive position of the principal component and the position of the secondary component are collectively referred to as the positive position, indicating that the position is both the positive position of the principal component and the position of the secondary component. There is also a one-to-one correspondence between the positive position and the position of the secondary component. Among the multiple positions corresponding to a secondary component position, except for the positive position, all other positions are referred to as non-positive positions. There is also a one-to-one correspondence between the positive element of the principal component and the element of the secondary component. Therefore, the positive element of the principal component and the element of the secondary component are collectively referred to as the positive element, indicating that the element is both the positive element of the principal component and the element of the secondary component. There is also a one-to-one correspondence between the positive element and the element of the secondary component. Among the multiple elements corresponding to a secondary component element, except for the positive element, all other elements are referred to as non-positive elements. On the other hand, in the full sampling format, all positions are considered to be the positive position and positive position of the principal component, and all elements are considered to be the positive element and positive element of the principal component.
[0009] In the case where the data is an array or sequence of arrays of two-dimensional data elements in a 420 sampling format, there is one principal component F and two minor components D and E;
[0010] The sampling rate and size of the secondary components D and E are respectively one quarter of the primary component F, that is, there is a 4:1 or 2x2:1 downsampling relationship between the primary component and the secondary component;
[0011] One D component element D[i][j] and one E component element E[i][j] correspond to 2×2 four F component elements F[2i][2j], F[2i+1][2j], F[2i][2j+1], F[2i+1][2j+1] arranged up and down, left and right;
[0012] The resolution of the F component elements is 2M×2N, that is, the F component elements form an array F={F[m][n]: m=0~2M-1, n=0~2N-1},
[0013] The resolution of the D component elements is M×N, that is, the D component elements form an array D={D[m][n]: m=0~M-1, n=0~N-1},
[0014] The resolution of the E component elements is also M×N, that is, the E component elements form an array E={E[m][n]: m=0~M-1, n=0~N-1}.
[0015] The positive element of the principal component at the pre-specified positive position is F[2i][2j], which is called the positive position of the principal component of the upper left corner type and its positive element;
[0016] or,
[0017] The positive element of the principal component at the pre-specified positive position is F[2i+1][2j], which is called the positive position of the principal component of the upper right corner type and its positive element;
[0018] or,
[0019] The positive element of the principal component at the pre-specified positive position is F[2i][2j+1], which is called the positive position of the principal component of the lower left corner type and its positive element;
[0020] or,
[0021] The principal component positive element at the pre-specified positive position is F[2i+1][2j+1], which is called the principal component positive position and its positive element of the lower right corner type.
[0022] 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.
[0023] An effective means 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, 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.
[0024] 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.
[0025] In string prediction, unpredictable (also called unmatched or mismatched or unmatched) elements may also appear for which no reference elements 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 precise 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.
[0026] Scanning methods commonly used in string prediction include:
[0027] Horizontal raster scanning: The elements in a whole compression unit are arranged one by one in the horizontal direction. After arranging one row, the next row is arranged. All the scanning directions within the row are arranged from left to right or all the scanning directions within the row are arranged from right to left.
[0028] or
[0029] Horizontal back-and-forth scanning is also called round-trip scanning or arc scanning: the elements in a whole compression unit are arranged one by one in the horizontal direction, and the next row is arranged after one row is arranged. The intra-row scanning direction of one of any two adjacent rows is arranged from left to right and the intra-row scanning direction of the other row is arranged from right to left. The row arranged from left to right is called the forward row, and the row arranged from right to left is called the reverse row.
[0030] or
[0031] Vertical raster scanning: The elements in a whole compression unit are arranged one by one in the vertical direction, and the next column is arranged after one column is arranged. The scanning direction of all columns is arranged from top to bottom or the scanning direction of all columns is arranged from bottom to top.
[0032] or
[0033] 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.
[0034] 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.
[0035] A special case of string prediction is block prediction, also known as block matching. In this special case, each string forms a rectangular block.
[0036] Point prediction is another special case of string prediction and is also an effective means of data compression.
[0037] Point prediction technology refers to the positions of several data elements whose values often appear repeatedly in or near the current compression unit and have completed a predetermined degree of encoding and decoding in the data set, which are called frequent positions and stored in a frequent position array. Each frequent position stored in the array is marked with an index, which is called the frequent position index. The data elements at the frequent positions are used as reference elements, prediction elements, or matching elements. For an equal value string to be encoded or decoded with equal values in the current compression unit, only an index parameter and a repetition number parameter of the frequent position indicated by the index are needed to indicate that the values of all elements of the equal value string are equal to the value of the element at the frequent position indicated by the index (this frequent position can be the position of an element in the data set before the equal value string, or the position of an element in the equal value string), without the need to record the value of each element in the equal value string one by one, thereby achieving the purpose of data compression. The frequently occurring position is usually represented by a point vector. The frequently occurring position array is usually a point vector array, i.e., an array storing the parameters of the point vector. The parameters of the point vector at least include the point vector and information related to the point vector. The point vector is usually represented by coordinates in a predetermined format. The point vector array is sometimes also called a point prediction information table.
[0038] If the frequently occurring position element appears in the positive position, that is, the position specified by the point vector of the frequently occurring position is the positive position, then it has all N components including the secondary component, and all N components including the secondary component exist in the compressed data code stream. The encoder writes the values of all N components including the secondary component into the compressed data code stream, and the decoder obtains the values of all N components including the secondary component from the compressed data code stream. Otherwise, it only has the main component but no secondary component, and only the main component exists in the compressed data code stream but no secondary component. The encoder only writes the value of the main component into the compressed data code stream, and the decoder only obtains the value of the main component from the compressed data code stream. The value of the secondary component of the frequently occurring position element is stored in the secondary component space at the positive position. The frequently occurring position element is, on the one hand, a reconstruction element of the position, and on the other hand, a reference element of other elements, which is used to obtain the reconstruction values of other elements. In this case, the frequently occurring position element is also called a frequently occurring position reference element.
[0039] In the whole compression unit encoded and decoded using point prediction technology, there may be unmatched elements that cannot find reference elements. If the unmatched element appears in the positive position, it has all N components including the secondary component, and all N components including the secondary component exist in the compressed data code stream. The encoder writes the values of all N components including the secondary component into the compressed data code stream, and the decoder obtains the values of all N components including the secondary component from the compressed data code stream. Otherwise, there are only main components but no secondary components, and only the main components but no secondary components exist in the compressed data code stream. The encoder only writes the values of the main components into the compressed data code stream, and the decoder only obtains the values of the main components from the compressed data code stream. The unmatched element itself is also allowed to be used as a reference element of other elements to obtain the reconstructed values of other elements. At this time, the unmatched element is also called an unmatched reference element.
[0040] The point prediction technique divides the elements of an entire compression unit into element strings of the following three types of strings with variable lengths along the scanning path, i.e., the path formed by continuous sorting according to a predetermined scanning method:
[0041] String type 1: equal value string or equal value string. The values of all elements in an equal value string are equal to the value of an element in a common position;
[0042] String type 2: Unmatched element string. All elements in an unmatched element string are unmatched elements, i.e., unpredictable elements.
[0043] String type 3: unit base vector string. The unit base vector string is a string where the reference string is located at a unit distance directly above the current string, where in the horizontal scanning mode, the directly above refers to the directly adjacent above, and in the vertical scanning mode, the directly above refers to the directly adjacent to the left. Therefore, the unit base vector string is also called the copy above string.
[0044] Point prediction technology also imposes a mandatory rule: the unit base vector string is limited to copying elements inside the current whole compression unit, and cannot copy elements outside the current whole compression unit. Therefore, the original source of each element on all three types of strings in a whole compression unit can only be a common position element or an unmatched element. In other words, the reference elements of all elements of a whole compression unit are directly derived from common position elements or unmatched elements without exception.
[0045] Therefore, in the entire compression unit encoded and decoded using the point prediction technology, the value of the reconstructed element (ie, the reconstructed value of the element) is obtained from the frequently occurring position element or the unmatched element.
[0046] Point prediction is a special case of string prediction. When reconstructing an element, like string prediction, no matter whether the current element is in the correct position or not, the principal component of the current element must always be reconstructed. If the current element is in the correct position, the secondary component of the current element must also be reconstructed. Otherwise, the secondary component of the current element will not be reconstructed.
[0047] In the existing point prediction technology, the value of the secondary component of the reconstructed element is equal to the value of the secondary component of the reference element at the positive position corresponding to the secondary component. However, in the point prediction technology, it is not necessarily the case that only the reference element at the positive position has secondary components. The reference elements at other main component positions (non-positive positions) corresponding to the secondary component may also be at the positive position, so they may also have secondary components. The reconstruction operation of the existing point prediction technology ignores these secondary components, thereby reducing the accuracy and quality of the reconstructed elements of the secondary components and significantly reducing the coding efficiency of the point prediction technology. Summary of the invention
[0048] The purpose of the present invention is to provide a coding method and device for point prediction chrominance reconstruction values from multiple reference positions, so as to solve the problems existing in the existing point prediction technology. In the existing point prediction technology, the value of the secondary component of the reconstructed element is equal to the value of the secondary component of the reference element in the positive position corresponding to the secondary component one by one. However, in the point prediction technology, it is not necessarily the case that only the reference element in the positive position has secondary components. The reference elements of other main component positions (non-positive positions) corresponding to the secondary component may also be in the positive position, so they may also have secondary components. The reconstruction operation of the existing point prediction technology ignores these secondary components, thereby reducing the accuracy and quality of the reconstructed elements of the secondary components and significantly reducing the coding efficiency of the point prediction technology.
[0049] The above technical objectives of the present invention are achieved by the following technical solutions:
[0050] A coding method in which a point predicted chrominance reconstruction value comes from multiple reference positions, the coding method comprising at least the following steps:
[0051] A1: Input the original data of at least one whole compression unit;
[0052] A2: for some or all elements in the entire compression unit, at least from the sub-components of the reference elements at multiple positions corresponding to one sub-component position, obtain the sub-component reconstruction value of the sub-component position according to a predetermined rule;
[0053] A3: Output at least the sub-component reconstruction value.
[0054] A coding device in which point predicted chrominance reconstruction values come from multiple reference positions, the coding device comprising at least a module capable of implementing the following functions and operations:
[0055] Original data input module: input original data of at least one whole compression unit;
[0056] A sub-component reconstruction module: for some or all elements in the entire compression unit, at least from the sub-components of the reference elements at multiple positions corresponding to one sub-component position, obtain the sub-component reconstruction value of the sub-component position according to a predetermined rule;
[0057] Output module: outputs at least the sub-component reconstruction value.
[0058] A decoding method in which a point predicted chrominance reconstruction value comes from a plurality of reference positions, the decoding method comprising at least the following steps:
[0059] B1: input at least one compressed data stream of a whole compression unit;
[0060] B2: for some or all elements in the entire compression unit, at least from the sub-components of the reference elements at multiple positions corresponding to one sub-component position, obtain the sub-component reconstruction value of the sub-component position according to a predetermined rule;
[0061] B3: Output at least the sub-component reconstruction value.
[0062] A decoding device in which point predicted chrominance reconstruction values come from multiple reference positions, the decoding device comprising at least the following modules:
[0063] Compressed data code stream input module: used to input at least one compressed data code stream of a whole compression unit;
[0064] A sub-component reconstruction module is used to obtain, for some or all elements in the entire compression unit, a sub-component reconstruction value of the sub-component position at least from sub-components of reference elements at multiple positions corresponding to a sub-component position according to a predetermined rule;
[0065] Output module: used for outputting at least the secondary component reconstruction value.
[0066] The entire 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.
[0067] Preferably, the multiple positions are positions whose reference elements are located at the correct position and thus the reference elements themselves have secondary components; in the case where only one position of the reference element is located at the correct position, the multiple positions degenerate into only one position; in the case where no reference element at any position is located at the correct position, the secondary component reconstruction value is a predetermined default value;
[0068] Preferably, the predetermined default value of the sub-component reconstruction value is zero.
[0069] Preferably, the predetermined rule includes that the sub-component reconstruction value is equal to the average value of the sub-component values of the reference elements at the multiple positions; in the case where the element component is an integer of a fixed bit length, the average value is also an integer of the same fixed bit length obtained according to a predetermined rounding rule;
[0070] Preferably, the predetermined rule further includes that the sub-component reconstruction value is equal to the value of the sub-component of the reference element at the corresponding positive position, and also includes that the sub-component reconstruction value is equal to the average value of the values of the sub-components of the reference elements at the multiple positions; in the case where the element component is an integer of a fixed bit length, the average value is also an integer of the same fixed bit length obtained according to the predetermined rounding rule;
[0071] Preferably, the predetermined rule includes: a portion of the sub-component reconstruction values are equal to the values of the sub-components of the corresponding reference elements at the positive positions, and another portion of the sub-component reconstruction values are equal to the average values of the sub-components of the reference elements at the multiple positions; in the case where the element component is an integer of a fixed bit length, the average value is also an integer of the same fixed bit length obtained according to the predetermined rounding rule;
[0072] Preferably, the predetermined rules include: if the positive position corresponding to the sub-component itself coincides with one of the positions of the reference element of the multiple positions, then the reconstructed value of the sub-component is equal to the numerical value of the sub-component of the reference element of the corresponding positive position; otherwise, the reconstructed value of the sub-component is equal to the average value of the numerical values of the sub-component of the reference element of the multiple positions; in the case where the element component is an integer of a fixed bit length, the average value is also an integer of the same fixed bit length obtained according to the predetermined rounding rule.
[0073] Preferably, the reference element is a frequently occurring position reference element or an unmatched reference element;
[0074] Preferably, each string in the entire compression unit has a string type tag, which is used to indicate whether the string type of the string is a unit base vector string, i.e., a copy of the above string type, an equal value string type, or an unmatched element string type;
[0075] Each element in the whole compression unit has an element type tag, which is used to indicate the string type associated with the element; the value of the element type tag of the element on the equal value string and the unmatched element string is equal to the value of the string type tag of the string; for an element on the unit base vector string, if the element type tag of the element directly above the element indicates that the string type associated with the element directly above the element is the unmatched element string type, then the value of the element type tag of the element is equal to the value of the element type tag of the element directly above the element, otherwise, the value of the element type tag of the element is equal to the value of the string type tag of the string;
[0076] The reference element is a frequently occurring position reference element or an unmatched reference element;
[0077] If the element type tag of the reference element indicates that the string type associated with the reference element is an unmatched element string type, then the reference element is an unmatched reference element, otherwise, the reference element is a normally occurring position reference element;
[0078] Preferably, each string in the entire compression unit has a string type tag, which is used to indicate whether the string type of the string is a unit base vector string, i.e., a copy of the above string type, an equal value string type, or an unmatched element string type;
[0079] Each element in the whole compression unit has an element type tag, which is used to indicate the string type associated with the element; the value of the element type tag of the element on the equal value string and the unmatched element string is equal to the value of the string type tag of the string; for an element on the unit base vector string, if the element type tag of the element directly above the element indicates that the string type associated with the element directly above the element is the unmatched element string type, then the value of the element type tag of the element is equal to the value of the element type tag of the element directly above the element, otherwise, the value of the element type tag of the element is equal to the value of the string type tag of the string;
[0080] Each element in the entire compression unit has a frequently occurring position index tag. If the original source of the element is a frequently occurring position element, the value of the frequently occurring position index tag is equal to the value of the frequently occurring position index of the frequently occurring position element as the source. Otherwise, the frequently occurring position index tag is invalid.
[0081] The information of the unmatched elements in the entire compression unit is stored in an unmatched element array or an unmatched element position array, and each unmatched element stored in the array is marked with an index, which is called an unmatched element index or an unmatched element position index; the information of each unmatched element stored in the unmatched element array includes whether the unmatched element has only a main component or a main component and a secondary component, and also includes the value of each component of the unmatched element; or, the information of each unmatched element stored in the unmatched element position array includes the position of the unmatched element in the entire compression unit; one of the representation methods of the unmatched element position is a coordinate in a predetermined form;
[0082] Each element in the entire compression unit has an unmatched element index tag or an unmatched element position index tag. If the original source of the element is an unmatched element, the value of the unmatched element index tag or the value of the unmatched element position index tag is equal to the value of the unmatched element index or the value of the unmatched element position index of the unmatched element as the source. Otherwise, the unmatched element index tag or the unmatched element position index tag is invalid.
[0083] The reference element is a frequently occurring position reference element or an unmatched reference element;
[0084] At least according to the element type tag, the often-occurring position index tag, the unmatched element index tag or the unmatched element position index tag of the reference element, at least the following operations are performed to derive the values of each component of the reference element;
[0085] Operation 1: If the element type tag of the reference element indicates that the string type associated with the reference element is an unmatched element string type, the reference element is an unmatched reference element, and operation 3 is performed; otherwise, the reference element is a frequently occurring position reference element, and operation 2 is performed;
[0086] Operation 2: according to the often-occurring position index mark of the reference element, obtain the corresponding often-occurring position from the often-occurring position array, and then obtain the values of each component possessed by the often-occurring position;
[0087] Operation 3: According to the unmatched element index mark of the reference element, obtain the values of each component of the corresponding unmatched element from the unmatched element array, or according to the unmatched element position index mark of the reference element, obtain the corresponding unmatched element position in the unmatched element position array, and then obtain the values of each component from the unmatched element position.
[0088] Preferably, the raw data is an array or sequence of two-dimensional data elements including an image, a sequence of images, a video, or an array or sequence of arrays, the data is an array or sequence of two-dimensional data elements in a 420 sampling format, having one main component F and two secondary components D and E;
[0089] A D component element D[i][j] and an E component element E[i][j] with position coordinates (i,j) correspond to 2×2 four F component elements F[2i][2j], i.e., upper left position, (2i+1,2j) upper right position, (2i,2j+1) lower left position, (2i+1,2j+1) lower right position, F[2i][2j], i.e., upper left element, F[2i+1][2j], i.e., upper right element, F[2i][2j+1], i.e., lower left element, and F[2i+1][2j+1], i.e., lower right element, arranged up, down, left, and right.
[0090] The reconstructed value of the sub-component with position coordinates (i, j) is equal to the average value of the sub-components of the reference elements in the K positions whose reference elements are located in the positive position and thus have sub-components themselves, among the upper left position, the upper right position, the lower left position, and the lower right position, where K satisfies 0≤K≤4; in the case where the element component is an integer of a fixed bit length, the average value is also an integer of the same fixed bit length obtained according to a predetermined rounding rule; if K is equal to 0, the reconstructed value of the sub-component is equal to 0.
[0091] Preferably, the raw data is an array or sequence of two-dimensional data elements including an image, a sequence of images, a video, or an array or sequence of arrays, the data is an array or sequence of two-dimensional data elements in a 420 sampling format, with one main component Y and two secondary components Cb and Cr;
[0092] The width and height of the current compression unit being encoded or decoded are width and height respectively;
[0093] The information of the unmatched elements in the current whole compression unit is stored in an unmatched element array or an unmatched element position array, and each unmatched element stored in the array is marked with an index, which is called an unmatched element index or an unmatched element position index; the information of each unmatched element stored in the unmatched element array includes whether the unmatched element has only a main component or a main component and a secondary component, and also includes the value of each component of the unmatched element; or, the information of each unmatched element stored in the unmatched element position array includes the position of the unmatched element in the whole compression unit; one of the representation methods of the unmatched element position is a coordinate in a predetermined form;
[0094] Each string in the current compression unit has a string type tag StringType. The value of StringType is 0, which means that the string type of the string is the unit base vector string, that is, the string type of the copy above. The value of StringType is 1, which means that the string type of the string is the equal value string type. The value of StringType is 2, which means that the string type of the string is the unmatched element string type.
[0095] Each element in the current whole compression unit, whose serial number is Snum, has a corresponding element type tag PixelType[Snum], a common position index tag PvAddr[Snum], an unmatched element index tag UpIdx[Snum] or an unmatched element position index tag UpAddr[Snum]; the serial number starts from the serial number 0 of the scan start element, and increases by one element by element along the scan path. The serial number is actually the number of elements in the current whole compression unit that have completed encoding and decoding before the current element; the horizontal coordinate and vertical coordinate of the element with serial number Snum in the current whole compression unit are sxInCu=TravScan[Log(width)-2][Log(height)-2][Snum][0] and syInCu=TravScan[Log(width)-2][Log(height)-2][Snum][1], respectively, where TravScan maps the serial number Snum to the horizontal coordinate sxInCu and the vertical coordinate syInCu;
[0096] For elements on the equal value string, the value of PixelType[Snum] is equal to 1, the value of PvAddr[Snum] is equal to the value of the common position index of the equal value string, and the value of UpIdx[Snum] or UpAddr[Snum] is invalid;
[0097] For an element on an unmatched element string, the value of PixelType[Snum] is equal to 2, the value of PvAddr[Snum] is invalid, and the value of UpIdx[Snum] is equal to the number of equal value strings that have been encoded and decoded before the current unmatched element in the entire compression unit plus the number of unit basis vector strings plus the number of unmatched elements, or the value of UpAddr[Snum] is equal to the number of unmatched elements that have been encoded and decoded before the current unmatched element in the entire compression unit;
[0098] For an element on the unit base vector string, the syntax description table for assigning the PixelType[Snum], PvAddr[Snum], UpIdx[Snum] or UpAddr[Snum] of the current element at least includes:
[0099] StringType[i] = 0 / / The value of the string type flag StringType of the unit basis vector string is equal to 0
[0100] for (k = 0; k < StrLen; ++k) { / / Perform the following operations for each element of the unit basis vector string
[0101] offsetAbove = (syInCu & 1) == 0? 2 * sxInCu + 1 : 2 * (width - sxInCu) - 1
[0102] if (PixelType[Snum - offsetAbove] == 2) { / / If the value of PixelType of the element directly above the current element is equal to 2
[0103] PixelType[Snum] = 2 / / The value of PixelType of the current element is also equal to 2
[0104] UpIdx[Snum] = UpIdx[Snum - offsetAbove] / / The value of UpIdx of the current element is equal to the value of UpIdx of its directly above element, PvAddr is invalid and does not need to be assigned
[0105] Or
[0106] UpAddr[Snum] = UpAddr[Snum - offsetAbove] / / The value of UpAddr of the current element is equal to the value of UpAddr of its directly above element, PvAddr is invalid and does not need to be assigned
[0107] }
[0108] else { / / Otherwise, that is, if the value of PixelType of the element directly above the current element is not equal to 2
[0109] PixelType[Snum] = 0 / / The value of PixelType of the current element is equal to 0
[0110] PvAddr[Snum] = PvAddr[Snum - offsetAbove] / / The value of PvAddr of the current element is equal to the value of PvAddr of its directly above element, UpIdx or UpAddr is invalid and does not need to be assigned
[0111] }
[0112] Snum++ / / Increment the sequence number by one
[0113] } / / Perform the above operations for each element of the unit basis vector string
[0114] In the above syntax description table, StrLen is the length of the unit base vector string, and offsetAbove is actually the sequence number Snum of the current element minus the sequence number of the element directly above it. Therefore, the sequence number of the element directly above it is equal to Snum-offsetAbove;
[0115] Preferably, in the above encoding method or encoding device or decoding method or decoding device, when sxInCu and syInCu of the current element are both even numbers, the sub-component reconstruction value recC of the current element is calculated from the sub-components of the reference elements of the elements at four positions whose coordinates are (sxInCu, syInCu), (sxInCu+1,syInCu), (sxInCu,syInCu+1), (sxInCu+1,syInCu+1), wherein recC traverses the reconstruction values recCb and recCr of the two sub-components Cb and Cr;
[0116] The number of elements in the four positions whose reference elements have secondary components is K, and K satisfies 0≤K≤4;
[0117] When K is greater than 0, the K reference elements are denoted as ref[k], and the sequence number of ref[k] is denoted as Snum[k], 1≤k≤K; the process of deriving the value refC[k] of the secondary component of ref[k], 1≤k≤K, is as follows:
[0118] If the value of PixelType[Snum[k]] is not equal to 2, refC[k] is equal to the value of the minor component of the element at the constant position in the constant position array whose constant position index is PvAddr[Snum[k]];
[0119] If the value of PixelType[Snum[k]] is equal to 2, refC[k] is equal to the value of the minor component of the unmatched element at the unmatched element index UpIdx[Snum[k]] in the unmatched element array or refC[k] is equal to the value of the minor component of the unmatched element at the unmatched element position index UpAddr[Snum[k]] in the unmatched element position array;
[0120] The sub-component reconstruction value recC of the current element is equal to the average value of the K refC[k]; in the case where the element component is an integer of a fixed bit length, the average value is also an integer of the same fixed bit length obtained according to a predetermined rounding rule;
[0121] When K is equal to 0, the subcomponent reconstruction value recC of the current element is equal to 0;
[0122] Preferably, the coordinates of the frequently occurring position represented by the point vector in the frequently occurring position array are recorded as (PvX[p], PvY[p]), where p is the frequently occurring position index;
[0123] The value of the subcomponent of the unmatched element in the unmatched element array is recorded as UpC[p], where p is the unmatched element index or the coordinates of the unmatched element position in the unmatched element position array are recorded as (UpX[p], UpY[p]), where p is the unmatched element position index;
[0124] If the value of PixelType[Snum[k]] is not equal to 2, refC[k] is equal to the value of the minor component of the element at the normally occurring position with coordinates (PvX[PvAddr[Snum[k]]], PvY[PvAddr[Snum[k]]]);
[0125] If the value of PixelType[Snum[k]] is equal to 2, refC[k] is equal to UpC[UpIdx[Snum[k]]] or refC[k] is equal to the value of the minor component of the unmatched element at the unmatched element position with coordinates (UpX[UpAddr[Snum[k]]], UpY[UpAddr[Snum[k]]]);
[0126] The K refC[k] and recC are all integers of fixed bit length of 8, 10, 12, 14 or 16 bits;
[0127] Let the sum of the K refC[k] be refCsum, and the calculation formula of the secondary component reconstruction value recC of the current element is:
[0128] recC=(refCsum+(K>>1)) / K
[0129] Among them, >> is a binary right shift operation, and / is an integer division.
[0130] The present invention is applicable to encoding and decoding of lossy compressed data, and 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 is also applicable to encoding and decoding of data of two or more dimensions such as images, image sequences or video data.
[0131] In lossy compression, the values of elements in the original equal-value string before encoding are allowed to differ, but the difference is less than a predetermined threshold.
[0132] In the present invention, the data involved in data compression includes one or a combination of the following types of data:
[0133] 1) One-dimensional data;
[0134] 2) Two-dimensional data;
[0135] 3) Multidimensional data;
[0136] 4) Graphics;
[0137] 5) Fractal graphics;
[0138] 6) Image;
[0139] 7) Sequence of images;
[0140] 8) Video;
[0141] 9) Audio;
[0142] 10) Documents;
[0143] 11) Bytes;
[0144] 12) Bit;
[0145] 13) Pixels;
[0146] 14) Three-dimensional scene;
[0147] 15) Sequence of continuously changing three-dimensional scenes;
[0148] 16) Virtual reality scenes;
[0149] 17) Sequence of continuously changing virtual reality scenes
[0150] 18) Images in pixel form;
[0151] 19) Transform domain data of the image;
[0152] 20) A collection of bytes of two or more dimensions;
[0153] 21) A set of bits of two or more dimensions;
[0154] 22) A collection of pixels;
[0155] 23) a collection of single-component pixels;
[0156] 24) A set of three-component pixels (R, G, B, A);
[0157] 25) A set of three-component pixels (Y, U, V);
[0158] 26) A set of three-component pixels (Y, Cb, Cr);
[0159] 27) A set of three-component pixels (Y, Cg, Co);
[0160] 28) A set of four-component pixels (C, M, Y, K);
[0161] 29) A set of four-component pixels (R, G, B, A);
[0162] 30) A set of four-component pixels (Y, U, V, A);
[0163] 31) A set of four-component pixels (Y, Cb, Cr, A);
[0164] 32) A set of four-component pixels (Y, Cg, Co, A).
[0165] In summary, the present invention has the following beneficial effects:
[0166] The present invention provides a method and device for encoding and decoding using point prediction, which can obtain the sub-component reconstruction value of the sub-component position from the sub-component values of the reference elements at multiple positions corresponding to a sub-component position for part or all of the elements in the entire compression unit according to a predetermined rule, thereby improving the accuracy and quality of the reconstructed elements of the sub-component and greatly improving the encoding efficiency of the point prediction technology. DETAILED DESCRIPTION
[0167] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the present invention is further described below in conjunction with specific embodiments.
[0168] The present invention proposes a coding method in which a point prediction chromaticity reconstruction value comes from multiple reference positions, and the coding method at least comprises the following steps:
[0169] A1: Input the original data of at least one whole compression unit;
[0170] A2: for some or all elements in the entire compression unit, at least from the sub-components of the reference elements at multiple positions corresponding to one sub-component position, obtain the sub-component reconstruction value of the sub-component position according to a predetermined rule;
[0171] A3: Output at least the sub-component reconstruction value.
[0172] A coding device in which point predicted chrominance reconstruction values come from multiple reference positions, the coding device comprising at least a module capable of implementing the following functions and operations:
[0173] Original data input module: input original data of at least one whole compression unit;
[0174] A sub-component reconstruction module: for some or all elements in the entire compression unit, at least from the sub-components of the reference elements at multiple positions corresponding to one sub-component position, obtain the sub-component reconstruction value of the sub-component position according to a predetermined rule;
[0175] Output module: outputs at least the sub-component reconstruction value.
[0176] A decoding method in which a point predicted chrominance reconstruction value comes from a plurality of reference positions, the decoding method comprising at least the following steps:
[0177] B1: input at least one compressed data stream of a whole compression unit;
[0178] B2: for some or all elements in the entire compression unit, at least from the sub-components of the reference elements at multiple positions corresponding to one sub-component position, obtain the sub-component reconstruction value of the sub-component position according to a predetermined rule;
[0179] B3: Output at least the sub-component reconstruction value.
[0180] A decoding device in which point predicted chrominance reconstruction values come from multiple reference positions, the decoding device comprising at least the following modules:
[0181] Compressed data code stream input module: used to input at least one compressed data code stream of a whole compression unit;
[0182] A sub-component reconstruction module is used to obtain, for some or all elements in the entire compression unit, a sub-component reconstruction value of the sub-component position at least from sub-components of reference elements at multiple positions corresponding to a sub-component position according to a predetermined rule;
[0183] Output module: used for outputting at least the secondary component reconstruction value.
[0184] Example 1
[0185] In the case where the original data is an array of two-dimensional data elements including an image, a sequence of images, or a video, or a sequence of arrays, the entire 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.
[0186] Example 2
[0187] The multiple positions are positions whose reference elements are located at the correct position and thus the reference elements themselves have secondary components; in the case where only one position of the reference element is located at the correct position, the multiple positions are degenerated into only one position; in the case where no reference element at any position is located at the correct position, the secondary component reconstruction value is a predetermined default value;
[0188] Preferably,
[0189] In the case that no reference element at any position is located at a positive position, the predetermined default value of the secondary component reconstruction value is zero.
[0190] Example 3
[0191] The predetermined rule includes that the sub-component reconstruction value is equal to the average value of the sub-component values of the reference elements at the multiple positions; in the case where the element component is an integer of a fixed bit length, the average value is also an integer of the same fixed bit length obtained according to a predetermined rounding rule;
[0192] Preferably, the predetermined rule further includes that the sub-component reconstruction value is equal to the value of the sub-component of the reference element at the corresponding positive position, and also includes that the sub-component reconstruction value is equal to the average value of the values of the sub-components of the reference elements at the multiple positions; in the case where the element component is an integer of a fixed bit length, the average value is also an integer of the same fixed bit length obtained according to the predetermined rounding rule;
[0193] Preferably, the predetermined rules include: a part of the sub-component reconstruction values are equal to the numerical value of the sub-component of the reference element at the corresponding positive position, and another part of the sub-component reconstruction values are equal to the average value of the sub-component of the reference elements at the multiple positions; in the case where the element component is an integer of a fixed bit length, the average value is also an integer of the same fixed bit length obtained according to the predetermined rounding rule.
[0194] Preferably, the predetermined rules include: if the positive position corresponding to the sub-component itself coincides with one of the positions of the reference element of the multiple positions, then the reconstructed value of the sub-component is equal to the numerical value of the sub-component of the reference element of the corresponding positive position; otherwise, the reconstructed value of the sub-component is equal to the average value of the numerical values of the sub-component of the reference element of the multiple positions; in the case where the element component is an integer of a fixed bit length, the average value is also an integer of the same fixed bit length obtained according to the predetermined rounding rule.
[0195] Example 4
[0196] The reference element is a frequently occurring position reference element or an unmatched reference element;
[0197] Preferably, each string in the entire compression unit has a string type tag, which is used to indicate whether the string type of the string is a unit base vector string, i.e., a copy of the above string type, an equal value string type, or an unmatched element string type;
[0198] Each element in the whole compression unit has an element type tag, which is used to indicate the string type associated with the element; the value of the element type tag of the element on the equal value string and the unmatched element string is equal to the value of the string type tag of the string; for an element on the unit base vector string, if the element type tag of the element directly above the element indicates that the string type associated with the element directly above the element is the unmatched element string type, then the value of the element type tag of the element is equal to the value of the element type tag of the element directly above the element, otherwise, the value of the element type tag of the element is equal to the value of the string type tag of the string;
[0199] The reference element is a frequently occurring position reference element or an unmatched reference element;
[0200] If the element type tag of the reference element indicates that the string type associated with the reference element is an unmatched element string type, then the reference element is an unmatched reference element, otherwise, the reference element is a normally occurring position reference element;
[0201] Preferably, each string in the entire compression unit has a string type tag, which is used to indicate whether the string type of the string is a unit base vector string, i.e., a copy of the above string type, an equal value string type, or an unmatched element string type;
[0202] Each element in the whole compression unit has an element type tag, which is used to indicate the string type associated with the element; the value of the element type tag of the element on the equal value string and the unmatched element string is equal to the value of the string type tag of the string; for an element on the unit base vector string, if the element type tag of the element directly above the element indicates that the string type associated with the element directly above the element is the unmatched element string type, then the value of the element type tag of the element is equal to the value of the element type tag of the element directly above the element, otherwise, the value of the element type tag of the element is equal to the value of the string type tag of the string;
[0203] Each element in the entire compression unit has a frequently occurring position index tag. If the original source of the element is a frequently occurring position element, the value of the frequently occurring position index tag is equal to the value of the frequently occurring position index of the frequently occurring position element as the source. Otherwise, the frequently occurring position index tag is invalid.
[0204] The information of the unmatched elements in the entire compression unit is stored in an unmatched element array or an unmatched element position array, and each unmatched element stored in the array is marked with an index, which is called an unmatched element index or an unmatched element position index; the information of each unmatched element stored in the unmatched element array includes whether the unmatched element has only a main component or a main component and a secondary component, and also includes the value of each component of the unmatched element; or, the information of each unmatched element stored in the unmatched element position array includes the position of the unmatched element in the entire compression unit; one of the representation methods of the unmatched element position is a coordinate in a predetermined form;
[0205] Each element in the entire compression unit has an unmatched element index tag or an unmatched element position index tag. If the original source of the element is an unmatched element, the value of the unmatched element index tag or the value of the unmatched element position index tag is equal to the value of the unmatched element index or the value of the unmatched element position index of the unmatched element as the source. Otherwise, the unmatched element index tag or the unmatched element position index tag is invalid.
[0206] The reference element is a frequently occurring position reference element or an unmatched reference element;
[0207] At least according to the element type tag, the often-occurring position index tag, the unmatched element index tag or the unmatched element position index tag of the reference element, at least the following operations are performed to derive the values of each component of the reference element;
[0208] Operation 1: If the element type tag of the reference element indicates that the string type associated with the reference element is an unmatched element string type, the reference element is an unmatched reference element, and operation 3 is performed; otherwise, the reference element is a frequently occurring position reference element, and operation 2 is performed;
[0209] Operation 2: according to the often-occurring position index mark of the reference element, obtain the corresponding often-occurring position from the often-occurring position array, and then obtain the values of each component possessed by the often-occurring position;
[0210] Operation 3: According to the unmatched element index mark of the reference element, obtain the values of each component of the corresponding unmatched element from the unmatched element array, or according to the unmatched element position index mark of the reference element, obtain the corresponding unmatched element position in the unmatched element position array, and then obtain the values of each component from the unmatched element position.
[0211] Example 5
[0212] In the case where the original data is an array or sequence of two-dimensional data elements including an image, a sequence of images, or a video, the data is an array or sequence of two-dimensional data elements in a 420 sampling format, with one primary component F and two secondary components D and E;
[0213] A D component element D[i][j] and an E component element E[i][j] with position coordinates (i,j) correspond to 2×2 four F component elements F[2i][2j], i.e., upper left position, (2i+1,2j) upper right position, (2i,2j+1) lower left position, (2i+1,2j+1) lower right position, F[2i][2j], i.e., upper left element, F[2i+1][2j], i.e., upper right element, F[2i][2j+1], i.e., lower left element, and F[2i+1][2j+1], i.e., lower right element, arranged up, down, left, and right.
[0214] The reconstructed value of the sub-component with position coordinates (i, j) is equal to the average value of the sub-components of the reference elements in the K positions whose reference elements are located in the positive position and thus have sub-components themselves, among the upper left position, the upper right position, the lower left position, and the lower right position, where K satisfies 0≤K≤4; in the case where the element component is an integer of a fixed bit length, the average value is also an integer of the same fixed bit length obtained according to a predetermined rounding rule; if K is equal to 0, the reconstructed value of the sub-component is equal to 0.
[0215] Example 6
[0216] In the case where the raw data is an array or sequence of arrays of two-dimensional data elements comprising an image, a sequence of images or a video, the data is an array or sequence of arrays of two-dimensional data elements in a 420 sampling format, with one major component Y and two minor components Cb and Cr;
[0217] The width and height of the current compression unit being encoded or decoded are width and height respectively;
[0218] The information of the unmatched elements in the current whole compression unit is stored in an unmatched element array or an unmatched element position array, and each unmatched element stored in the array is marked with an index, which is called an unmatched element index or an unmatched element position index; the information of each unmatched element stored in the unmatched element array includes whether the unmatched element has only a main component or a main component and a secondary component, and also includes the value of each component of the unmatched element; or, the information of each unmatched element stored in the unmatched element position array includes the position of the unmatched element in the whole compression unit; one of the representation methods of the unmatched element position is a coordinate in a predetermined form;
[0219] Each string in the current compression unit has a string type tag StringType. The value of StringType is 0, which means that the string type of the string is the unit base vector string, that is, the string type of the copy above. The value of StringType is 1, which means that the string type of the string is the equal value string type. The value of StringType is 2, which means that the string type of the string is the unmatched element string type.
[0220] Each element in the current whole compression unit, whose serial number is Snum, has a corresponding element type tag PixelType[Snum], a common position index tag PvAddr[Snum], an unmatched element index tag UpIdx[Snum] or an unmatched element position index tag UpAddr[Snum]; the serial number starts from the serial number 0 of the scan start element, and increases by one element by element along the scan path. The serial number is actually the number of elements in the current whole compression unit that have completed encoding and decoding before the current element; the horizontal coordinate and vertical coordinate of the element with serial number Snum in the current whole compression unit are sxInCu=TravScan[Log(width)-2][Log(height)-2][Snum][0] and syInCu=TravScan[Log(width)-2][Log(height)-2][Snum][1], respectively, where TravScan maps the serial number Snum to the horizontal coordinate sxInCu and the vertical coordinate syInCu;
[0221] For elements on the equal value string, the value of PixelType[Snum] is equal to 1, the value of PvAddr[Snum] is equal to the value of the common position index of the equal value string, and the value of UpIdx[Snum] or UpAddr[Snum] is invalid;
[0222] For an element on an unmatched element string, the value of PixelType[Snum] is equal to 2, the value of PvAddr[Snum] is invalid, and the value of UpIdx[Snum] is equal to the number of equal value strings that have been encoded and decoded before the current unmatched element in the entire compression unit plus the number of unit basis vector strings plus the number of unmatched elements, or the value of UpAddr[Snum] is equal to the number of unmatched elements that have been encoded and decoded before the current unmatched element in the entire compression unit;
[0223] For an element on the unit base vector string, the syntax description table for assigning the PixelType[Snum], PvAddr[Snum], UpIdx[Snum] or UpAddr[Snum] of the current element at least includes:
[0224]
[0225]
[0226] StringType[i] = 0 / / The value of the string type flag StringType of the unit basis vector string is equal to 0
[0227] for (k = 0; k < StrLen; ++k) { / / Perform the following operations for each element of the unit basis vector string
[0228] offsetAbove = (syInCu & 1) == 0? 2 * sxInCu + 1 : 2 * (width - sxInCu) - 1
[0229] if (PixelType[Snum - offsetAbove] == 2) { / / If the value of PixelType of the element directly above the current element is equal to 2
[0230] PixelType[Snum] = 2 / / The value of PixelType of the current element is also equal to 2
[0231] UpIdx[Snum] = UpIdx[Snum - offsetAbove] / / The value of UpIdx of the current element is equal to the value of UpIdx of its directly above element, PvAddr is invalid and does not need to be assigned
[0232] Or
[0233] UpAddr[Snum] = UpAddr[Snum - offsetAbove] / / The value of UpAddr of the current element is equal to the value of UpAddr of its directly above element, PvAddr is invalid and does not need to be assigned
[0234] }
[0235] else { / / Otherwise, that is, if the value of PixelType of the element directly above the current element is not equal to 2
[0236] PixelType[Snum] = 0 / / The value of PixelType of the current element is equal to 0
[0237] PvAddr[Snum] = PvAddr[Snum - offsetAbove] / / The value of PvAddr of the current element is equal to the value of PvAddr of its directly above element, UpIdx or UpAddr is invalid and does not need to be assigned
[0238] }
[0239] Snum++ / / Increase the serial number by one} / / Perform the above operation for each element of the unit base vector string
[0240] In the above syntax description table, StrLen is the length of the unit base vector string, and offsetAbove is actually the sequence number Snum of the current element minus the sequence number of the element directly above it. Therefore, the sequence number of the element directly above it is equal to Snum-offsetAbove;
[0241] Preferably, when sxInCu and syInCu of the current element are both even numbers, the sub-component reconstruction value recC of the current element is calculated from the sub-components of the reference elements of the elements at four positions with coordinates (sxInCu, syInCu), (sxInCu+1, syInCu), (sxInCu, syInCu+1), (sxInCu+1, syInCu+1), wherein recC traverses the reconstruction values recCb and recCr of the two sub-components Cb and Cr;
[0242] The number of elements in the four positions whose reference elements have secondary components is K, and K satisfies 0≤K≤4;
[0243] When K is greater than 0, the K reference elements are denoted as ref[k], and the sequence number of ref[k] is denoted as Snum[k], 1≤k≤K; the process of deriving the value refC[k] of the secondary component of ref[k], 1≤k≤K, is as follows:
[0244] If the value of PixelType[Snum[k]] is not equal to 2, refC[k] is equal to the value of the minor component of the element at the constant position in the constant position array whose constant position index is PvAddr[Snum[k]];
[0245] If the value of PixelType[Snum[k]] is equal to 2, refC[k] is equal to the value of the minor component of the unmatched element at the unmatched element index UpIdx[Snum[k]] in the unmatched element array or refC[k] is equal to the value of the minor component of the unmatched element at the unmatched element position index UpAddr[Snum[k]] in the unmatched element position array;
[0246] The sub-component reconstruction value recC of the current element is equal to the average value of the K refC[k]; in the case where the element component is an integer of a fixed bit length, the average value is also an integer of the same fixed bit length obtained according to a predetermined rounding rule;
[0247] When K is equal to 0, the subcomponent reconstruction value recC of the current element is equal to 0;
[0248] Preferably,
[0249] The coordinates of the common position represented by the point vector in the common position array are recorded as (PvX[p], PvY[p]), where p is the common position index;
[0250] The value of the subcomponent of the unmatched element in the unmatched element array is recorded as UpC[p], where p is the unmatched element index or the coordinates of the unmatched element position in the unmatched element position array are recorded as (UpX[p], UpY[p]), where p is the unmatched element position index;
[0251] If the value of PixelType[Snum[k]] is not equal to 2, refC[k] is equal to the value of the minor component of the element at the normally occurring position with coordinates (PvX[PvAddr[Snum[k]]], PvY[PvAddr[Snum[k]]]);
[0252] If the value of PixelType[Snum[k]] is equal to 2, refC[k] is equal to UpC[UpIdx[Snum[k]]] or refC[k] is equal to the value of the minor component of the unmatched element at the unmatched element position with coordinates (UpX[UpAddr[Snum[k]]], UpY[UpAddr[Snum[k]]]);
[0253] The K refC[k] and recC are all integers of fixed bit length of 8, 10, 12, 14 or 16 bits;
[0254] Let the sum of the K refC[k] be refCsum, and the calculation formula of the secondary component reconstruction value recC of the current element is:
[0255] recC=(refCsum+(K>>1)) / K
[0256] Among them, >> is a binary right shift operation, and / is an integer division.
[0257] The method and device for encoding and decoding using point prediction described in the present invention can obtain the sub-component reconstruction value of the sub-component position from the sub-component values of the reference elements at multiple positions corresponding to a sub-component position for part or all of the elements in the entire compression unit according to a predetermined rule, thereby improving the accuracy and quality of the reconstructed elements of the sub-component, greatly improving the encoding efficiency of the point prediction technology, and having a wide range of applications.
[0258] In the description of the present invention, it should be noted that the terms "upper", "lower", "inner", "outer", "left", "right" and the like indicate the orientation or positional relationship that the product of the invention is usually placed in when in use, or the orientation or positional relationship that is commonly understood by those skilled in the art, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. In addition, the terms "first", "second" and the like are only used to distinguish the description, and cannot be understood as indicating or implying relative importance. In the description of the present invention, it should also be noted that, unless otherwise clearly specified and limited, the terms "set", "connection" and the like should be understood in a broad sense, for example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or an indirect connection through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances. In this document, the terms "comprises," "comprising," or any other variations thereof, are intended to cover a non-exclusive inclusion of elements other than those listed and may also include additional elements not expressly listed.
[0259] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. The present invention may be subject to various changes and improvements without departing from the spirit and scope of the present invention. These changes and improvements fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A coding method in which point prediction chrominance reconstruction values come from multiple reference positions, characterized in that: The encoding method comprises at least the following steps: A1: Input the original data of at least one whole compression unit; A2: for some or all elements in the entire compression unit, at least from the sub-components of the reference elements at multiple positions corresponding to a sub-component position, obtain the sub-component reconstruction value of the sub-component position according to a predetermined rule; the multiple positions are positions where the reference elements are located at positive positions and thus the reference elements themselves have sub-components; A3: Output at least the sub-component reconstruction value.
2. An encoding device in which point predicted chrominance reconstruction values are derived from a plurality of reference positions, characterized in that The encoding device includes at least a module capable of implementing the following functions and operations: Original data input module: input original data of at least one whole compression unit; A sub-component reconstruction module: for some or all elements in the entire compression unit, at least from the sub-components of the reference elements at multiple positions corresponding to a sub-component position, obtain the sub-component reconstruction value of the sub-component position according to a predetermined rule; the multiple positions are positions where the reference elements are located at positive positions and thus the reference elements themselves have sub-components; Output module: outputs at least the sub-component reconstruction value.
3. A decoding method in which point predicted chrominance reconstruction values come from multiple reference positions, characterized in that: The decoding method comprises at least the following steps: B1: input at least one compressed data stream of a whole compression unit; B2: for some or all elements in the entire compression unit, at least from the sub-components of the reference elements at multiple positions corresponding to a sub-component position, obtain the sub-component reconstruction value of the sub-component position according to a predetermined rule; the multiple positions are positions where the reference elements are located at positive positions and thus the reference elements themselves have sub-components; B3: Output at least the sub-component reconstruction value.
4. The decoding method according to claim 3 wherein the point prediction chrominance reconstruction value comes from multiple reference positions, characterized in that: The original data includes an image, a sequence of images, an array of two-dimensional data elements of a video, or a sequence of arrays, and the entire 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.
5. The decoding method according to claim 3 wherein the point prediction chrominance reconstruction value comes from multiple reference positions, characterized in that: Including that the plurality of positions are positions whose reference elements are located at positive positions and thus the reference elements themselves have secondary components; in the case where only one position of the reference element is located at the positive position, the plurality of positions degenerates to only one position; Also includes, In the case that no reference element at any position is located at a positive position, the secondary component reconstruction value is a predetermined default value; or, In the case that no reference element at any position is located at a positive position, the predetermined default value of the secondary component reconstruction value is zero.
6. The decoding method according to claim 3 wherein the point prediction chrominance reconstruction value comes from multiple reference positions, characterized in that: The predetermined rule includes one of the following rules: Rule 1: The sub-component reconstruction value is equal to the average value of the sub-component values of the reference elements at the multiple positions; in the case where the element component is an integer of a fixed bit length, the average value is also an integer of the same fixed bit length obtained according to a predetermined rounding rule; Rule 2: A part of the sub-component reconstruction values is equal to the value of the sub-component of the reference element at the corresponding positive position, and another part of the sub-component reconstruction values is equal to the average value of the sub-component values of the reference elements at the multiple positions; In the case where the element components are integers of fixed bit length, the average value is also an integer of the same fixed bit length obtained according to a predetermined rounding rule; Rule 3: If the positive position corresponding to the sub-component coincides with one of the positions of the reference elements of the multiple positions, the reconstructed value of the sub-component is equal to the value of the sub-component of the reference element at the corresponding positive position; otherwise, the reconstructed value of the sub-component is equal to the average value of the values of the sub-components of the reference elements of the multiple positions; In the case where the element components are integers of fixed bit length, the average value is also an integer of the same fixed bit length obtained according to a predetermined rounding rule.
7. The decoding method according to claim 3 wherein the point prediction chrominance reconstruction value comes from multiple reference positions, characterized in that: Includes one of the following characteristics, Feature 1: The reference element is a frequently occurring position reference element or an unmatched reference element; Feature 2: Each string in the entire compression unit has a string type tag, which is used to indicate whether the string type of the string is a unit base vector string, i.e., a copy of the above string type, an equal value string type, or an unmatched element string type; Each element in the whole compression unit has an element type tag, which is used to indicate the string type associated with the element; the value of the element type tag of the element on the equal value string and the unmatched element string is equal to the value of the string type tag of the string; for an element on the unit base vector string, if the element type tag of the element directly above the element indicates that the string type associated with the element directly above the element is the unmatched element string type, then the value of the element type tag of the element is equal to the value of the element type tag of the element directly above the element, otherwise, the value of the element type tag of the element is equal to the value of the string type tag of the string; The reference element is a frequently occurring position reference element or an unmatched reference element; If the element type tag of the reference element indicates that the string type associated with the reference element is an unmatched element string type, then the reference element is an unmatched reference element, otherwise, the reference element is a normally occurring position reference element; Feature 3: Each string in the entire compression unit has a string type tag, which is used to indicate whether the string type of the string is a unit base vector string, i.e., a copy of the above string type, an equal value string type, or an unmatched element string type; Each element in the whole compression unit has an element type tag, which is used to indicate the string type associated with the element; the value of the element type tag of the element on the equal value string and the unmatched element string is equal to the value of the string type tag of the string; for an element on the unit base vector string, if the element type tag of the element directly above the element indicates that the string type associated with the element directly above the element is the unmatched element string type, then the value of the element type tag of the element is equal to the value of the element type tag of the element directly above the element, otherwise, the value of the element type tag of the element is equal to the value of the string type tag of the string; Each element in the entire compression unit has a frequently occurring position index tag. If the original source of the element is a frequently occurring position element, the value of the frequently occurring position index tag is equal to the value of the frequently occurring position index of the frequently occurring position element as the source. Otherwise, the frequently occurring position index tag is invalid. The information of the unmatched elements in the entire compression unit is stored in an unmatched element array or an unmatched element position array, and each unmatched element stored in the array is marked with an index, which is called an unmatched element index or an unmatched element position index; the information of each unmatched element stored in the unmatched element array includes whether the unmatched element has only a main component or a main component and a secondary component, and also includes the value of each component of the unmatched element; or, the information of each unmatched element stored in the unmatched element position array includes the position of the unmatched element in the entire compression unit; one of the representation methods of the unmatched element position is a coordinate in a predetermined form; Each element in the entire compression unit has an unmatched element index tag or an unmatched element position index tag. If the original source of the element is an unmatched element, the value of the unmatched element index tag or the value of the unmatched element position index tag is equal to the value of the unmatched element index or the value of the unmatched element position index of the unmatched element as the source. Otherwise, the unmatched element index tag or the unmatched element position index tag is invalid. The reference element is a frequently occurring position reference element or an unmatched reference element; At least according to the element type tag, the often-occurring position index tag, the unmatched element index tag or the unmatched element position index tag of the reference element, at least the following operations are performed to derive the values of each component of the reference element; Operation 1: If the element type tag of the reference element indicates that the string type associated with the reference element is an unmatched element string type, the reference element is an unmatched reference element, and operation 3 is performed; otherwise, the reference element is a frequently occurring position reference element, and operation 2 is performed; Operation 2: according to the often-occurring position index mark of the reference element, obtain the corresponding often-occurring position from the often-occurring position array, and then obtain the values of each component possessed by the often-occurring position; Operation 3: According to the unmatched element index mark of the reference element, obtain the values of each component of the corresponding unmatched element from the unmatched element array, or according to the unmatched element position index mark of the reference element, obtain the corresponding unmatched element position in the unmatched element position array, and then obtain the values of each component from the unmatched element position.
8. The decoding method according to claim 3 wherein the point prediction chrominance reconstruction value comes from multiple reference positions, characterized in that: The raw data includes an array or sequence of two-dimensional data elements of an image, a sequence of images, or a video, and the data is an array or sequence of two-dimensional data elements in a 420 sampling format, with one main component F and two secondary components D and E; A D component element D[i][j] and an E component element E[i][j] with position coordinates (i,j) correspond to 2×2 four F component elements F[2i][2j], i.e., upper left position, (2i+1,2j) upper right position, (2i,2j+1) lower left position, (2i+1,2j+1) lower right position, F[2i][2j], i.e., upper left element, F[2i+1][2j], i.e., upper right element, F[2i][2j+1], i.e., lower left element, and F[2i+1][2j+1], i.e., lower right element, arranged up, down, left, and right; The reconstructed value of the sub-component with position coordinates (i, j) is equal to the average value of the sub-components of the reference elements in the K positions whose reference elements are located in the positive position and thus have sub-components themselves, among the upper left position, the upper right position, the lower left position, and the lower right position, where K satisfies 0≤K≤4; in the case where the element component is an integer of a fixed bit length, the average value is also an integer of the same fixed bit length obtained according to a predetermined rounding rule; if K is equal to 0, the reconstructed value of the sub-component is equal to 0.
9. The decoding method of claim 3 wherein point prediction chrominance reconstruction values are from multiple reference positions, characterized in that: The raw data includes an array or sequence of two-dimensional data elements of an image, a sequence of images, or a video, wherein the data is an array or sequence of two-dimensional data elements in a 420 sampling format, having a primary component Y and two secondary components Cb and Cr; Note that the width and height of the current compression unit being decoded are width and height respectively; The information of the unmatched elements in the current whole compression unit is stored in an unmatched element array or an unmatched element position array, and each unmatched element stored in the array is marked with an index, which is called an unmatched element index or an unmatched element position index; the information of each unmatched element stored in the unmatched element array includes whether the unmatched element has only a main component or a main component and a secondary component, and also includes the value of each component of the unmatched element; or, the information of each unmatched element stored in the unmatched element position array includes the position of the unmatched element in the whole compression unit; one of the representation methods of the unmatched element position is a coordinate in a predetermined form; Each string in the current compression unit has a string type tag StringType. The value of StringType is 0, which means that the string type of the string is the unit base vector string, that is, the string type of the copy above. The value of StringType is 1, which means that the string type of the string is the equal value string type. The value of StringType is 2, which means that the string type of the string is the unmatched element string type. Each element in the current compression unit, whose serial number is Snum, has a corresponding element type tag PixelType[Snum], a common position index tag PvAddr[Snum], an unmatched element index tag UpIdx[Snum] or an unmatched element position index tag UpAddr[Snum]; the serial number starts from the serial number 0 of the scan start element, and increases by one element by element along the scan path. The serial number is actually the number of elements in the current compression unit that have completed encoding and decoding before the current element; the horizontal coordinate and vertical coordinate of the element with serial number Snum in the current compression unit are sxInCu=TravScan[Log(width)-2][Log(height)-2][Snum][0] and syInCu=TravScan[Log(width)-2][Log(height)-2][Snum][1], respectively, where TravScan maps the serial number Snum to the horizontal coordinate sxInCu and the vertical coordinate syInCu; For elements on the equal value string, the value of PixelType[Snum] is equal to 1, the value of PvAddr[Snum] is equal to the value of the common position index of the equal value string, and the value of UpIdx[Snum] or UpAddr[Snum] is invalid; For an element on an unmatched element string, the value of PixelType[Snum] is equal to 2, the value of PvAddr[Snum] is invalid, and the value of UpIdx[Snum] is equal to the number of equal value strings that have been encoded and decoded before the current unmatched element in the entire compression unit plus the number of unit basis vector strings plus the number of unmatched elements, or the value of UpAddr[Snum] is equal to the number of unmatched elements that have been encoded and decoded before the current unmatched element in the entire compression unit; For an element on the unit base vector string, the syntax description table for assigning a value to PixelType[Snum], PvAddr[Snum], UpIdx[Snum] or UpAddr[Snum] of the current element includes at least: In the above syntax description table, StrLen is the length of the unit base vector string, and offsetAbove is actually the sequence number Snum of the current element minus the sequence number of the element directly above it. Therefore, the sequence number of the element directly above it is equal to Snum–offsetAbove; Its characteristics also include the following characteristics 1 or the following characteristics 2, Feature 1: When sxInCu and syInCu of the current element are both even numbers, the sub-component reconstruction value recC of the current element is calculated from the sub-components of the reference elements of the elements at four positions with coordinates (sxInCu, syInCu), (sxInCu+1, syInCu), (sxInCu, syInCu+1), and (sxInCu+1, syInCu+1), where recC traverses the reconstruction values recCb and recCr of the two sub-components Cb and Cr; The number of elements in the four positions whose reference elements have secondary components is K, and K satisfies 0≤K≤4; When K is greater than 0, the K reference elements are denoted as ref[k], and the sequence number of ref[k] is denoted as Snum[k], 1≤k≤K; the process of deriving the value refC[k] of the secondary component of ref[k], 1≤k≤K, is as follows: If the value of PixelType[Snum[k]] is not equal to 2, refC[k] is equal to the value of the minor component of the element at the constant position in the constant position array whose constant position index is PvAddr[Snum[k]]; If the value of PixelType[Snum[k]] is equal to 2, refC[k] is equal to the value of the minor component of the unmatched element at the unmatched element index UpIdx[Snum[k]] in the unmatched elements array or refC[k] is equal to the value of the minor component of the unmatched element at the unmatched element position index UpAddr[Snum[k]] in the unmatched element positions array; The sub-component reconstruction value recC of the current element is equal to the average value of the K refC[k]; in the case where the element component is an integer of a fixed bit length, the average value is also an integer of the same fixed bit length obtained according to a predetermined rounding rule; When K is equal to 0, the subcomponent reconstruction value recC of the current element is equal to 0; Feature 2: The coordinates of the common position represented by the point vector in the common position array are recorded as (PvX[p], PvY[p]), where p is the common position index; The value of the subcomponent of the unmatched element in the unmatched element array is recorded as UpC[p], where p is the unmatched element index or the coordinates of the unmatched element position in the unmatched element position array are recorded as (UpX[p], UpY[p]), where p is the unmatched element position index; If the value of PixelType[Snum[k]] is not equal to 2, refC[k] is equal to the value of the minor component of the element at the normally occurring position with coordinates (PvX[PvAddr[Snum[k]]], PvY[PvAddr[Snum[k]]]); If the value of PixelType[Snum[k]] is equal to 2, refC[k] is equal to UpC[UpIdx[Snum[k]]] or refC[k] is equal to the value of the minor component of the unmatched element at the unmatched element position with coordinates (UpX[UpAddr[Snum[k]]], UpY[UpAddr[Snum[k]]]); The K refC[k] and recC are all integers of fixed bit length of 8, 10, 12, 14 or 16 bits; Let the sum of the K refC[k] be refCsum, and the calculation formula of the secondary component reconstruction value recC of the current element is: recC=(refCsum+(K>>1)) / K Among them, >> is a binary right shift operation, and / is an integer division.
10. A decoding device for implementing the decoding method of a point prediction chrominance reconstruction value from multiple reference positions as claimed in any one of claims 3 to 9, characterized in that: The decoding device at least comprises the following modules: a compressed data code stream input module, a sub-component reconstruction module and an output module.
