A method, apparatus and system for predictive encoding and decoding of single-string information.
By determining whether the current block contains only one string, and only encoding the string scanning method and string length information when there are multiple strings, the problem of low encoding efficiency in the existing technology is solved, and a more efficient encoding process is achieved.
Patent Information
- Application Number
- CN202210644535.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-02
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2042-06-02
AI Technical Summary
The existing string prediction mode has low coding efficiency, especially when the CU is a single string, the coding block has many syntax elements, resulting in low coding efficiency.
A string prediction encoding and decoding method for single-string information is proposed. By determining whether the current block contains only one string, the string scanning method and string length information are encoded only when there are multiple strings, otherwise no encoding is performed, thus simplifying the encoding process.
It improves encoding efficiency, especially when the CU is a single string, by reducing invalid encoding syntax elements and thus improving encoding efficiency.
Smart Images

Figure CN115118980B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data compression, and in particular to a method, apparatus and system for predictive encoding and decoding of single-string information. Background Technology
[0002] A dataset is a collection of finite data arranged in a certain spatial (one-dimensional, two-dimensional, or multi-dimensional) shape, consisting of data samples, also known as elements (e.g., bytes, bits, pixels, pixel components, spatial sampling points, transform domain coefficients). Examples include a one-dimensional data queue, a two-dimensional data file, a single image frame, a video sequence, a transform domain, a transform block, multiple transform blocks, a three-dimensional scene, and a sequence of continuously changing three-dimensional scenes. When encoding and decoding a dataset, it is typically divided into several subsets with predetermined shapes, called encoding blocks and decoding blocks. These blocks are then encoded or decoded one by one according to a predetermined time sequence.
[0003] String prediction mode is a mode that uses strings as basic units. A sample value, also known as an element (such as a pixel unit or pixel), is the smallest unit of copying. According to a predetermined scanning order, within a given set of reference pixels, if an optimal reference sample value (such as a pixel unit or pixel) string can be found, the positional relationship between the reference sample value string (referred to as the reference string) and the current sample value string to be encoded (also called the current string) and the length of the reference string are represented by the encoding parameter string displacement vector and length, respectively. Otherwise, the unmatched pixel, component, or index pixel unit is encoded.
[0004] In existing string prediction mode codec blocks, for the case of dividing a CU (Coding Unit) into a string, it is still necessary to use syntax elements for encoding the string scanning method and at least one syntax element `length` representing the string length. This results in low encoding efficiency. The existing syntax elements are as follows:
[0005]
[0006] Summary of the Invention
[0007] The technical problem that this invention aims to solve is the low coding efficiency of existing algorithms.
[0008] This invention proposes a string prediction encoding and decoding method, apparatus, and system for single-string information.
[0009] A string prediction coding method for single-string information includes:
[0010] Step 1: Obtain the dataset and encode it using string prediction mode. When encoding the encoding blocks in the dataset, the information indicating whether the current block has only one string is defined as single string information, thereby generating a data bitstream containing single string information.
[0011] Step 2: If the single string information indicates that the current block contains only one string, then the information indicating the string scanning method and the information indicating the string length are not encoded; otherwise, the information indicating the string scanning method and at least one piece of information indicating the string length are encoded to generate a data bitstream containing the information indicating the string scanning method and the string length.
[0012] A string prediction coding device for single-string information, comprising,
[0013] Single-string information encoding module: Encodes information indicating whether the current block contains only one string, which is defined as single-string information, and generates a data bitstream containing single-string information;
[0014] Other string information encoding modules: When the current block contains only one string, information indicating the string scanning method and string length are not encoded; otherwise, information indicating the string scanning method and at least one information indicating the string length are encoded to generate a data bitstream containing information indicating the string scanning method and string length.
[0015] A method for string prediction decoding of single-string information includes:
[0016] Parse the data stream of the string prediction mode to obtain at least the information indicating whether the current block contains only one string, called single string information. If the single string information indicates that the current block contains only one string, then the data stream containing the information indicating the string scanning method and the string length is not parsed; otherwise, the data stream containing the information indicating the string scanning method and the string length is parsed to obtain the string scanning method and at least one string length of the current block.
[0017] A string prediction decoding device for single-string information, comprising:
[0018] The single-string information decoding module parses the data bitstream of the string prediction pattern and obtains at least the information indicating whether the current block contains only one string, which is called single-string information.
[0019] Other string information decoding modules: When the current block has only one string, the data bitstream representing the string scanning method and at least one string length is not parsed; otherwise, the data bitstream representing the string scanning method and at least one string length is parsed to obtain the string scanning method and at least one string length of the current block.
[0020] A string prediction decoding system for single-string information includes either the string prediction decoding method or the string prediction decoding device for single-string information. The string prediction mode includes any one or any combination of the following: a string prediction mode with the same direction scanning, or a string prediction mode with the reverse scanning direction, or a string prediction mode with the horizontal scanning direction, or a string prediction mode with the vertical scanning direction, or a string prediction mode with at most N strings, where N is an integer greater than or equal to 2, or a string prediction mode with strings of equal length, or a string prediction mode with strings of unequal length.
[0021] Preferably, the single string information includes any one or any combination of the following: an identifier indicating whether the current block contains only one string, a binary variable indicating whether the current block contains only one string, and an indirect variable indicating whether the current block contains only one string; the string length information includes any one or any combination of the following: the string length value itself, the next remaining total length value, the string length value identifier, other indirect information to obtain the string length value information, and a null value.
[0022] Preferably, the string scanning method uses a scanning method identifier to indicate whether it is a horizontal scanning method or a vertical scanning method, and the string prediction mode allows at most two strings of equal length, in which case the string length information is a null value.
[0023] Preferably, the single string information is denoted as cs1_one_str_flag. A value of 1 for cs1_one_str_flag indicates that the current block contains only one string, and a value of 0 indicates that the current block contains more than one string. The string scanning mode uses usp_scan_mode_flag to indicate whether it is a horizontal or vertical scanning mode. The string prediction mode allows at most two strings of equal length, in which case the string length information is null. The syntax description table of the current block includes:
[0024] cs1_one_str_flag ae(v) if (cs1_one_str_flag == 0) usp_scan_mode_flag ae(v)
[0025] Preferably, the single string information is denoted as cs1_one_str_flag. A value of 1 for cs1_one_str_flag indicates that the current block contains only one string, and a value of 0 indicates that the current block contains more than one string. The string scanning mode uses the syntax element usp_scan_mode_flag to indicate whether it is a horizontal or vertical scanning mode. The string length information is the string length value itself (length). The syntax description table of the current block includes:
[0026]
[0027] Preferably, the single string information is denoted as cs1_one_str_flag. A value of 1 for cs1_one_str_flag indicates that the current block contains only one string, and a value of 0 indicates that the current block contains more than one string. The string scanning mode uses the syntax element usp_scan_mode_flag to indicate whether it is a horizontal or vertical scanning mode. The string length information is represented by the string length value identifier length_flag. The syntax description table of the current block includes:
[0028]
[0029] Compared with the prior art, the present invention has the following advantages and effects:
[0030] When the CU is a single string, i.e., a single string, there is no need to encode or decode the string scanning method. Regardless of the value of the string scanning method, the subsequent encoding and decoding steps are the same. On the other hand, the probability of a single string is relatively high. By introducing single string information to replace the string length information, the encoding efficiency can be further improved. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is a schematic diagram of the encoding method of the present invention.
[0033] Figure 2 This is a schematic diagram of the decoding method of the present invention. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0035] Example 1: The string prediction mode in this example includes any one or any combination of the following: same-direction scanning string prediction mode, reverse scanning string prediction mode, horizontal scanning string prediction mode, vertical scanning string prediction mode, string prediction mode with at most N strings (N is an integer greater than or equal to 2), string prediction mode with equal string lengths, or string prediction mode with unequal string lengths. Single string information includes any one or any combination of the following: an identifier indicating whether the current block contains only one string (e.g., a flag), a binary variable indicating whether the current block contains only one string (e.g., a binary variable of 0 and 1), and an indirect variable indicating whether the current block contains only one string (e.g., the number of strings in the current block; a string count of 1 indicates that the current block contains only one string, otherwise it does not). The string length information includes any one or any combination of the following: the string length value itself, the next remaining total length value (the number of remaining pixels in the current block minus the string length value), the string length value identifier (e.g., for a string prediction mode with a maximum of 4 strings, 1 string indicates that the string length is the number of pixels in the current CU, 2 strings indicate that the string length is 1 / 2 of the number of pixels in the current CU, 3 strings indicate that the string length is 1 / 4 or 1 / 2 of the number of pixels in the current CU, and 4 strings indicate that the string length is 1 / 4 of the number of pixels in the current CU), other indirect information to obtain the string length value information, and null values.
[0036] A string prediction encoding device for single-string information includes a single-string information encoding module and other string information encoding modules. The single-string information encoding module is used to: encode information indicating whether the current block contains only one string, define it as single-string information, and generate a data bitstream containing the single-string information. The other string information encoding modules are used to: when the current block contains only one string, not encode information indicating the string scanning method, nor encode information indicating the string length; otherwise, encode information indicating the string scanning method and at least one piece of information indicating the string length, generating a data bitstream containing information indicating the string scanning method and the string length.
[0037] A string prediction coding method for single-string information includes:
[0038] Step 1: Obtain the dataset and encode it using string prediction mode. When encoding the encoded blocks in the dataset, the information indicating whether the current block has only one string is defined as single string information, thereby generating a data bitstream containing single string information.
[0039] Step 2: If the single string information indicates that the current block contains only one string, then the information indicating the string scanning method and the information indicating the string length are not encoded; otherwise, the information indicating the string scanning method and at least one piece of information indicating the string length are encoded to generate a data bitstream containing the information indicating the string scanning method and the string length.
[0040] A string prediction decoding system for single-string information includes either the string prediction decoding method or the string prediction decoding device for single-string information.
[0041] A string prediction decoding device for single-string information, comprising:
[0042] The single-string information decoding module parses the data bitstream of the string prediction pattern and obtains at least the information indicating whether the current block contains only one string, which is called single-string information.
[0043] Other string information decoding modules: When the current block has only one string, the data bitstream representing the string scanning method and at least one string length is not parsed; otherwise, the data bitstream representing the string scanning method and at least one string length is parsed to obtain the string scanning method and at least one string length of the current block.
[0044] A method for string prediction decoding of single-string information includes:
[0045] Parse the data stream of the string prediction mode to obtain at least the information indicating whether the current block contains only one string, called single string information. If the single string information indicates that the current block contains only one string, then the data stream containing the information indicating the string scanning method and the string length is not parsed; otherwise, the data stream containing the information indicating the string scanning method and the string length is parsed to obtain the string scanning method and at least one string length of the current block.
[0046] In one or more specific embodiments, the string scanning method uses a scanning method identifier to indicate whether it is a horizontal scanning method or a vertical scanning method, and the string prediction mode allows at most two strings of equal length. Therefore, by parsing the compressed data stream of the string prediction mode, single-string information is obtained. If the single-string information indicates that the current block does not have only one string, it can be deduced that the current block has two strings and the length of both strings is equal to half the number of pixels in the current block. That is, the information indicating the string length is null, so only the scanning method identifier needs to be parsed, and no further information indicating the string length needs to be parsed. If the single-string information indicates that the current block has only one string, then the data stream indicating the string scanning method and the string length is not parsed.
[0047] In one or more specific implementations, the string scanning mode uses `usp_scan_mode_flag` to indicate whether it is a horizontal or vertical scanning mode. The string prediction mode allows at most two strings of equal length. Therefore, parsing the compressed data bitstream in the string prediction mode yields single-string information, denoted as `cs1_one_str_flag`. The syntax description table of the current block includes:
[0048] cs1_one_str_flag ae(v) if (cs1_one_str_flag == 0) usp_scan_mode_flag ae(v)
[0049] Here, ae(v) represents the syntax element of high-entropy coding. A value of 1 for cs1_one_str_flag indicates that the current block contains only one string, while a value of 0 indicates that the current block contains more than one string. If the single-string information indicates that the current block contains more than one string, it can be deduced that the current block contains two strings, and the length of both strings is equal to half the number of pixels in the current block. In this case, the string length information is null, so only usp_scan_mode_flag is parsed, and no further information indicating the string length is parsed. If the single-string information indicates that the current block contains only one string, then the data stream containing information indicating the string scanning mode and the string length is not parsed.
[0050] In one or more specific embodiments, the string scanning mode uses the syntax element usp_scan_mode_flag to indicate whether it is a horizontal scanning mode or a vertical scanning mode, the string length information is the string length value itself (length), the single string information is denoted as cs1_one_str_flag, and the syntax description table of the current block includes:
[0051]
[0052] Here, ae(v) represents the syntax element of high-entropy coding. A value of 1 for cs1_one_str_flag indicates that the current block contains only one string, while a value of 0 indicates that the current block contains more than one string. If the single-string information is represented as a single string (i.e., a value of 1 for cs1_one_str_flag), then usp_scan_mode_flag and length do not exist in the bitstream. Otherwise, if the single-string information is represented as a non-single string (i.e., a value of 0 for cs1_one_str_flag), then usp_scan_mode_flag is parsed first, followed by length parsing each length individually, until the sum of all lengths equals the total number of pixels in the current block.
[0053] In one or more specific embodiments, the string scanning mode uses the syntax element usp_scan_mode_flag to indicate whether it is a horizontal scanning mode or a vertical scanning mode, the string length information is the string length value identifier length_flag, the single string information is denoted as cs1_one_str_flag, and the syntax description table of the current block includes:
[0054]
[0055] Here, ae(v) represents the syntax element of high-entropy coding. A value of 1 for cs1_one_str_flag indicates that the current block contains only one string, while a value of 0 indicates that the current block contains more than one string. If the single-string information is represented as a single string (i.e., a value of 1 for cs1_one_str_flag), then usp_scan_mode_flag and length_flag do not exist in the bitstream. Otherwise, if the single-string information is represented as a non-single string (i.e., a value of 0 for cs1_one_str_flag), then usp_scan_mode_flag is parsed first, followed by length_flag parsing one by one, until the sum of the lengths corresponding to all length_flags equals the total number of pixels in the current block.
[0056] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A string prediction coding method for single-string information, characterized in that, include: Step 1: Obtain the dataset and encode it using string prediction mode. When encoding the encoding blocks in the dataset, the information indicating whether the current block has only one string is defined as single string information, thereby generating a data bitstream containing single string information. Step 2: If the single string information indicates that the current block contains only one string, then the information indicating the string scanning method and the information indicating the string length are not encoded; otherwise, the information indicating the string scanning method and at least one piece of information indicating the string length are encoded to generate a data bitstream containing the information indicating the string scanning method and the string length.
2. A string prediction coding device for single-string information, characterized in that, include, Single-string information encoding module: Encodes information indicating whether the current block contains only one string, which is defined as single-string information, and generates a data bitstream containing single-string information; Other string information encoding modules: When the current block contains only one string, information indicating the string scanning method and string length are not encoded; otherwise, information indicating the string scanning method and at least one information indicating the string length are encoded to generate a data bitstream containing information indicating the string scanning method and string length.
3. A method for predicting and decoding single-string information, characterized in that, include: Parse the data stream of the string prediction mode to obtain at least the information indicating whether the current block contains only one string, called single string information. If the single string information indicates that the current block contains only one string, then the data stream containing the information indicating the string scanning method and the string length is not parsed; otherwise, the data stream containing the information indicating the string scanning method and the string length is parsed to obtain the string scanning method and at least one string length of the current block.
4. The string prediction and decoding method for single-string information according to claim 3, characterized in that, The string prediction mode includes any one or any combination of the following: same-direction scanning string prediction mode, or reverse scanning string prediction mode, or horizontal scanning string prediction mode, or vertical scanning string prediction mode, or string prediction mode with at most N strings, where N is an integer greater than or equal to 2, or string prediction mode with equal string lengths, or string prediction mode with unequal string lengths.
5. The string prediction and decoding method for single-string information according to claim 4, characterized in that, The single string information includes any one or any combination of the following: an identifier indicating whether the current block contains only one string, a binary variable indicating whether the current block contains only one string, and an indirect variable indicating whether the current block contains only one string; the string length information includes any one or any combination of the following: the string length value itself, the next remaining total length value, the string length value identifier, other indirect information to obtain the string length value information, and a null value.
6. The string prediction and decoding method for single-string information according to claim 5, characterized in that, The string scanning method uses a scanning method identifier to indicate whether it is a horizontal scanning method or a vertical scanning method. The string prediction mode allows at most two strings of equal length, and the string length information is null in this case.
7. The string prediction and decoding method for single-string information according to claim 5, characterized in that, The single string information is denoted as cs1_one_str_flag. A value of 1 for cs1_one_str_flag indicates that the current block contains only one string, while a value of 0 indicates that the current block contains more than one string. The string scanning mode uses usp_scan_mode_flag to indicate whether it is a horizontal or vertical scanning mode. The string prediction mode allows at most two strings of equal length, in which case the string length information is null. The syntax description of the current block includes: If the single-string information indicates that the current block does not have only one string, then the string length information is null, and only usp_scan_mode_flag is parsed, without parsing the string length information; if the single-string information indicates that the current block has only one string, then the data stream containing the string scanning mode and string length information is not parsed.
8. The string prediction and decoding method for single-string information according to claim 5, characterized in that, The single string information is denoted as cs1_one_str_flag. A value of 1 for cs1_one_str_flag indicates that the current block contains only one string, while a value of 0 indicates that the current block contains more than one string. The string scanning mode is indicated by the syntax element usp_scan_mode_flag, which specifies whether the scanning mode is horizontal or vertical. The string length information is the string length value itself (length). The syntax description of the current block includes: If the value of cs1_one_str_flag is 1, then usp_scan_mode_flag and length do not exist in the bitstream; otherwise, if the value of cs1_one_str_flag is 0, then usp_scan_mode_flag is parsed first, and then length is parsed one by one until the sum of all lengths equals the total number of pixels in the current block.
9. The string prediction and decoding method for single-string information according to claim 5, characterized in that, The single string information is denoted as cs1_one_str_flag. A value of 1 for cs1_one_str_flag indicates that the current block contains only one string, while a value of 0 indicates that the current block contains more than one string. The string scanning mode is indicated by the syntax element usp_scan_mode_flag, which represents whether the scanning mode is horizontal or vertical. The string length information is represented by the string length value identifier length_flag. The syntax description of the current block includes: If the value of cs1_one_str_flag is 1, then usp_scan_mode_flag and length_flag do not exist in the bitstream; otherwise, if the value of cs1_one_str_flag is 0, then usp_scan_mode_flag is parsed first, and then length_flag is parsed one by one until the sum of the lengths corresponding to all length_flags equals the total number of pixels in the current block.
10. A string prediction and decoding device for single-string information, characterized in that, include The single-string information decoding module parses the data bitstream of the string prediction pattern and obtains at least the information indicating whether the current block contains only one string, which is called single-string information. Other string information decoding modules: When the current block has only one string, the data bitstream representing the string scanning method and at least one string length is not parsed; otherwise, the data bitstream representing the string scanning method and at least one string length is parsed to obtain the string scanning method and at least one string length of the current block.
11. A string prediction decoding system for single-string information, comprising the string prediction decoding apparatus for single-string information as described in claim 10, characterized in that, The string prediction mode includes any one or any combination of the following: same-direction scanning string prediction mode, or reverse scanning string prediction mode, or horizontal scanning string prediction mode, or vertical scanning string prediction mode, or string prediction mode with at most N strings, where N is an integer greater than or equal to 2, or string prediction mode with equal string lengths, or string prediction mode with unequal string lengths.
12. The string prediction decoding system for single-string information according to claim 11, characterized in that, Single string information includes any one or any combination of the following: an identifier indicating whether the current block contains only one string, a binary variable indicating whether the current block contains only one string, and an indirect variable indicating whether the current block contains only one string. The string length information includes any one or any combination of the following: the string length value itself, the next remaining total length value, the string length value identifier, other indirect information to obtain the string length value information, and a null value.
13. The string prediction and decoding system for single-string information according to claim 12, characterized in that, The string scanning method uses a scanning method identifier to indicate whether it is a horizontal scanning method or a vertical scanning method. The string prediction mode allows at most two strings of equal length, and the string length information is null in this case.
14. The string prediction and decoding system for single-string information according to claim 12, characterized in that, The single string information is denoted as cs1_one_str_flag. A value of 1 for cs1_one_str_flag indicates that the current block contains only one string, while a value of 0 indicates that the current block contains more than one string. The string scanning mode uses usp_scan_mode_flag to indicate whether it is a horizontal or vertical scanning mode. The string prediction mode allows at most two strings of equal length, in which case the string length information is null. The syntax description of the current block includes: If the single-string information indicates that the current block does not have only one string, then the string length information is null, and only usp_scan_mode_flag is parsed, without parsing the string length information; if the single-string information indicates that the current block has only one string, then the data stream containing the string scanning mode and string length information is not parsed.
15. The string prediction decoding system for single-string information according to claim 12, characterized in that, The single string information is denoted as cs1_one_str_flag. A value of 1 for cs1_one_str_flag indicates that the current block contains only one string, while a value of 0 indicates that the current block contains more than one string. The string scanning mode is indicated by the syntax element usp_scan_mode_flag, which specifies whether the scanning mode is horizontal or vertical. The string length information is the string length value itself (length). The syntax description of the current block includes: If the value of cs1_one_str_flag is 1, then usp_scan_mode_flag and length do not exist in the bitstream; otherwise, if the value of cs1_one_str_flag is 0, then usp_scan_mode_flag is parsed first, and then length is parsed one by one until the sum of all lengths equals the total number of pixels in the current block.
16. The string prediction decoding system for single-string information according to claim 12, characterized in that, The single string information is denoted as cs1_one_str_flag. A value of 1 for cs1_one_str_flag indicates that the current block contains only one string, while a value of 0 indicates that the current block contains more than one string. The string scanning mode is indicated by the syntax element usp_scan_mode_flag, which represents whether the scanning mode is horizontal or vertical. The string length information is represented by the string length value identifier length_flag. The syntax description of the current block includes: If the value of cs1_one_str_flag is 1, then usp_scan_mode_flag and length_flag do not exist in the bitstream; otherwise, if the value of cs1_one_str_flag is 0, then usp_scan_mode_flag is parsed first, and then length_flag is parsed one by one until the sum of the lengths corresponding to all length_flags equals the total number of pixels in the current block.
Citation Information
Patent Citations
Image compression method and device based on arbitrary shape matching
CN104244007A