WO2024149238A1 - 一种数据编解码方法及相关装置 - Google Patents
一种数据编解码方法及相关装置 Download PDFInfo
- Publication number
- WO2024149238A1 WO2024149238A1 PCT/CN2024/071323 CN2024071323W WO2024149238A1 WO 2024149238 A1 WO2024149238 A1 WO 2024149238A1 CN 2024071323 W CN2024071323 W CN 2024071323W WO 2024149238 A1 WO2024149238 A1 WO 2024149238A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- information
- value
- probability
- bit
- symbol
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/189—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding
- H04N19/196—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding being specially adapted for the computation of encoding parameters, e.g. by averaging previously computed encoding parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/90—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
- H04N19/91—Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- H03M7/3068—Precoding preceding compression, e.g. Burrows-Wheeler transformation
- H03M7/3079—Context modeling
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- H03M7/40—Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code
- H03M7/4006—Conversion to or from arithmetic code
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/124—Quantisation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/182—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/42—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
- H04N19/423—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation characterised by memory arrangements
- H04N19/426—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation characterised by memory arrangements using memory downsizing methods
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/44—Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
Definitions
- the present application relates to the field of data encoding and decoding, and in particular to a data encoding and decoding method and related devices.
- Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
- artificial intelligence is a branch of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence.
- Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making.
- Media compression typically includes one or more stages of prediction, frequency transform, and quantization, followed by entropy encoding.
- the corresponding media decompression typically includes entropy decoding, followed by one or more stages of inverse quantization, inverse frequency transform, and prediction.
- entropy encoding converts input symbols into encoded data with a lower bit rate by exploiting redundancy in the input symbols (e.g., exploiting a pattern of many input symbols with common values and multiple input symbols with rare values).
- Entropy decoding converts the encoded data into output symbols corresponding to the input symbols.
- Huffman encoding/decoding is computationally simple, but has poor compression efficiency for certain distributions of values of the input symbols.
- arithmetic encoding/decoding typically has much better compression efficiency at the expense of much higher computational complexity.
- Asymmetric number system (ANS) encoding/decoding potentially provides high compression efficiency and low computational complexity.
- existing ANS-based encoding involves division, remainder operation, and judgment, and decoding involves binary search operations, all of which are time-consuming.
- the present application provides a data encoding method and a data decoding method, which can achieve a balance between memory and latency.
- the present application provides a data encoding method, the method comprising: obtaining a target symbol; obtaining first information and second information corresponding to the target symbol through a first mapping relationship; the first information and the second information are obtained according to probability information corresponding to the target symbol; obtaining first encoded data through a first operation according to the first information and the state information of the encoder; and obtaining second encoded data by updating the state information through a second operation according to the second information; wherein the first encoded data and the second encoded data are used to obtain the encoding result of the target symbol, and the first operation and the second operation do not include a division operation.
- the index information in the coding table only includes symbols
- the mapped objects only include the first information and the second information, which is equivalent to reducing the memory usage in the coding table and avoiding operations with high consumption, thereby achieving a balance between memory and latency.
- the first information or the second information represents an integer value.
- the first operation and the second operation do not include a judgment operation.
- the first operation includes: performing an addition operation on the first information and the status information, and performing a bit shift operation on the addition result of the addition operation; selecting a portion of bits from the status information as first encoded data, and the positions of the portion of bits in the status information are determined according to the shift result of the bit shift operation.
- the second operation includes: an addition operation on the state information and a numerical value M, and a bit shift operation on the addition result of the addition operation; wherein the probability information includes a quantization probability, and M is the denominator of the quantization probability; and an addition operation is performed on the shift result of the bit shift operation and the second information.
- the probability information includes a value of a probability mass function PMF; the value of the PMF is constructed by sequentially determining a value of the PMF of each symbol in a plurality of symbols, the plurality of symbols including the target symbol; wherein,
- the total value of the remaining PMF excluding the PMF of the determined symbol is multiplied by the probability of the target symbol, and the ratio between the product of the multiplication and the remaining probability excluding the determined symbol is calculated. Based on the relationship between the ratio and a preset fifth value, the PMF of the target symbol is determined.
- the fifth value is 1, and the relationship is to take a larger value.
- the probability information includes the value of the cumulative distribution function CDF; the value of the CDF is constructed in the following manner: based on a preset order, the value of the CDF of each symbol is determined in turn, wherein the preset order is determined according to the relationship between the values of PMFs corresponding to multiple symbols, and the multiple symbols include the target symbol; wherein, when the probability distribution corresponding to the probability information of the target symbol is a symmetrical distribution, the preset order is an order that is staggered along both sides of the peak point in the symmetrical distribution; or, when the probability distribution corresponding to the probability information of the target symbol is a discrete distribution, the preset order is specifically an order from large to small; or, when the probability distribution corresponding to the probability information of the target symbol is a discrete distribution, the preset order is specifically an order from small to large.
- the target symbol is obtained by transforming the pixel data of the image, the data obtained by transforming the pixel data of the image satisfies a preset distribution, the transformation is also used to obtain the distribution characteristics of the pixel data, the distribution characteristics include a mean or a variance, and the method further includes: according to the distribution characteristics, determining the first mapping relationship corresponding to the distribution characteristics from multiple mapping relationships.
- the multiple distribution features include a first distribution feature and a second distribution feature, the entropy of the first distribution feature is greater than the entropy of the second distribution feature; the value of the denominator of the quantization probability in the mapping relationship corresponding to the second distribution feature is greater than the denominator of the quantization probability in the mapping relationship corresponding to the first distribution feature.
- different quantization probability denominators can be used to reduce the coding length.
- a prediction model and entropy coding can be included.
- the prediction model can input the original data, output the distribution index and the data to be encoded (such as the target symbol in this application). According to the distribution index, the entropy can be calculated. For a distribution with a smaller entropy, a larger quantization probability denominator can be used.
- the first information in the first mapping relationship is constructed in the following manner: adding the number of consecutive highest bits of 0 in the numerical value of the PMF of the target symbol and a preset sixth numerical value; performing a bit shift operation on the sum result of the addition operation, and subtracting the shift result of the bit shift operation from the shift result of the bit shift operation on the numerical value of the PMF of the target symbol to obtain the first information; or, performing a bit shift operation on the sum result of the addition operation, and subtracting the shift result of the bit shift operation from the shift result of the bit shift operation on the numerical value of the PMF of the target symbol, and adding the result of the subtraction operation to the numerical value M to obtain the first information, wherein the probability information includes a quantization probability, and M is the denominator of the quantization probability.
- the calculation method of PMF and CDF in the embodiment of the present application can ensure that the codeword length is reduced while the memory and delay remain unchanged.
- the second information in the first mapping relationship is constructed in the following manner: subtracting the numerical value of the CDF of the target symbol from the numerical value of the PMF of the target symbol to obtain the second information; or subtracting the numerical value of the CDF of the target symbol from the numerical value of the PMF of the target symbol, and adding the result of the subtraction operation to the numerical value M to obtain the second information, wherein the probability information includes a quantization probability, and M is the denominator of the quantization probability.
- the second information in the first mapping relationship is constructed in the following manner: when the result of the subtraction operation between the numerical value of the CDF of the target symbol and the numerical value of the PMF of the target symbol is greater than or equal to 0, the result of the subtraction operation is used as the second information; or, when the result of the subtraction operation between the numerical value of the CDF of the target symbol and the numerical value of the PMF of the target symbol is less than 0, the result of the subtraction operation is added to the numerical value M to obtain the second information, and the probability information includes a quantization probability, and M is the denominator of the quantization probability.
- the first information and the second information may be combined and stored. After acquiring the combined data, the encoder may restore the first information and the second information based on certain operation rules.
- an integer value corresponding to the target symbol can be obtained through the first mapping relationship; based on the third operation, the integer value is restored to the first information and the second information, and the first information and the second information are respectively an integer value.
- multiple integer parameters (at most one of which is a signed integer) can be combined into a single parameter by placing the signed integer on the left, and then storing them bit by bit according to the number of bits of each parameter through shifting and bitwise OR operations; when reading the sign, the respective parameters are restored through shifting and bitwise AND operations.
- the probability information includes PMF information corresponding to each symbol, the PMF information includes a first value and a second value; the sum of the first value and the second value is the value of the PMF; the probability information also includes CDF information corresponding to each symbol, the CDF information includes a third value and a fourth value; the third value and the fourth value are constructed in the following manner:
- the fourth value corresponding to each symbol is determined in sequence by accumulation according to the second values and the third values of the plurality of symbols.
- the second information includes first sub-information (also referred to as state addend 1), second sub-information (also referred to as state threshold) and third sub-information (also referred to as state addend 2);
- the first sub-information in the first mapping relationship is constructed in the following manner: performing a subtraction operation on the third value of the target symbol and the value of the PMF of the target symbol to obtain the first sub-information;
- the second sub-information in the first mapping relationship is constructed by: performing an addition operation on the third value of the target symbol and the first value of the target symbol, and performing a subtraction operation on the result of the addition operation and 1 to obtain the second sub-information;
- the third sub-information in the first mapping relationship is constructed in the following manner: subtracting the fourth value of the target symbol from the third value of the target symbol, and subtracting the result of the subtraction operation from the first value of the target symbol to obtain the third sub-information.
- the second operation includes:
- the operation result of the addition operation is smaller than the second sub-information, the operation result of the addition operation is used as the second encoded data.
- the above method can be applicable to, but not limited to, unimodal symmetrical distribution (such as Gaussian distribution, logistic distribution, Laplace distribution, etc.) to reduce the coding length, but the coding calculation amount will increase.
- unimodal symmetrical distribution such as Gaussian distribution, logistic distribution, Laplace distribution, etc.
- the first information is stored using 10 bits
- the first sub-information is stored using 8 bits
- the second sub-information is stored using 7 bits
- the third sub-information is stored using 7 bits.
- the sum of the first values of multiple symbols is 128, and the third sub-information is less than 128.
- the present application also provides a data encoding method, which is applied to an encoder based on an asymmetric digital system ANS, and the method includes: obtaining a first symbol, the sum of the quantization probability corresponding to the first symbol and the quantization probability corresponding to the second symbol is 1, and the difference between the quantization probability corresponding to the first symbol and 1 is less than a threshold, and the difference between the quantization probability corresponding to the second symbol and 0 is less than a threshold; based on the relationship between the numerical size of the state information of the encoder and the numerical value M satisfying a first condition, performing a first operation between the state information and the numerical value M to obtain first encoded data, and updating the state information to 0; based on the relationship between the numerical size of the state information of the encoder and the numerical value M not satisfying the first condition, adding 1 to the state information.
- the method further includes: acquiring the second symbol; using the state information of the encoder as the first encoded data, and updating the state information to the difference between the value M and 1.
- the above embodiment can be directed to an encoding and decoding scheme when there are two symbols in total and the probability of a single symbol is close to 1.
- This embodiment does not need to construct an encoding and decoding table, so no additional memory is required to store the table.
- the present application provides a data decoding method, the method comprising: obtaining state information of the decoder and storing bit, the state information corresponds to the first bit, and the first bit is the bit to be decoded currently; according to the first mapping relationship, the first information, the second information and the third information corresponding to the state information are determined; the first information is the target symbol corresponding to the first bit, and the target symbol is the decoding result of the first bit, the second information represents the number of bits selected from the storage bits, the third information is used to perform an addition operation with the bits selected from the storage bits according to the third information, and the addition operation result is used to update the state information, the updated state information corresponds to the second bit, and the second bit is the bit to be decoded after the first bit.
- the method further includes: removing the selected bits from the storage bits to obtain updated storage bits.
- the first information, the second information or the third information represents an integer value.
- the first information in the first mapping relationship is constructed in the following manner: taking x that satisfies C(x) ⁇ s ⁇ (C(x)+P(x)) as the first information; wherein C represents the value of CDF, P represents the value of PMF, and s represents the status information.
- the first information in the first mapping relationship is constructed in the following manner:
- C1 represents the third value corresponding to CDF
- P1 represents the first value corresponding to PMF
- C2 represents the fourth value corresponding to CDF
- P2 represents the second value corresponding to PMF
- s represents the status information
- the sum of the first value and the second value is the value of PMF.
- the second information in the first mapping relationship is constructed in the following manner:
- clz(s′-C(x)+P(x))+X is used as the second information; wherein clz represents the number of bits whose highest bit is consecutively 0 in the value, X is a preset fifth value, and s′ is obtained as follows:
- the third information in the first mapping relationship is constructed in the following manner: performing a bit shift operation on the value of s′-C(x)+P(x) to obtain the third information, and the shift amount of the bit shift operation is obtained according to the second information.
- the second information in the first mapping relationship is constructed in the following manner: the value of clz(s-C(x)+P(x))+X is used as the second information; wherein, clz represents the number of consecutive bits whose highest bit in the value is 0, and X is a preset fifth value.
- the third information in the first mapping relationship is constructed in the following manner:
- a bit shift operation is performed on the value of s-C(x)+P(x), and a value M is subtracted from the operation result of the bit shift operation to obtain the third information, where M is the denominator of the quantization probability, and the shift amount of the bit shift operation is obtained based on the second information.
- the first information, the second information or the third information is obtained based on probability information;
- the probability information includes the value of a probability mass function PMF;
- the value of the PMF is constructed in the following manner: sequentially determining the value of the PMF of each symbol in a plurality of symbols, the plurality of symbols including the target symbol; wherein, when determining the value of the PMF of the target symbol, the total value of the remaining PMF excluding the PMF of the determined symbol is multiplied by the probability of the target symbol, and the ratio between the product of the multiplication result and the remaining probability excluding the determined symbol is calculated, and the PMF of the target symbol is determined based on the relationship between the ratio and a preset value.
- the preset value is 1, and the relationship is to take a larger value.
- the first information, the second information or the third information is obtained according to probability information;
- the probability information includes a value of a cumulative distribution function CDF;
- the value of the CDF is constructed in the following manner:
- the preset order is an order staggered along both sides of a peak point in the symmetrical distribution
- the preset order is specifically an order from large to small; or,
- the preset order is specifically an order from small to large.
- the method further includes:
- the coding result is obtained by encoding pixel data of an image, and the state information and the storage bit are obtained according to the coding result;
- the distribution characteristics of the pixel data including mean or variance
- the first mapping relationship corresponding to the distribution feature is determined from a plurality of mapping relationships.
- the present application also provides a data decoding method, which is applied to a decoder based on an asymmetric digital system ANS, and the method comprises:
- Acquire state information of the decoder where the state information corresponds to a first bit, and the first bit is a bit currently to be decoded;
- state information is the difference between the value M and 1, determining that the decoding result of the first bit is a second symbol, and updating the state information to the result of reading the value M bits from the storage;
- the decoding result of the first bit is determined to be the first symbol; if the status information is 0, the status information is updated to the sum of the difference between the numerical value M and 2 and the value of 1 bit read from the storage; if the status information is not 0, the status information is updated to the difference between the status information and 1; the updated status information corresponds to the second bit, and the second bit is the bit to be decoded after the first bit.
- the present application provides a data encoding device, the device comprising:
- An acquisition module used to acquire target symbols
- An encoding module configured to obtain first information and second information corresponding to the target symbol through a first mapping relationship; the first information and the second information are obtained according to probability information corresponding to the target symbol;
- the state information is updated through a second operation to obtain second coded data
- the first coded data and the second coded data are used to obtain a coding result of the target symbol, and the first operation and the second operation do not include a division operation.
- the first information or the second information represents an integer value.
- the first operation and the second operation do not include a judgment operation.
- the first operation includes:
- a portion of bits is selected from the state information as first coded data, and positions of the portion of bits in the state information are determined according to a shift result of the bit shift operation.
- the second operation includes:
- the probability information includes a quantization probability
- M is a denominator of the quantization probability
- An addition operation is performed on a shift result of the bit shift operation and the second information.
- the probability information includes a value of a probability mass function PMF; the value of the PMF is constructed in the following manner:
- the total value of the remaining PMF excluding the PMF of the determined symbol is multiplied by the probability of the target symbol, and the ratio between the product of the multiplication result and the remaining probability excluding the determined symbol is calculated.
- the PMF of the target symbol is determined according to the relationship between the ratio and a preset fifth value.
- the fifth value is 1, and the relationship is to take a larger value.
- the probability information includes a value of a cumulative distribution function CDF; the value of the CDF is constructed in the following manner:
- the preset order is an order staggered along both sides of a peak point in the symmetrical distribution
- the preset order is specifically an order from large to small; or,
- the preset order is specifically an order from small to large.
- the target symbol is obtained by transforming pixel data of an image
- the data obtained by transforming the pixel data of the image satisfies a preset distribution
- the transformation is further used to obtain a distribution feature of the pixel data
- the distribution feature includes a mean or a variance
- the acquisition module is further used to:
- the first mapping relationship corresponding to the distribution feature is determined from a plurality of mapping relationships.
- the multiple distribution features include a first distribution feature and a second distribution feature, and the entropy of the first distribution feature is greater than the entropy of the second distribution feature;
- a value of a denominator of a quantization probability in a mapping relationship corresponding to the second distribution feature is greater than a value of a denominator of a quantization probability in a mapping relationship corresponding to the first distribution feature.
- the first information in the first mapping relationship is constructed in the following manner:
- a bit shift operation is performed on the sum result of the addition operation, and a subtraction operation is performed on the shift result of the bit shift operation and the shift result of the bit shift operation on the numerical value of the PMF of the target symbol, and the operation result of the subtraction operation is added to the numerical value M to obtain the first information, wherein the probability information includes a quantization probability, and M is the denominator of the quantization probability.
- the second information in the first mapping relationship is constructed in the following manner:
- the second information in the first mapping relationship is constructed in the following manner:
- the result of the subtraction operation between the numerical value of the CDF of the target symbol and the numerical value of the PMF of the target symbol is less than 0, the result of the subtraction operation is added to the numerical value M to obtain the second information, where the probability information includes a quantization probability, and M is the denominator of the quantization probability.
- the encoding module is specifically used to:
- the integer value is restored to the first information and the second information, where the first information and the second information are respectively an integer value.
- the probability information includes PMF information corresponding to each symbol, the PMF information includes a first value and a second value; the sum of the first value and the second value is the value of the PMF; the probability information also includes CDF information corresponding to each symbol, the CDF information includes a third value and a fourth value; the third value and the fourth value are constructed in the following manner:
- the fourth value corresponding to each symbol is determined in sequence by accumulation according to the second values and the third values of the plurality of symbols.
- the second information includes first sub-information, second sub-information and third sub-information
- the first sub-information in the first mapping relationship is constructed in the following manner: performing a subtraction operation on the third value of the target symbol and the value of the PMF of the target symbol to obtain the first sub-information;
- the second sub-information in the first mapping relationship is constructed by: performing an addition operation on the third value of the target symbol and the first value of the target symbol, and performing a subtraction operation on the result of the addition operation and 1 to obtain the second sub-information;
- the third sub-information in the first mapping relationship is constructed in the following manner: subtracting the fourth value of the target symbol from the third value of the target symbol, and subtracting the result of the subtraction operation from the first value of the target symbol to obtain the third sub-information.
- the second operation includes:
- the operation result of the addition operation is smaller than the second sub-information, the operation result of the addition operation is used as the second encoded data.
- the first information is stored using 10 bits
- the first sub-information is stored using 8 bits
- the second sub-information is stored using 7 bits
- the third sub-information is stored using 7 bits.
- the sum of the first values of multiple symbols is 128, and the third sub-information is less than 128.
- the present application also provides a data encoding device, which is applied to an encoder based on an asymmetric digital system ANS, and the device comprises:
- an acquisition module configured to acquire a first symbol, wherein the sum of a quantization probability corresponding to the first symbol and a quantization probability corresponding to the second symbol is 1, and a difference between the quantization probability corresponding to the first symbol and 1 is less than a threshold, and a difference between the quantization probability corresponding to the second symbol and 0 is less than a threshold;
- An encoding module configured to perform a first operation between the state information and the value M of the encoder to obtain first encoded data, and update the state information to 0 according to a numerical relationship between the state information and the value M of the encoder satisfying a first condition
- the acquisition module is further used to:
- the encoding module is further configured to use the state information of the encoder as the first encoding data, and update the state information to the The difference between the value M and 1.
- the present application provides a data decoding device, the device comprising:
- An acquisition module used for acquiring state information of the decoder and a storage bit, wherein the state information corresponds to a first bit, and the first bit is a bit currently to be decoded;
- a decoding module is used to determine the first information, second information and third information corresponding to the state information according to a first mapping relationship; the first information is a target symbol corresponding to the first bit, the target symbol is a decoding result of the first bit, the second information represents the number of bits selected from the storage bits, the third information is used to perform an addition operation with the bits selected from the storage bits according to the third information, the addition operation result is used to update the state information, the updated state information corresponds to the second bit, and the second bit is the bit to be decoded after the first bit.
- the decoding module is further used to:
- the selected bits are removed from the storage bits to obtain updated storage bits.
- the first information, the second information or the third information represents an integer value.
- the first information in the first mapping relationship is constructed in the following manner:
- C represents the value of CDF
- P represents the value of PMF
- s represents the state information
- C1 represents the third value corresponding to CDF
- P1 represents the first value corresponding to PMF
- C2 represents the fourth value corresponding to CDF
- P2 represents the second value corresponding to PMF
- s represents the status information
- the sum of the first value and the second value is the value of PMF.
- the second information in the first mapping relationship is constructed in the following manner:
- clz(s-C(x)+P(x))+X is used as the second information; wherein clz represents the number of consecutive bits of the highest bit in the value being 0, and X is a preset fifth value; or,
- clz(s′-C(x)+P(x))+X is used as the second information; wherein clz represents the number of bits whose highest bit is consecutively 0 in the value, X is a preset fifth value, and s′ is obtained as follows:
- the third information in the first mapping relationship is constructed in the following manner:
- a bit shift operation is performed on the value of s′-C(x)+P(x) to obtain the third information, and the shift amount of the bit shift operation is obtained according to the second information.
- the first information, the second information or the third information is obtained according to probability information;
- the rate information includes the value of the probability mass function PMF; the value of the PMF is constructed in the following manner:
- the total value of the remaining PMF excluding the PMF of the determined symbol is multiplied by the probability of the target symbol, and the ratio between the product of the multiplication and the remaining probability excluding the determined symbol is calculated. Based on the relationship between the ratio and the preset value, the PMF of the target symbol is determined.
- the preset value is 1, and the relationship is to take a larger value.
- the first information, the second information or the third information is obtained according to probability information;
- the probability information includes a value of a cumulative distribution function CDF;
- the value of the CDF is constructed in the following manner:
- the preset order is an order staggered along both sides of a peak point in the symmetrical distribution
- the preset order is specifically an order from large to small; or,
- the preset order is specifically an order from small to large.
- the acquisition module is further used to:
- the coding result is obtained by encoding pixel data of an image, and the state information and the storage bit are obtained according to the coding result;
- the distribution characteristics of the pixel data including mean or variance
- the first mapping relationship corresponding to the distribution feature is determined from a plurality of mapping relationships.
- the present application also provides a data decoding device, which is applied to a decoder based on an asymmetric digital system ANS, and the device comprises:
- An acquisition module configured to acquire state information of the decoder, wherein the state information corresponds to a first bit, and the first bit is a bit currently to be decoded;
- a decoding module configured to determine, if the state information is a difference between a value M and 1, that a decoding result of the first bit is a second symbol, and update the state information to a result of reading the value M bits from a storage;
- the decoding result of the first bit is determined to be the first symbol; if the status information is 0, the status information is updated to the sum of the difference between the numerical value M and 2 and the value of 1 bit read from the storage; if the status information is not 0, the status information is updated to the difference between the status information and 1; the updated status information corresponds to the second bit, and the second bit is the bit to be decoded after the first bit.
- an embodiment of the present application provides a data encoding device, which may include a memory, a processor, and a bus system, wherein the memory is used to store programs, and the processor is used to execute the programs in the memory to execute any optional method such as the first aspect above.
- an embodiment of the present application provides a data decoding device, which may include a memory, a processor, and a bus system, wherein the memory is used to store programs, and the processor is used to execute the programs in the memory to execute any optional method such as the second aspect above.
- an embodiment of the present application provides a computer-readable storage medium, which stores a computer program.
- the computer-readable storage medium When the computer-readable storage medium is run on a computer, it enables the computer to execute the above-mentioned first aspect and any optional method, and any optional method of the above-mentioned second aspect.
- an embodiment of the present application provides a computer program product, comprising code, which, when executed, is used to implement the above-mentioned first aspect and any optional method, and any optional method of the above-mentioned second aspect.
- the present application provides a chip system, which includes a processor for supporting an execution device or a training device to implement the functions involved in the above aspects, such as sending or processing the data involved in the above methods; or information.
- the chip system also includes a memory, which is used to store program instructions and data necessary for the execution device or the training device.
- the chip system can be composed of a chip, or it can include a chip and other discrete devices.
- FIG1A is a block diagram of an example of a video decoding system for implementing an embodiment of the present invention.
- FIG. 1B is a block diagram of another example of a video decoding system for implementing an embodiment of the present invention.
- FIG2 is a block diagram of an example structure of an encoder for implementing an embodiment of the present invention.
- FIG3 is a block diagram of an example structure of a decoder for implementing an embodiment of the present invention.
- FIG4 is a block diagram of an example of a video decoding device for implementing an embodiment of the present invention.
- FIG5 is a schematic diagram of a flow chart of a data encoding method provided in an embodiment of the present application.
- FIG6 is a schematic diagram of a flow chart of a data encoding method provided in an embodiment of the present application.
- FIG7 is a schematic diagram of a flow chart of a data encoding method provided in an embodiment of the present application.
- FIG8 is a schematic diagram of a flow chart of a data encoding method provided in an embodiment of the present application.
- FIG9 is a schematic diagram of a flow chart of a data decoding method provided in an embodiment of the present application.
- FIG10A is a schematic diagram of a flow chart of a data decoding method provided in an embodiment of the present application.
- FIG10B is a schematic diagram of a flow chart of a data decoding method provided in an embodiment of the present application.
- FIG11 is a schematic diagram of the structure of a data encoding device provided in an embodiment of the present application.
- FIG12 is a schematic diagram of the structure of a data decoding device provided in an embodiment of the present application.
- FIG13 is a schematic diagram of an execution device provided in an embodiment of the present application.
- FIG14 is a schematic diagram of a server provided in an embodiment of the present application.
- FIG. 15 is a schematic diagram of a chip provided in an embodiment of the present application.
- “at least one” refers to one or more, and “more than one” refers to two or more.
- “And/or” describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and/or B may represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B may be singular or plural. The character “/” generally indicates that the associated objects before and after are in an "or” relationship. "At least one of the following” or similar expressions refers to any combination of these items, including any combination of single or plural items.
- At least one of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c may be single or multiple.
- a media encoder/decoder system such as a video encoder/decoder system, an audio encoder/decoder system, or a texture encoder/decoder system.
- the techniques and tools described in the embodiments of the present application can generally be implemented in a data encoder/decoder system for use in encoding/decoding text data or other types of data.
- video codec may also be audio, texture or image codec.
- audio codec may also be audio, texture or image codec.
- video codec may also be audio, texture or image codec.
- Video coding generally refers to processing a sequence of pictures to form a video or video sequence.
- the terms "picture”, "frame” or “image” can be used as synonyms.
- Video coding as used in this article means video encoding or video decoding.
- Video encoding is performed on the source side and typically involves processing (e.g., by compression) the original video picture to reduce the amount of data required to represent the video picture so that it can be stored and/or transmitted more efficiently.
- Video decoding is performed on the destination side and typically involves inverse processing relative to the encoder to reconstruct the video picture.
- Embodiments involving "encoding” of video pictures should be understood as involving "encoding” or "decoding” of video sequences.
- the combination of an encoding part and a decoding part is also referred to as a codec (encoding and decoding).
- a video sequence consists of a series of pictures, which are further divided into slices, which are further divided into blocks.
- Video coding is performed in blocks.
- the concept of blocks is further expanded.
- MB macroblocks
- partitions which can be used for predictive coding.
- HEVC high efficiency video coding
- basic concepts such as coding units (CU), prediction units (PU) and transform units (TU) are used to functionally divide various block units and describe them using a new tree-based structure.
- CU can be divided into smaller CUs according to the quadtree, and the smaller CU can be further divided to form a quadtree structure.
- CU is the basic unit for dividing and encoding the coded image.
- PU can correspond to prediction blocks and is the basic unit of predictive coding.
- CU is further divided into multiple PUs according to the division mode.
- TU can correspond to a transform block, which is a basic unit for transforming a prediction residual.
- CU, PU or TU they all essentially belong to the concept of a block (or image block).
- the concept of an image block (e.g., a first image block and a second image block) involved in the embodiments of the present application can be specifically described herein.
- a CTU is split into multiple CUs by using a quadtree structure represented as a coding tree.
- the decision is made at the CU level whether to encode a picture area using inter-picture (temporal) or intra-picture (spatial) prediction.
- Each CU can be further split into one, two, or four PUs based on the PU split type.
- the same prediction process is applied within a PU, and the relevant information is transmitted to the decoder on a PU basis.
- the CU can be split into transform units (TUs) according to other quadtree structures similar to the coding tree for the CU.
- quad-tree and binary tree QTBT are used to split frames to split coding blocks.
- the CU can be square or rectangular in shape.
- the image block to be processed in the current encoded image (referred to as the image block to be processed) may be referred to as the current block.
- the image block to be processed refers to the block currently being encoded; in decoding, the image block to be processed refers to the block currently being decoded.
- the decoded image block in the reference image used to predict the current block is referred to as a reference block, that is, the reference block is a block that provides a reference signal for the current block, wherein the reference signal represents the pixel value in the image block.
- the block in the reference image that provides a prediction signal for the current block may be referred to as a prediction block, wherein the prediction signal represents the pixel value or sampling value or sampling signal in the prediction block.
- the best reference block is found. This best reference block will provide a prediction for the current block, and this block may be referred to as a prediction block.
- the original video picture can be reconstructed, that is, the reconstructed video picture has the same quality as the original video picture (assuming no transmission loss or other data loss during storage or transmission).
- further compression is performed by, for example, quantization to reduce the amount of data required to represent the video picture, but the decoder side cannot fully reconstruct the video picture, that is, the quality of the reconstructed video picture is lower or worse than the quality of the original video picture.
- Video coding standards of H.261 belong to the category of "lossy hybrid video codecs" (i.e., combining spatial and temporal prediction in the sample domain with 2D transform coding in the transform domain for applying quantization).
- Each picture of a video sequence is usually divided into a set of non-overlapping blocks, which are usually encoded at the block level.
- the encoder side usually processes, i.e., encodes the video at the block (video block) level, for example, by generating a prediction block through spatial (intra-picture) prediction and temporal (inter-picture) prediction, subtracting the prediction block from the current block (currently processed or to be processed block) to obtain a residual block, transforming the residual block in the transform domain and quantizing the residual block to reduce the amount of data to be transmitted (compressed), while the decoder side applies the inverse processing part relative to the encoder to the coded or compressed block to reconstruct the current block for representation.
- the encoder replicates the decoder processing cycle, so that the encoder and decoder generate the same prediction (e.g., intra-frame prediction and inter-frame prediction) and/or reconstruction for processing, i.e., encoding subsequent blocks.
- FIG. 1A exemplarily shows a schematic block diagram of a video encoding and decoding system 10 used in the embodiments of the present invention.
- the video encoding and decoding system 10 may include a source device 12 and a destination device 14.
- the source device 12 generates encoded video data, and therefore, the source device 12 may be referred to as a video encoding device.
- the destination device 14 may decode the encoded video data generated by the source device 12, and therefore, the destination device 14 may be referred to as a video decoding device.
- the source device 12, the destination device 14, or both may include one or more processors and a memory coupled to the one or more processors.
- the memory may include, but is not limited to, RAM, ROM, EEPROM, flash memory, or any other media that can be used to store desired program code in the form of instructions or data structures that can be accessed by a computer, as described herein.
- the source device 12 and the destination device 14 may include a variety of devices, including a desktop computer, a mobile computing device, a notebook (e.g., laptop) computer, a tablet computer, a set-top box, a telephone handset such as a so-called "smart" phone, a television, a camera, a display device, a digital media player, a video game console, a vehicle computer, a wireless communication device, or the like.
- FIG. 1A illustrates the source device 12 and the destination device 14 as separate devices
- device embodiments may also include both the source device 12 and the destination device 14 or the functionality of both, i.e., the source device 12 or the corresponding functionality and the destination device 14 or the corresponding functionality.
- the source device 12 or the corresponding functionality and the destination device 14 or the corresponding functionality may be implemented using the same hardware and/or software, or using separate hardware and/or software, or any combination thereof.
- the source device 12 and the destination device 14 may be communicatively connected via a link 13, and the destination device 14 may receive the encoded video data from the source device 12 via the link 13.
- the link 13 may include one or more media or devices capable of moving the encoded video data from the source device 12 to the destination device 14.
- the link 13 may include one or more communication media that enable the source device 12 to transmit the encoded video data directly to the destination device 14 in real time.
- the source device 12 may modulate the encoded video data according to a communication standard (e.g., a wireless communication protocol), and may transmit the modulated video data to the destination device 14.
- the one or more communication media may include wireless and/or wired communication media, such as a radio frequency (RF) spectrum or one or more physical transmission lines.
- RF radio frequency
- the one or more communication media may form part of a packet-based network, such as a local area network, a wide area network, or a global network (e.g., the Internet).
- the one or more communication media may include routers, switches, base stations, or other devices that facilitate communication from the source device 12 to the destination device 14.
- the source device 12 includes an encoder 20.
- the source device 12 may also include a picture source 16, a picture preprocessor 18, and a communication interface 22.
- the encoder 20, the picture source 16, the picture preprocessor 18, and the communication interface 22 may be hardware components in the source device 12, or may be software programs in the source device 12. They are described as follows:
- the image source 16 may include or may be any type of image capture device, for example, for capturing real-world images, and/or any type of images or comments (for screen content encoding, some text on the screen is also considered to be part of the image or image to be encoded) generation device, such as a computer graphics processor for generating computer animation images, or any type of device for acquiring and/or providing real-world images, computer animation images (e.g., screen content, virtual reality (VR) images), and/or any combination thereof (e.g., augmented reality (AR) images).
- image capture device for example, for capturing real-world images, and/or any type of images or comments (for screen content encoding, some text on the screen is also considered to be part of the image or image to be encoded) generation device, such as a computer graphics processor for generating computer animation images, or any type of device for acquiring and/or providing real-world images, computer animation images (e.g., screen content, virtual reality (VR) images), and/or any combination thereof (e.
- the image source 16 may be a camera for capturing images or a memory for storing images, and the image source 16 may also include any type of (internal or external) interface for storing previously captured or generated images and/or acquiring or receiving images.
- the image source 16 may be, for example, a local or integrated camera integrated in the source device; when the image source 16 is a memory, the image source 16 may be, for example, a local or integrated memory integrated in the source device.
- the interface may be, for example, an external interface for receiving pictures from an external video source, such as an external picture capture device, such as a camera, an external memory, or an external picture generating device, such as an external computer graphics processor, a computer, or a server.
- the interface may be any type of interface according to any proprietary or standardized interface protocol, such as a wired or wireless interface, an optical interface.
- a picture can be regarded as a two-dimensional array or matrix of pixels (picture element).
- the pixels in the array can also be called sampling points.
- the number of sampling points in the array or picture in the horizontal and vertical directions (or axes) defines the size and/or resolution of the picture.
- three color components are usually used, that is, the picture can be represented as or include three sampling arrays.
- the picture includes corresponding red, green and blue sampling arrays.
- each pixel is usually represented in a brightness/chrominance format or color space, such as for a picture in the YUV format, including a brightness component indicated by Y (sometimes also indicated by L) and two chrominance components indicated by U and V.
- the brightness (luma) component Y represents the brightness or grayscale level intensity (for example, the two are the same in a grayscale picture), while the two chrominance (chroma) components U and V represent the chrominance or color information components.
- a picture in the YUV format includes a brightness sampling array of brightness sampling values (Y) and two chrominance sampling arrays of chrominance values (U and V).
- RGB format can be converted or transformed into YUV format, and vice versa, which is also called color conversion or transformation. If the image is black and white, the image may only include a brightness sampling array.
- the image transmitted from the image source 16 to the image processor may also be referred to as raw image data 17.
- the image preprocessor 18 is used to receive the original image data 17 and perform preprocessing on the original image data 17 to obtain a preprocessed image 19 or preprocessed image data 19.
- the preprocessing performed by the image preprocessor 18 may include refurbishment, color format conversion (e.g., from RGB format to YUV format), color adjustment, or denoising.
- the encoder 20 (or encoder 20) is used to receive the pre-processed picture data 19, and process the pre-processed picture data 19 using the relevant prediction mode, so as to provide the encoded picture data 21 (the structural details of the encoder 20 will be further described below based on FIG. 2 or FIG. 4 or FIG. 5).
- the encoder 20 can be used to execute the various embodiments described below to implement the present invention. The video encoding method described above.
- the communication interface 22 can be used to receive the encoded picture data 21 and transmit the encoded picture data 21 to the destination device 14 or any other device (such as a memory) through the link 13 for storage or direct reconstruction.
- the other device can be any device for decoding or storage.
- the communication interface 22 can, for example, be used to encapsulate the encoded picture data 21 into a suitable format, such as a data packet, for transmission on the link 13.
- the destination device 14 includes a decoder 30.
- the destination device 14 may also include a communication interface 28, a picture post-processor 32, and a display device 34. They are described as follows:
- the communication interface 28 can be used to receive the encoded picture data 21 from the source device 12 or any other source, such as a storage device, such as an encoded picture data storage device.
- the communication interface 28 can be used to transmit or receive the encoded picture data 21 via the link 13 between the source device 12 and the destination device 14 or via any type of network, such as a direct wired or wireless connection, any type of network, such as a wired or wireless network or any combination thereof, or any type of private network and public network, or any combination thereof.
- the communication interface 28 can be used, for example, to decapsulate the data packet transmitted by the communication interface 22 to obtain the encoded picture data 21.
- Both communication interface 28 and communication interface 22 may be configured as unidirectional communication interfaces or bidirectional communication interfaces and may be used, for example, to send and receive messages to establish connections, confirm and exchange any other information related to communication links and/or data transmissions such as encoded picture data transmissions.
- the decoder 30 (or decoder 30) is used to receive the encoded picture data 21 and provide decoded picture data 31 or decoded picture 31 (the structural details of the decoder 30 will be further described below based on FIG. 3 or FIG. 4 or FIG. 5). In some embodiments, the decoder 30 can be used to execute the various embodiments described below to implement the video decoding method described in the present invention.
- the picture post-processor 32 is used to perform post-processing on the decoded picture data 31 (also called reconstructed picture data) to obtain post-processed picture data 33.
- the post-processing performed by the picture post-processor 32 may include: color format conversion (for example, from YUV format to RGB format), color adjustment, repair or resampling, or any other processing, and can also be used to transmit the post-processed picture data 33 to the display device 34.
- the display device 34 can be or include any type of display for presenting the reconstructed picture, such as an integrated or external display or monitor.
- the display can include a liquid crystal display (LCD), an organic light emitting diode (OLED) display, a plasma display, a projector, a micro-LED display, liquid crystal on silicon (LCoS), a digital light processor (DLP), or any other type of display.
- FIG. 1A illustrates the source device 12 and the destination device 14 as separate devices
- device embodiments may also include both the source device 12 and the destination device 14 or both functionalities, i.e., the source device 12 or corresponding functionalities and the destination device 14 or corresponding functionalities.
- the source device 12 or corresponding functionalities and the destination device 14 or corresponding functionalities may be implemented using the same hardware and/or software, or using separate hardware and/or software, or any combination thereof.
- the source device 12 and the destination device 14 may include any of a variety of devices, including any type of handheld or stationary device, such as a notebook or laptop computer, a mobile phone, a smart phone, a tablet or tablet computer, a camera, a desktop computer, a set-top box, a television, a camera, a car device, a display device, a digital media player, a video game console, a video streaming device (such as a content service server or a content distribution server), a broadcast receiver device, a broadcast transmitter device, etc., and may not use or use any type of operating system.
- a handheld or stationary device such as a notebook or laptop computer, a mobile phone, a smart phone, a tablet or tablet computer, a camera, a desktop computer, a set-top box, a television, a camera, a car device, a display device, a digital media player, a video game console, a video streaming device (such as a content service server or a content distribution server), a broadcast receiver device,
- Both the encoder 20 and the decoder 30 may be implemented as any of a variety of suitable circuits, such as one or more microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), discrete logic, hardware, or any combination thereof.
- DSPs digital signal processors
- ASICs application-specific integrated circuits
- FPGAs field-programmable gate arrays
- the device may store the instructions of the software in a suitable non-transitory computer-readable storage medium, and may use one or more processors to execute the instructions in hardware to perform the technology of the present disclosure. Any of the foregoing (including hardware, software, a combination of hardware and software, etc.) may be considered one or more processors.
- the video encoding and decoding system 10 shown in FIG. 1A is merely an example, and the techniques of the present invention may be applicable to video encoding settings (e.g., video encoding or video decoding) that do not necessarily include any data communication between the encoding and decoding devices.
- data may be retrieved from local storage, streamed over a network, etc.
- a video encoding device may encode data and store the data to storage, and/or a video decoding device may retrieve data from storage and decode the data.
- the video encoding and decoding devices that do not communicate with each other may be used to perform the operations of the video encoding and decoding devices. Rather, the encoding and decoding is performed by a device that only encodes data to a memory and/or retrieves data from a memory and decodes data.
- the encoder 20 can be deployed on a terminal device or a server on the cloud side
- the decoder 30 can be deployed on a terminal device or a server on the cloud side
- the encoder 20 and the decoder 30 can be deployed together on a terminal device or a server on the cloud side.
- the encoder 20 and the decoder 30 can be deployed on a terminal device.
- the encoder 20 can encode and compress the video on the terminal device, and perform secondary compression (or so-called incremental storage compression) based on the video encoding method provided in an embodiment of the present application, and store the compressed data.
- secondary compression or so-called incremental storage compression
- the encoder 20 and the decoder 30 can be deployed on multiple terminal devices.
- the encoder 20 can encode and compress the video on the terminal device, and perform secondary compression (or incremental storage compression) based on the video encoding method provided in an embodiment of the present application, and transmit the compressed data to other terminal devices.
- secondary compression or incremental storage compression
- the encoder 20 and the decoder 30 can be deployed on a terminal device and a server on the cloud side.
- the encoder 20 can encode and compress the video on the terminal device, and perform secondary compression (or incremental storage compression) based on the video encoding method provided in an embodiment of the present application, and transmit the compressed data to the server.
- FIG. 1B is an illustrative diagram of an example of a video decoding system 40 including the encoder 20 of FIG. 2 and/or the decoder 30 of FIG. 3 according to an exemplary embodiment.
- the video decoding system 40 may implement a combination of various techniques of the embodiments of the present invention.
- the video decoding system 40 may include an imaging device 41, an encoder 20, a decoder 30 (and/or a video codec implemented by logic circuits of a processing unit 46), an antenna 42, one or more processors 43, one or more memories 44, and/or a display device 45.
- imaging device 41, antenna 42, processing unit 46, logic circuit, encoder 20, decoder 30, processor 43, memory 44, and/or display device 45 are capable of communicating with each other.
- video decoding system 40 is illustrated with encoder 20 and decoder 30, in different examples, video decoding system 40 may include only encoder 20 or only decoder 30.
- antenna 42 can be used to transmit or receive encoded data of video data.
- display device 45 can be used to present video data.
- the logic circuit can be implemented by processing unit 46.
- Processing unit 46 can include application-specific integrated circuit (ASIC) logic, graphics processor, general processor, etc.
- Video decoding system 40 can also include optional processor 43, which can similarly include application-specific integrated circuit (ASIC) logic, graphics processor, general processor, etc.
- the logic circuit can be implemented by hardware, such as video encoding dedicated hardware, etc., and processor 43 can be implemented by general software, operating system, etc.
- memory 44 can be any type of memory, such as volatile memory (e.g., static random access memory (SRAM), dynamic random access memory (DRAM), etc.) or non-volatile memory (e.g., flash memory, etc.).
- volatile memory e.g., static random access memory (SRAM), dynamic random access memory (DRAM), etc.
- non-volatile memory e.g., flash memory, etc.
- memory 44 may be implemented by cache memory.
- logic circuitry may access memory 44 (e.g., for implementing an image buffer).
- logic circuitry and/or processing unit 46 may include memory (e.g., cache memory, etc.) for implementing an image buffer, etc.
- the encoder 20 implemented by logic circuits may include an image buffer (e.g., implemented by processing unit 46 or memory 44) and a graphics processing unit (e.g., implemented by processing unit 46).
- the graphics processing unit may be communicatively coupled to the image buffer.
- the graphics processing unit may include the encoder 20 implemented by logic circuits to implement the various modules discussed with reference to FIG. 2 and/or any other encoder system or subsystem described herein.
- the logic circuits may be used to perform the various operations discussed herein.
- the decoder 30 may be implemented by logic circuits in a similar manner to implement the various modules discussed with reference to the decoder 30 of FIG. 3 and/or any other decoder systems or subsystems described herein.
- the decoder 30 implemented by logic circuits may include an image buffer (implemented by the processing unit 2820 or memory 44) and a graphics processing unit (implemented, for example, by the processing unit 46).
- the graphics processing unit may be communicatively coupled to the image buffer.
- the graphics processing unit may include the decoder 30 implemented by logic circuits to implement the various modules discussed with reference to FIG. 3 and/or any other decoder systems or subsystems described herein.
- antenna 42 may be used to receive encoded encoding data of the video data.
- the encoded encoding data may include data related to the encoded video frames discussed herein, indicators, index values, mode selection data, etc., such as data related to the encoding partition (e.g., transform coefficients or quantized transform coefficients, (as discussed) optional indicators, and/or data defining the encoding partition).
- Video decoding system 40 may also include a decoder 30 coupled to antenna 42 and used to decode the encoded encoding data.
- Display device 45 is used to present the video frames.
- the decoder 30 can be used to perform the reverse process.
- decoder 30 can be used to receive and parse such syntax elements and decode the relevant video data accordingly.
- encoder 20 can entropy encode the syntax elements into encoded video encoding data.
- decoder 30 can parse such syntax elements and decode the relevant video data accordingly.
- FIG. 2 shows a schematic/conceptual block diagram of an example of an encoder 20 for implementing an embodiment of the present invention.
- the encoder 20 includes a residual calculation unit 204, a transform processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a buffer 216, a loop filter unit 220, a decoded picture buffer (DPB) 230, a prediction processing unit 260, and an entropy coding unit 270.
- the prediction processing unit 260 may include an inter-frame prediction unit 244, an intra-frame prediction unit 254, and a mode selection unit 262.
- the inter-frame prediction unit 244 may include a motion estimation unit and a motion compensation unit (not shown).
- the encoder 20 shown in FIG. 2 may also be referred to as a hybrid video encoder or a video encoder according to a hybrid video codec.
- the residual calculation unit 204, the transform processing unit 206, the quantization unit 208, the prediction processing unit 260 and the entropy coding unit 270 form a forward signal path of the encoder 20, while for example, the inverse quantization unit 210, the inverse transform processing unit 212, the reconstruction unit 214, the buffer 216, the loop filter 220, the decoded picture buffer (DPB) 230, and the prediction processing unit 260 form a backward signal path of the encoder, wherein the backward signal path of the encoder corresponds to the signal path of the decoder (see the decoder 30 in Figure 3).
- the encoder 20 receives a picture 201 or an image block 203 of the picture 201, for example, a picture in a sequence of pictures forming a video or a video sequence, via, for example, an input 202.
- the image block 203 may also be referred to as a current coding block or an image block to be processed, and the picture 201 may be referred to as a current picture or a picture to be coded (especially when the current picture is distinguished from other pictures in video coding, such as previously coded and/or decoded pictures in the same video sequence, i.e., a video sequence that also includes the current picture).
- An embodiment of the encoder 20 may include a segmentation unit (not shown in FIG. 2 ) for segmenting the picture 201 into a plurality of blocks, such as image blocks 203 , typically into a plurality of non-overlapping blocks.
- the segmentation unit may be used to use the same block size for all pictures in the video sequence and define a corresponding grid of block sizes, or to change the block size between pictures or subsets or groups of pictures and segment each picture into corresponding blocks.
- prediction processing unit 260 of encoder 20 may be used to perform any combination of the above-described segmentation techniques.
- the image block 203 is also or can be regarded as a two-dimensional array or matrix of sampling points with sample values, although its size is smaller than that of the picture 201.
- the image block 203 may include, for example, one sampling array (e.g., a luminance array in the case of the black and white picture 201) or three sampling arrays (e.g., one luminance array and two chrominance arrays in the case of a color picture) or any other number and/or type of arrays depending on the color format applied.
- the number of sampling points in the horizontal and vertical directions (or axes) of the image block 203 defines the size of the image block 203.
- the encoder 20 shown in FIG. 2 is used to encode the picture 201 block by block, for example, performing encoding and prediction on each image block 203 .
- the residual calculation unit 204 is used to calculate the residual block 205 based on the picture image block 203 and the prediction block 265 (other details of the prediction block 265 are provided below), for example, by subtracting the sample value of the prediction block 265 from the sample value of the picture image block 203 sample by sample (pixel by pixel) to obtain the residual block 205 in the sample domain.
- the transform processing unit 206 is used to apply a transform such as discrete cosine transform (DCT) or discrete sine transform (DST) on the sample values of the residual block 205 to obtain a transform coefficient 207 in the transform domain.
- the transform coefficient 207 may also be referred to as a transform residual coefficient and represents the residual block 205 in the transform domain.
- the transform processing unit 206 can be used to apply an integer approximation of the DCT/DST, such as the transform specified for HEVC/H.265. Compared to the orthogonal DCT transform, such integer approximation is usually scaled by a certain factor. In order to maintain the norm of the residual block processed by the forward transform and the inverse transform, an additional scaling factor is applied as part of the transform process.
- the scaling factor is usually selected based on certain constraints, such as whether the scaling factor is a power of 2 for the shift operation, the bit depth of the transform coefficients, the balance between accuracy and implementation cost, etc.
- a specific scaling factor is specified for the inverse transform on the decoder 30 side by, for example, the inverse transform processing unit 212 (and for the corresponding inverse transform on the encoder 20 side by, for example, the inverse transform processing unit 212), and accordingly, a corresponding scaling factor can be specified for the forward transform on the encoder 20 side by the transform processing unit 206.
- the quantization unit 208 is used to quantize the transform coefficients 207, for example, by applying scalar quantization or vector quantization to obtain quantized transform coefficients 209.
- the quantized transform coefficients 209 may also be referred to as quantized residual coefficients 209.
- the quantization process may reduce the bit depth associated with some or all of the transform coefficients 207. For example, an n-bit transform coefficient may be rounded down to an m-bit transform coefficient during quantization, where n is greater than m.
- the degree of quantization may be modified by adjusting a quantization parameter (QP). For example, for scalar quantization, different scales may be applied to achieve finer or coarser quantization.
- QP quantization parameter
- a smaller quantization step size corresponds to finer quantization, while a larger quantization step size corresponds to coarser quantization.
- the appropriate quantization step size may be indicated by a quantization parameter (QP).
- the quantization parameter may be an appropriate quantization step size.
- the index of the predefined set of lengths For example, a smaller quantization parameter may correspond to fine quantization (a smaller quantization step size), a larger quantization parameter may correspond to coarse quantization (a larger quantization step size), and vice versa.
- Quantization may include division by the quantization step size and corresponding quantization or inverse quantization, for example, performed by inverse quantization 210, or may include multiplication by the quantization step size.
- the quantization step size may be determined using a quantization parameter.
- the quantization step size may be calculated based on the quantization parameter using a fixed-point approximation of an equation containing division. Additional scaling factors may be introduced for quantization and inverse quantization to recover the norm of the residual block that may be modified by the scale used in the fixed-point approximation of the equation for the quantization step size and the quantization parameter.
- the scales of the inverse transform and inverse quantization may be merged.
- a custom quantization table may be used and sent from the encoder to the decoder through a signal, for example in the encoded data. Quantization is a lossy operation, where the larger the quantization step size, the greater the loss.
- the inverse quantization unit 210 is used to apply the inverse quantization of the quantization unit 208 on the quantized coefficients to obtain inverse quantized coefficients 211, for example, applying an inverse quantization scheme of the quantization scheme applied by the quantization unit 208 based on or using the same quantization step size as the quantization unit 208.
- the inverse quantized coefficients 211 may also be referred to as inverse quantized residual coefficients 211, corresponding to the transform coefficients 207, although the loss due to quantization is generally different from that of the transform coefficients.
- the inverse transform processing unit 212 is used to apply the inverse transform of the transform applied by the transform processing unit 206, for example, an inverse discrete cosine transform (DCT) or an inverse discrete sine transform (DST), to obtain an inverse transform block 213 in the sample domain.
- the inverse transform block 213 may also be referred to as an inverse transform dequantized block 213 or an inverse transform residual block 213.
- the reconstruction unit 214 (e.g., the summer 214) is used to add the inverse transform block 213 (i.e., the reconstructed residual block 213) to the prediction block 265 to obtain the reconstructed block 215 in the sample domain, for example, by adding the sample values of the reconstructed residual block 213 to the sample values of the prediction block 265.
- a buffer unit 216 (or simply "buffer" 216), such as a line buffer 216, is used to buffer or store the reconstructed blocks 215 and corresponding sample values for, for example, intra-frame prediction.
- the encoder can be used to use the unfiltered reconstructed blocks and/or corresponding sample values stored in the buffer unit 216 for any type of estimation and/or prediction, such as intra-frame prediction.
- embodiments of the encoder 20 may be configured such that the buffer unit 216 is used not only to store the reconstructed blocks 215 for the intra-frame prediction 254, but also for the loop filter unit 220 (not shown in FIG. 2 ), and/or, for example, such that the buffer unit 216 and the decoded picture buffer unit 230 form one buffer.
- Other embodiments may be used to use the filtered blocks 221 and/or blocks or samples from the decoded picture buffer 230 (neither shown in FIG. 2 ) as input or basis for the intra-frame prediction 254.
- the loop filter unit 220 (or simply "loop filter” 220) is used to filter the reconstructed block 215 to obtain a filtered block 221, so as to smoothly perform pixel conversion or improve video quality.
- the loop filter unit 220 is intended to represent one or more loop filters, such as a deblocking filter, a sample-adaptive offset (SAO) filter, or other filters, such as a bilateral filter, an adaptive loop filter (ALF), or a sharpening or smoothing filter, or a collaborative filter.
- the loop filter unit 220 is shown as an in-loop filter in Figure 2, in other configurations, the loop filter unit 220 may be implemented as a post-loop filter.
- the filtered block 221 may also be referred to as a filtered reconstructed block 221.
- the decoded picture buffer 230 may store the reconstructed coding block after the loop filter unit 220 performs a filtering operation on the reconstructed coding block.
- Embodiments of the encoder 20 can be used to output loop filter parameters (e.g., sample adaptive offset information), for example, directly or after entropy encoding by the entropy encoding unit 270 or any other entropy encoding unit, such that the decoder 30 can receive and apply the same loop filter parameters for decoding.
- loop filter parameters e.g., sample adaptive offset information
- the entropy coding unit 270 is configured to perform entropy coding according to the output (e.g., quantized transform coefficients) from the quantization unit 208 and the side information.
- the entropy coding unit 270 may be configured to determine parameters representing the quantized transform coefficients, side information, etc.
- the entropy coding unit 270 may be configured to predict the value of the parameter based on the context information, and then encode the difference between the actual value and the predicted value. For the target symbol representing the value to be encoded, the entropy coding unit 270 may be configured to perform entropy coding in various ways.
- Typical entropy coding techniques include Exponential-Golomb coding, Golomb-Rice coding, context adaptive binary arithmetic coding ("CABAC”), differential coding, Huffman coding, run length coding, Lempel-Ziv (“LZ”) coding, dictionary coding, RANS coding, ANS coding, TANS coding or other variations of ANS coding, and combinations thereof.
- CABAC context adaptive binary arithmetic coding
- LZ LZiv
- dictionary coding dictionary coding
- RANS coding ANS coding
- ANS coding ANS coding
- TANS coding TANS coding or other variations of ANS coding, and combinations thereof.
- the entropy coding unit 270 may perform one or more variations of ANS coding.
- the decoded picture buffer (DPB) 230 may be a reference picture memory for storing reference picture data for use by the encoder 20 in encoding video data.
- the DPB 230 may be formed by any of a variety of memory devices, such as a dynamic random access memory (DRAM) (including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), resistive RAM (RRAM)) or other types of memory devices.
- DRAM dynamic random access memory
- SDRAM synchronous DRAM
- MRAM magnetoresistive RAM
- RRAM resistive RAM
- the DPB 230 and the buffer 216 may be provided by the same memory device or by separate memory devices.
- the decoded picture buffer (DPB) 230 is used to store the filtered block 221.
- the decoded picture buffer 230 may further be used to store other previously filtered blocks of the same current picture or a different picture of a previously reconstructed picture, such as a previously reconstructed and filtered block 221, and may provide a complete previously reconstructed, i.e., decoded picture (and corresponding reference blocks and samples) and/or a partially reconstructed current picture (and corresponding reference blocks and samples), such as for inter-frame prediction.
- a decoded picture buffer (DPB) 230 is used to store the reconstructed block 215.
- the prediction processing unit 260 also referred to as the block prediction processing unit 260, is used to receive or obtain an image block 203 (a current image block 203 of a current picture 201) and reconstructed picture data, such as reference samples of the same (current) picture from a buffer 216 and/or reference picture data 231 of one or more previously decoded pictures from a decoded picture buffer 230, and to process such data for prediction, i.e., to provide a prediction block 265 which may be an inter-prediction block 245 or an intra-prediction block 255.
- the mode selection unit 262 may be used to select a prediction mode (eg, intra or inter prediction mode) and/or a corresponding prediction block 245 or 255 for use as a prediction block 265 to calculate the residual block 205 and reconstruct the reconstructed block 215 .
- a prediction mode eg, intra or inter prediction mode
- a corresponding prediction block 245 or 255 for use as a prediction block 265 to calculate the residual block 205 and reconstruct the reconstructed block 215 .
- Embodiments of the mode selection unit 262 may be used to select a prediction mode (e.g., from those prediction modes supported by the prediction processing unit 260) that provides the best match or minimum residual (minimum residual means better compression in transmission or storage), or provides minimum signaling overhead (minimum signaling overhead means better compression in transmission or storage), or both.
- the mode selection unit 262 may be used to determine the prediction mode based on rate distortion optimization (RDO), i.e., select a prediction mode that provides minimum rate distortion optimization, or select a prediction mode whose associated rate distortion at least meets the prediction mode selection criteria.
- RDO rate distortion optimization
- the encoder 20 is used to determine or select the best or optimal prediction mode from a (predetermined) prediction mode set.
- the prediction mode set may include, for example, an intra-frame prediction mode and/or an inter-frame prediction mode.
- the intra-frame prediction mode set may include multiple different intra-frame prediction modes, for example, non-directional modes such as DC (or mean) mode and planar mode, or directional modes as defined in H.265, or may include 67 different intra-frame prediction modes, for example, non-directional modes such as DC (or mean) mode and planar mode, or directional modes as defined in H.266 under development.
- the inter-frame prediction mode set depends on the available reference picture (i.e., at least part of the decoded picture stored in DBP230 as mentioned above) and other inter-frame prediction parameters, such as whether to use the entire reference picture or only a part of the reference picture, such as a search window area around the area of the current block, to search for the best matching reference block, and/or, for example, whether pixel interpolation such as half-pixel and/or quarter-pixel interpolation is applied.
- the inter-frame prediction mode set may, for example, include an Advanced Motion Vector Prediction (AMVP) mode and a merge mode.
- AMVP Advanced Motion Vector Prediction
- the inter-frame prediction mode set may include the prediction mode based on the affine motion model described in the embodiment of the present invention, such as the advanced motion vector prediction mode (Affine AMVP mode) based on the affine motion model or the fusion mode (Affine Merge mode) based on the affine motion model, specifically, the control point-based AMVP mode (inherited control point motion vector prediction method or constructed control point motion vector prediction method), the control point-based merge mode (inherited control point motion vector prediction method or constructed control point motion vector prediction method); and, advanced temporal motion vector prediction (ATMVP) method, PLANAER method, etc.; or, a sub-block based merging mode (Sub-block based merging mode) formed by the combination of the above-mentioned affine motion model-based fusion mode, ATMVP and/or PLANAR method, etc.
- Affine AMVP mode inherited control point motion vector prediction method or constructed control point motion vector prediction method
- ATMVP advanced temporal motion vector prediction
- inter-frame prediction of the image block to be processed can be applied to unidirectional prediction (forward or backward), bidirectional prediction (forward and backward) or multi-frame prediction.
- bidirectional prediction generalized bi-prediction (GBi) at the bidirectional prediction block level, or weighted prediction method, can be adopted.
- GBi generalized bi-prediction
- the intra-frame prediction unit 254 can be used to perform any combination of the inter-frame prediction techniques described below.
- embodiments of the present invention may also apply skip mode and/or direct mode.
- the prediction processing unit 260 can be further used to partition the image block 203 into smaller block partitions or sub-blocks, for example, by iteratively using quad-tree (QT) partitioning, binary-tree (BT) partitioning or triple-tree (TT) partitioning, or any combination thereof, and for performing prediction for each of the block partitions or sub-blocks, for example, wherein the mode selection includes selecting a tree structure of the partitioned image block 203 and selecting a prediction mode to be applied to each of the block partitions or sub-blocks.
- QT quad-tree
- BT binary-tree
- TT triple-tree
- the inter-frame prediction unit 244 may include a motion estimation (ME) unit (not shown in FIG. 2 ) and a motion compensation unit.
- the motion estimation unit is used to receive or obtain a picture image block 203 (the current picture image block 203 of the current picture 201) and a decoded picture 231, or at least one or more previously reconstructed blocks, for example, reconstructed blocks of one or more other/different previously decoded pictures 231, and perform motion estimation based on the determined inter-frame prediction mode.
- a video sequence may include a current picture and a previously decoded picture 31, or in other words, the current picture and the previously decoded picture 31 may be part of a picture sequence forming a video sequence, or form the picture sequence.
- the encoder 20 may be configured to select a reference block from a plurality of reference blocks of the same or different pictures in a plurality of other pictures (reference images), and provide the reference picture and/or provide an offset (spatial offset) between the position (X, Y coordinates) of the reference block and the position of the current block as an inter-frame prediction parameter to a motion estimation unit (not shown in FIG. 2 ).
- the offset is also referred to as a motion vector (MV).
- the motion compensation unit is used to obtain inter-frame prediction parameters and perform inter-frame prediction based on or using the inter-frame prediction parameters to obtain an inter-frame prediction block 245.
- the motion compensation performed by the motion compensation unit may include retrieving or generating a prediction block (prediction value) based on a motion/block vector determined by motion estimation (possibly performing interpolation to sub-pixel accuracy). Interpolation filtering can generate additional pixel samples from known pixel samples, thereby potentially increasing the number of candidate prediction blocks that can be used to encode the picture block.
- the motion compensation unit 246 can locate the prediction block pointed to by the motion vector in a reference picture list.
- the motion compensation unit 246 can also generate syntax elements associated with blocks and video slices for use by the decoder 30 when decoding picture blocks of the video slice.
- the inter-frame prediction unit 244 may transmit syntax elements to the entropy coding unit 270, and the syntax elements may include, for example, inter-frame prediction parameters (such as indication information of selecting an inter-frame prediction mode for current block prediction after traversing multiple inter-frame prediction modes), the index number of the candidate motion vector list, and optionally also the GBi index number, the reference frame index, etc.
- inter-frame prediction parameters such as indication information of selecting an inter-frame prediction mode for current block prediction after traversing multiple inter-frame prediction modes
- the index number of the candidate motion vector list such as indication information of selecting an inter-frame prediction mode for current block prediction after traversing multiple inter-frame prediction modes
- the GBi index number the GBi index number
- the reference frame index etc.
- the inter-frame prediction unit 244 can be used to perform any combination of inter-frame prediction techniques.
- the intra prediction unit 254 is used to obtain, for example, receive a picture block 203 (current picture block) of the same picture and one or more previously reconstructed blocks, for example, reconstructed adjacent blocks, for intra estimation.
- the encoder 20 can be used to select an intra prediction mode from a plurality of (predetermined) intra prediction modes.
- Embodiments of the encoder 20 may be configured to select an intra prediction mode based on an optimization criterion, such as minimum residual (eg, the intra prediction mode that provides a prediction block 255 most similar to the current picture block 203) or minimum rate distortion.
- an optimization criterion such as minimum residual (eg, the intra prediction mode that provides a prediction block 255 most similar to the current picture block 203) or minimum rate distortion.
- the intra prediction unit 254 is further configured to determine an intra prediction block 255 based on the intra prediction parameters of the selected intra prediction mode. In any case, after selecting the intra prediction mode for the block, the intra prediction unit 254 is further configured to provide the intra prediction parameters, i.e., information indicating the selected intra prediction mode for the block, to the entropy encoding unit 270. In one example, the intra prediction unit 254 can be configured to perform any combination of intra prediction techniques.
- the intra prediction unit 254 may transmit a syntax element to the entropy coding unit 270, wherein the syntax element includes an intra prediction parameter (such as indication information of selecting an intra prediction mode for current block prediction after traversing multiple intra prediction modes).
- the intra prediction parameter may not be carried in the syntax element, and the decoding end 30 may directly use the default prediction mode for decoding.
- the entropy coding unit 270 is used to apply an entropy coding algorithm or scheme (e.g., a variable length coding (VLC) scheme, a context adaptive VLC (CAVLC) scheme, an arithmetic coding scheme, context adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) coding or other entropy coding methods or techniques) to a single or all (or none) of the quantized residual coefficients 209, inter-frame prediction parameters, intra-frame prediction parameters and/or loop filter parameters to obtain encoded picture data 21 that can be output through an output 272 in the form of, for example, encoded coded data 21.
- the encoded coded data can be transmitted to the decoder 30 or archived for later transmission or retrieval by the decoder 30.
- Entropy encoding unit 270 may also be used to entropy encode other syntax elements for the current video slice
- a non-transform based encoder 20 may directly quantize the residual signal without a transform processing unit 206 for certain blocks or frames.
- the encoder 20 may have a quantization unit 208 and an inverse quantization unit 210 combined into a single unit.
- the encoder 20 can directly quantize the residual signal without processing by the transform processing unit 206, and accordingly, there is no need to inverse transform.
- the loop filter 220 is optional, and in the case of lossless compression encoding, the transform processing unit 206, the quantization unit 208, the inverse quantization unit 210 and the inverse transform processing unit 212 are optional. It should be understood that, according to different application scenarios, the inter-frame prediction unit 244 and the intra-frame prediction unit 254 can be selectively enabled.
- the decoder 30 is configured to receive encoded picture data (e.g., encoded coding data) 21, for example, encoded by the encoder 20, to obtain a decoded picture 231.
- encoded picture data e.g., encoded coding data
- the decoder 30 receives video data from the encoder 20, such as encoded video coding data representing picture blocks of an encoded video slice and associated syntax elements.
- decoder 30 includes an entropy decoding unit 304, an inverse quantization unit 310, an inverse transform processing unit 312, a reconstruction unit 314 (e.g., summer 314), a buffer 316, a loop filter 320, a decoded picture buffer 330, and a prediction processing unit 360.
- Prediction processing unit 360 may include an inter-prediction unit 344, an intra-prediction unit 354, and a mode selection unit 362.
- decoder 30 may perform a decoding pass that is generally reciprocal to the encoding pass described with reference to encoder 20 of FIG. 2 .
- the entropy decoding unit 304 is used to perform entropy decoding on the encoded picture data 21 to obtain, for example, quantized coefficients 309 and/or decoded coding parameters (not shown in FIG. 3 ), such as any one or all of (decoded) inter-frame prediction, intra-frame prediction parameters, loop filter parameters, and/or other syntax elements.
- the entropy decoding unit 304 is further used to forward the inter-frame prediction parameters, intra-frame prediction parameters, and/or other syntax elements to the prediction processing unit 360.
- the decoder 30 may receive syntax elements at the video slice level and/or the video block level.
- the entropy decoding unit 304 is configured to perform entropy decoding on the coded data, thereby generating output symbols for the parameters.
- the entropy decoding unit 304 can be configured to reconstruct the parameters representing the quantized transform coefficients and side information.
- the entropy decoding unit 304 can be configured to perform entropy decoding in various ways. Typical entropy decoding techniques include exponential Golomb decoding, Golomb-Rice decoding, context-adaptive binary arithmetic decoding, Huffman decoding, run-length decoding, Lempel-Ziv ("LZ") decoding, dictionary decoding, RANS decoding and ANS decoding, TANS decoding or other variants of ANS decoding, and combinations thereof. In the embodiment of the present application, the entropy decoding unit 304 can perform one or more variants of ANS decoding.
- the inverse quantization unit 310 may be functionally the same as the inverse quantization unit 110
- the inverse transform processing unit 312 may be functionally the same as the inverse transform processing unit 212
- the reconstruction unit 314 may be functionally the same as the reconstruction unit 214
- the buffer 316 may be functionally the same as the buffer 216
- the loop filter 320 may be functionally the same as the loop filter 220
- the decoded picture buffer 330 may be functionally the same as the decoded picture buffer 230.
- the prediction processing unit 360 may include an inter-frame prediction unit 344 and an intra-frame prediction unit 354, wherein the inter-frame prediction unit 344 may be functionally similar to the inter-frame prediction unit 244, and the intra-frame prediction unit 354 may be functionally similar to the intra-frame prediction unit 254.
- the prediction processing unit 360 is generally used to perform block prediction and/or obtain a prediction block 365 from the encoded data 21, and receive or obtain prediction related parameters and/or information about the selected prediction mode from, for example, the entropy decoding unit 304 (explicitly or implicitly).
- the intra-prediction unit 354 of the prediction processing unit 360 is used to generate a prediction block 365 for a picture block of the current video slice based on the signaled intra-prediction mode and data from a previously decoded block of the current frame or picture.
- the inter-prediction unit 344 e.g., motion compensation unit
- the prediction block may be generated from one of the reference pictures within one of the reference picture lists. Decoder 30 may construct reference frame lists: List 0 and List 1 using a default construction technique based on the reference pictures stored in DPB 330.
- the prediction processing unit 360 is configured to determine prediction information for a video block of a current video slice by parsing motion vectors and other syntax elements, and to generate a prediction block for the current video block being decoded using the prediction information.
- the prediction processing unit 360 uses some of the received syntax elements to determine a prediction mode (e.g., intra-frame or inter-frame prediction) for encoding a video block of a video slice, an inter-frame prediction slice type (e.g., a B slice, a P slice, or a GPB slice), construction information for one or more of a reference picture list for the slice, a motion vector for each inter-frame coded video block of the slice, an inter-frame prediction state for each inter-frame coded video block of the slice, and other information to decode the video block of the current video slice.
- the syntax elements received by the decoder 30 from the encoded data include syntax elements received in one or more of an adaptive parameter set (APS), a sequence parameter set (SPS),
- Inverse quantization unit 310 may be used to inverse quantize (i.e., dequantize) quantized transform coefficients provided in the encoded data and decoded by entropy decoding unit 304.
- the inverse quantization process may include using quantization parameters calculated by encoder 20 for each video block in a video slice to determine a degree of quantization that should be applied and likewise a degree of inverse quantization that should be applied.
- the inverse transform processing unit 312 is used to apply an inverse transform (eg, an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process) to the transform coefficients to generate a residual block in the pixel domain.
- an inverse transform eg, an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process
- the reconstruction unit 314 (e.g., the summer 314) is used to add the inverse transform block 313 (i.e., the reconstructed residual block 313) to the prediction block 365 to obtain the reconstructed block 315 in the sample domain, for example, by adding the sample values of the reconstructed residual block 313 to the sample values of the prediction block 365.
- the loop filter unit 320 (during or after the encoding cycle) is used to filter the reconstructed block 315 to obtain the filtered block 321, so as to smoothly perform pixel conversion or improve video quality.
- the loop filter unit 320 can be used to perform any combination of the filtering techniques described below.
- the loop filter unit 320 is intended to represent one or more loop filters, such as a deblocking filter, a sample adaptive offset (sample-adaptiveoffset, SAO) filter or other filters, such as a bilateral filter, an adaptive loop filter (adaptiveloopfilter, ALF), or a sharpening or smoothing filter, or a collaborative filter.
- SAO sample adaptive offset
- ALF adaptive loop filter
- the loop filter unit 320 is shown as an in-loop filter in FIG. 3, in other configurations, the loop filter unit 320 can be implemented as a post-loop filter.
- decoded video blocks 321 in a given frame or picture are then stored in a decoded picture buffer 330 which stores reference pictures for subsequent motion compensation.
- Decoder 30 is operable to output decoded picture 31 , eg, via output 332 , for presentation to or viewing by a user.
- the decoder 30 may be used to decode the compressed encoded data.
- the decoder 30 may generate an output video stream without the loop filter unit 320.
- a non-transform based decoder 30 may directly inverse quantize the residual signal without the inverse transform processing unit 312 for certain blocks or frames.
- the decoder 30 may have the inverse quantization unit 310 and the inverse transform processing unit 312 combined into a single unit.
- the decoder 30 may be used to implement the data decoding method described in the embodiment corresponding to FIG. 9 below.
- the processing result of a certain link can be further processed and output to the next link.
- the processing result of the corresponding link can be further subjected to operations such as Clip or shift.
- FIG. 4 is a schematic diagram of the structure of a video decoding device 400 (e.g., a video encoding device 400 or a video decoding device 400) provided in an embodiment of the present invention.
- the video decoding device 400 is suitable for implementing the embodiments described herein.
- the video decoding device 400 may be a video decoder (e.g., the decoder 30 of FIG. 1A ) or a video encoder (e.g., the encoder 20 of FIG. 1A ).
- the video decoding device 400 may be one or more components of the decoder 30 of FIG. 1A or the encoder 20 of FIG. 1A .
- the video decoding device 400 includes: an inlet port 410 and a receiving unit (Rx) 420 for receiving data, a processor, a logic unit or a central processing unit (CPU) 430 for processing data, a transmitter unit (Tx) 440 and an outlet port 450 for transmitting data, and a memory 460 for storing data.
- the video decoding device 400 may also include an optical-to-electrical conversion component and an electro-optical (EO) component coupled to the inlet port 410, the receiver unit 420, the transmitter unit 440 and the outlet port 450 for the outlet or inlet of an optical signal or an electrical signal.
- EO electro-optical
- the processor 430 is implemented by hardware and software.
- the processor 430 can be implemented as one or more CPU chips, cores (e.g., multi-core processors), FPGAs, ASICs, and DSPs.
- the processor 430 communicates with the inlet port 410, the receiver unit 420, the transmitter unit 440, the outlet port 450, and the memory 460.
- the processor 430 includes a decoding module 470 (e.g., an encoding module 470 or a decoding module 470).
- the encoding/decoding module 470 implements the embodiments disclosed herein to implement the chrominance block prediction method provided by the embodiments of the present invention. For example, the encoding/decoding module 470 implements, processes, or provides various encoding operations.
- the encoding/decoding module 470 provides substantial improvements to the functions of the video decoding device 400 and affects the conversion of the video decoding device 400 to different states.
- the encoding/decoding module 470 is implemented by instructions stored in the memory 460 and executed by the processor 430.
- Memory 460 includes one or more disks, tape drives, and solid-state drives, and can be used as an overflow data storage device to store programs when these programs are selectively executed, and to store instructions and data read during program execution.
- Memory 460 can be volatile and/or non-volatile, and can be read-only memory (ROM), random access memory (RAM), ternary content-addressable memory (TCAM), and/or static random access memory (SRAM).
- ROM read-only memory
- RAM random access memory
- TCAM ternary content-addressable memory
- SRAM static random access memory
- FIG. 5 is a simplified block diagram of an apparatus that can be used as either or both of the source apparatus 12 and the destination apparatus 14 in FIG. 1A according to an exemplary embodiment.
- the apparatus can implement the technology of the present invention.
- FIG. 5 is a schematic block diagram of an implementation of an encoding apparatus or a decoding apparatus (hereinafter referred to as a decoding apparatus) according to an embodiment of the present invention.
- the decoding apparatus may include a processor 510, a memory 530, and a decoder 540. and a bus system 550.
- the processor and the memory are connected via the bus system, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory.
- the memory of the decoding device stores program codes, and the processor can call the program codes stored in the memory to execute various video encoding or decoding methods described in the present invention. To avoid repetition, it will not be described in detail here.
- the processor 510 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
- a general-purpose processor may be a microprocessor or any conventional processor, etc.
- the memory 530 may include a read-only memory (ROM) device or a random access memory (RAM) device. Any other suitable type of storage device may also be used as the memory 530.
- the memory 530 may include code and data 531 accessed by the processor 510 using the bus 550.
- the memory 530 may further include an operating system 533 and an application 535, which includes at least one program that allows the processor 510 to perform the video encoding or decoding method described in the present invention.
- the application 535 may include applications 1 to N, which further include a video encoding or decoding application (referred to as a video decoding application) that executes the video encoding or decoding method described in the present invention.
- the bus system 550 may include, in addition to the data bus, a power bus, a control bus, a status signal bus, etc. However, for the sake of clarity, various buses are labeled as the bus system 550 in the figure.
- the decoding device may also include one or more output devices, such as a display 570.
- the display 570 may be a touch-sensitive display that combines a display with a touch-sensitive unit operable to sense touch input.
- the display 570 may be connected to the processor 510 via the bus 550.
- processor 510 and memory 530 of the device are illustrated as being integrated in a single unit in FIG. 5 , other configurations may also be used.
- the operation of the processor 510 may be distributed in a plurality of directly coupled machines (each machine having one or more processors), or distributed in a local area or other network.
- the memory 530 may be distributed in a plurality of machines, such as a network-based memory or a memory in a plurality of machines running the device.
- bus 550 of the device may be formed by a plurality of buses.
- the memory 530 may be directly coupled to other components of the device or may be accessed through a network, and may include a single integrated unit, such as a memory card, or a plurality of units, such as a plurality of memory cards. Therefore, the device may be implemented in a variety of configurations.
- FIG. 6 is a schematic diagram of an embodiment of a data encoding method provided in an embodiment of the present application.
- a data encoding method provided in an embodiment of the present application includes:
- the data encoding method corresponding to Figure 6 can be applied to an encoder based on an asymmetric digital system ANS.
- the encoder based on ANS can be used as an entropy encoding unit in the data encoding process.
- the encoder based on the asymmetric digital system ANS will be referred to as the ANS encoder below.
- the ANS encoder may receive an input symbol stream (including a target symbol), encode the input symbol stream, and output encoded data (or may be referred to as an encoding result) as part of a bit stream.
- the total number of bits output is less than the total number of bits input, thereby providing a compression effect.
- the ANS encoder may include an input symbol buffer for storing input symbols to be encoded.
- the target symbol may be a parameter for a quantized transform coefficient from a media (e.g., video, image, audio, graphic texture), a parameter for other residual data from the media, or other data.
- the bits (or codewords) obtained by encoding the input symbol stream may include state information and storage bits, wherein the state information s is an integer, supporting operations such as addition, subtraction, multiplication, division, shift, and or non-or the like, and the storage (memory) bit is a first-in-last-out bit stream, supporting writing a specified number of bits (write) and reading a specified number of bits (read) operations. It is necessary to ensure that after any legal number is written to a specific number of bits, the number can be restored by reading the same number of bits. In the case of passing, the encoding order is opposite to the decoding order, for example, reverse encoding and forward decoding.
- the probability information may include a quantization probability, a probability mass function (PMF), and a cumulative distribution function (CDF) corresponding to each input symbol among multiple input symbols.
- PMF probability mass function
- CDF cumulative distribution function
- the probability mass function PMF of each symbol x is calculated based on the quantized probability: (denoted as P(x)) and the cumulative distribution function CDF (denoted as C(x)).
- P(x) is the numerator of the quantized probability
- C(x) is the sum of P(x) of the symbols less than x.
- the multiple distribution features include a first distribution feature and a second distribution feature, the entropy of the first distribution feature is greater than the entropy of the second distribution feature; the value of the denominator of the quantization probability in the mapping relationship corresponding to the second distribution feature is greater than the denominator of the quantization probability in the mapping relationship corresponding to the first distribution feature.
- different quantization probability denominators can be used to reduce the coding length.
- a prediction model and entropy coding can be included.
- the prediction model can input the original data, output the distribution index and the data to be encoded (such as the target symbol in this application). According to the distribution index, the entropy can be calculated. For a distribution with a smaller entropy, a larger quantization probability denominator can be used.
- the probability information includes a value of a probability mass function PMF; the value of the PMF is constructed in the following manner: determining the value of the PMF of each symbol in turn among a plurality of symbols, the plurality of symbols including the target symbol; wherein, when determining the value of the PMF of the target symbol, the total value of the remaining PMF excluding the PMF of the determined symbol is multiplied by the probability of the target symbol, and the ratio between the product of the multiplication result and the remaining probability excluding the determined symbol is calculated, and the PMF of the target symbol is determined based on the relationship between the ratio and a preset fifth value.
- the fifth value is 1, and the relationship is to take a larger value.
- the remaining total PMF value can be initialized to M and the remaining total probability to 1; all symbols within the value range are sorted in ascending order of probability; for each symbol after sorting: its PMF value is: the remaining total PMF value, multiplied by the probability of this symbol, divided by the remaining total probability, rounded to the larger of 1; the remaining total PMF value is subtracted from the PMF of this symbol, and the remaining total probability is subtracted from the probability of this symbol.
- the probability information includes a value of a cumulative distribution function CDF; the value of the CDF is constructed in the following manner:
- the preset order is determined according to the relationship between the PMF values corresponding to multiple symbols, and the multiple symbols include the target symbol; wherein, when the probability distribution corresponding to the probability information of the target symbol is a symmetrical distribution, the preset order is an order staggered along both sides of the peak point in the symmetrical distribution; or, when the probability distribution corresponding to the probability information of the target symbol is a discrete distribution, the preset order is specifically an order from large to small; or, when the probability distribution corresponding to the probability information of the target symbol is a discrete distribution, the preset order is specifically an order from small to large.
- C(x) 0 at the peak point x
- the PMF values are accumulated from the peak point to both sides, that is, in the order of x, x-1, x+1, x-2, x+2,... to obtain the CDF value corresponding to each symbol.
- all symbols within the value range can be sorted from large to small according to the PMF value, recorded as x(0), x(1), x(2), ..., where C(x(0)) of x(0) is 0.
- the PMF values are accumulated in the order of x(1), x(2), ... to obtain the CDF value corresponding to each symbol.
- the order from the middle to the two sides can also be x, x+1, x-1, x+2, x-2, ...; when the PMF values are equal, a variety of possible ways can be selected to break the tie, such as index from small to large (from large to small), random seed, etc.
- the calculation method of PMF and CDF in the embodiment of the present application can ensure that the codeword length is reduced while the memory and delay remain unchanged.
- a coding table that is, a mapping relationship in the embodiment of the present application, for example, a first mapping relationship.
- the first mapping relationship may include a symbol and a corresponding bit addend (which may be referred to as first information) and a state addend (which may be referred to as second information).
- the first information in the first mapping relationship is constructed in the following manner: adding the number of consecutive highest bits of 0 in the PMF value of the target symbol and a preset sixth value; performing a bit shift operation on the sum result of the addition operation, and subtracting the shift result of the bit shift operation from the shift result of the bit shift operation on the PMF value of the target symbol to obtain the first information.
- the sixth value may be m-31, where m is an integer power of 2 in the denominator of the quantization probability.
- performing a bit shift operation on the sum result of the addition operation may specifically be performing a bit shift operation on the sum result of the addition operation by m bits to the left
- performing a bit shift operation on the value of the PMF of the target symbol may specifically be performing a bit shift operation on the value of the PMF of the target symbol by b(x) bits to the left, where b(x) may be the result of the addition operation of the number of consecutive highest bits in the value of the PMF of the target symbol being 0 and a preset sixth value.
- b(x) clz(P(x)) + m-31.
- the clz function calculates the number of consecutive 0 bits in the highest bit of a 32-bit integer.
- the first information in the first mapping relationship is constructed in the following manner: performing a bit shift operation on the sum result of the addition operation, and subtracting the shift result of the bit shift operation from the shift result of the bit shift operation on the numerical value of the PMF of the target symbol, and performing an addition operation on the operation result of the subtraction operation and the numerical value M to obtain the first information, and the probability information includes a quantization probability, and M is the denominator of the quantization probability.
- bit addend changes from (b(x) ⁇ m)-(P(x) ⁇ b(x))+M to (b(x) ⁇ m)-(P(x) ⁇ b(x)), and the range changes to [-M, (m-1) ⁇ M].
- a signed integer representation of bits since the bit OR operation is reduced, the operation cost and complexity are reduced.
- the coding efficiency can be further improved under the premise of adding a small amount of memory. It is suitable for scenarios with higher requirements for coding efficiency.
- the second information in the first mapping relationship is constructed in the following manner (Method 1): subtracting the value of the CDF of the target symbol from the value of the PMF of the target symbol to obtain the second information.
- the second information is constructed as follows:
- the second information in the first mapping relationship is constructed in the following manner (Method 2): subtracting the numerical value of the CDF of the target symbol from the numerical value of the PMF of the target symbol, and adding the result of the subtraction operation to the numerical value M to obtain the second information, wherein the probability information includes a quantization probability, and M is the denominator of the quantization probability.
- the calculation result of the "state addend” changes from C(x)-P(x) to "if C(x)-P(x) ⁇ 0, then the "state addend” is C(x)-P(x), otherwise it is C(x)-P(x)+M".
- the value range of the "state addend” is [0,M-1], which can be represented by an m-bit unsigned integer.
- the addition of one bit or operation increases the calculation overhead, which can further improve the coding efficiency while increasing a small amount of memory. It is suitable for scenarios with higher requirements for coding efficiency.
- the second information in the first mapping relationship is constructed in the following manner (Method 3): when the result of the subtraction operation of the value of the CDF of the target symbol and the value of the PMF of the target symbol is greater than or equal to 0, the result of the subtraction operation is used as the second information.
- the second information in the first mapping relationship is constructed in the following manner: when the result of the subtraction operation between the numerical value of the CDF of the target symbol and the numerical value of the PMF of the target symbol is less than 0, the result of the subtraction operation is added to the numerical value M to obtain the second information, and the probability information includes a quantization probability, and M is the denominator of the quantization probability.
- the calculation result of the "state addend” changes from C(x)-P(x) to "if C(x)-P(x) ⁇ 0, then the "state addend” is C(x)-P(x), otherwise it is C(x)-P(x)+M".
- the value range of the "state addend” is [0,M-1], which can be represented by an m-bit unsigned integer.
- Table 3 is a schematic diagram of the first mapping relationship constructed based on the above-mentioned method 2:
- Table 4 is a schematic diagram of the first mapping relationship constructed based on the above-mentioned method 3:
- the first information or the second information may represent an integer value, that is, a single integer.
- the first information may represent an integer value
- the second information may represent an integer value.
- the index information in the coding table includes only symbols
- the mapped objects include only the first information and the second information, which reduces the memory usage in the coding table.
- mapping relationships may also be configured for different probability distributions.
- the target symbol is obtained by transforming pixel data of an image
- the data obtained by transforming pixel data of the image satisfies a preset distribution
- the transformation is also used to obtain distribution characteristics of the pixel data
- the distribution characteristics include a mean or a variance
- the first mapping relationship corresponding to the distribution characteristics can be determined from multiple mapping relationships based on the distribution characteristics.
- the distribution characteristics can be used as an index to determine the first mapping relationship corresponding to the distribution characteristics from multiple mapping relationships.
- FIG. 8 is a schematic diagram of an encoding process.
- the model can include two parts. One is the image data processing module.
- the model transforms the image data. The distribution of the transformed data is simpler, which is conducive to the entropy coding process.
- the model can be a neural network, which processes the image data into transformed data and obtains the distribution index of each dimension of the transformed data.
- the model can also be a preprocessing and quantization process for image color transformation, such as performing YUV and discrete Fourier transform on RGB images to obtain transformed data, and establish specific distribution indexes for these transformed data.
- the second is to predefine several probability distributions (such as Gaussian distribution with different variances, logistic distribution, etc.), and establish corresponding distribution indexes and coding tables, where the coding table is established based on the calculated discrete PMF and CDF.
- probability distributions such as Gaussian distribution with different variances, logistic distribution, etc.
- the corresponding distribution index can be found, and the corresponding encoding table can be found, and entropy coding is used to form the encoded codeword and store it.
- the codeword can also store basic header files, such as the length and width of the image, and some necessary parameters.
- the first information and the second information may be combined and stored. After acquiring the combined data, the encoder may restore the first information and the second information based on certain operation rules.
- an integer value corresponding to the target symbol can be obtained through the first mapping relationship; based on the third operation, the integer value is restored to the first information and the second information, and the first information and the second information are respectively an integer value.
- multiple integer parameters (at most one of which is a signed integer) can be combined into a single parameter by placing the signed integer on the left, and then storing them bit by bit according to the number of bits of each parameter through shifting and bitwise OR operations; when reading the sign, the respective parameters are restored through shifting and bitwise AND operations.
- Table 7 is an illustration of a coding table before information merging
- Table 8 is an illustration of a coding table after information merging
- Table 9 is a summary of the coding table parameter lengths.
- the second information update the status information through a second operation to obtain second coded data; wherein the first coded data and the second coded data are used to obtain the coding result of the target symbol, and the first operation and the second operation do not include a division operation.
- the first coded data may be a storage bit, and the second coded data may be a state s.
- At least one of the first operation and the second operation may not include a division operation, thereby reducing the computation time. Calculate delay.
- At least one of the first operation and the second operation may not include a judgment operation, thereby reducing calculation delay.
- At least one of the first operation and the second operation may not include a binary search operation, thereby reducing calculation latency.
- the first operation includes: performing an addition operation on the first information and the status information, and performing a bit shift operation on the addition result of the addition operation; selecting a portion of bits from the status information as first encoded data, and the positions of the portion of bits in the status information are determined according to the shift result of the bit shift operation.
- the second operation includes: an addition operation on the state information and a numerical value M, and a bit shift operation on the addition result of the addition operation; wherein the probability information includes a quantization probability, and M is the denominator of the quantization probability; and an addition operation is performed on the shift result of the bit shift operation and the second information.
- the binary representation of s as an m-bit unsigned integer can be combined with the stored bits to obtain the encoding result, that is, the codeword.
- AAABA is encoded as 00101110 using the above method (wherein the first three bits 001 represent the state of 1, and 01110 are storage bits).
- FIG. 7 is a flowchart illustrating the coding process of constructing a coding table through the above-mentioned method 1 and performing the coding process through the first operation and the second operation introduced above.
- the second operation may include: performing a bit shift operation on the state information when the state information is initialized to the M; performing an addition operation on the shift result of the bit shift operation and the second information; and performing a subtraction operation on the addition result of the addition operation and the M.
- AAABA is encoded as 00101110 using the above method (wherein the first three bits 001 represent the state of 1, and 01110 are storage bits).
- the embodiment of the present application provides a data encoding method, which is applied to an encoder based on an asymmetric digital system ANS, and the method includes: obtaining a target symbol; obtaining first information and second information corresponding to the target symbol through a first mapping relationship; the first information and the second information are obtained according to the probability information corresponding to the target symbol; obtaining first coded data through a first operation according to the first information and the state information of the encoder; updating the state information through a second operation according to the second information to obtain second coded data; wherein the first coded data and the second coded data are used to obtain the coding result of the target symbol, and the first operation and the second operation do not include a division operation.
- the index information in the coding table only includes symbols
- the mapped objects only include the first information and the second information, which is equivalent to reducing the memory usage in the coding table and avoiding operations that consume a lot of memory, thereby achieving a balance between memory and latency.
- the second information includes first sub-information (also referred to as state addend 1), second sub-information (also referred to as state threshold) and third sub-information (also referred to as state addend 2);
- the first sub-information in the first mapping relationship is constructed in the following manner: performing a subtraction operation on the third value of the target symbol and the value of the PMF of the target symbol to obtain the first sub-information;
- the second sub-information in the first mapping relationship is constructed by: performing an addition operation on the third value of the target symbol and the first value of the target symbol, and performing a subtraction operation on the result of the addition operation and 1 to obtain the second sub-information;
- the third sub-information in the first mapping relationship is constructed in the following manner: subtracting the fourth value of the target symbol from the third value of the target symbol, and subtracting the result of the subtraction operation from the first value of the target symbol to obtain the third sub-information.
- the second operation includes:
- the operation result of the addition operation is smaller than the second sub-information, the operation result of the addition operation is used as the second encoded data.
- the above method can be applicable to, but not limited to, unimodal symmetrical distribution (such as Gaussian distribution, logistic distribution, Laplace distribution, etc.) to reduce the coding length, but the coding calculation amount will increase.
- unimodal symmetrical distribution such as Gaussian distribution, logistic distribution, Laplace distribution, etc.
- C1(x) is the sum of P1(x) for symbols less than x;
- C2(x) is the sum of P2(x) for symbols less than x plus all values of P1(x).
- the following table shows a schematic diagram of a coding table:
- a codeword may consist of a state s and a storage memory.
- Codeword Combine s with the stored bits using the binary representation of an m-bit unsigned integer.
- the first information is stored using 10 bits
- the first sub-information is stored using 8 bits
- the second sub-information is stored using 7 bits
- the third sub-information is stored using 7 bits.
- the sum of the first values of multiple symbols is 128, and the third sub-information is less than 128.
- bit addend The "bit addend”, "state addend 1", “state threshold”, and “state addend 2" of each symbol require 10 bits, 8 bits, 7 bits, and 7 bits respectively, for a total of 32 bits.
- the sum of all P1(x) is exactly 128, and the value of "state addend 2" is always less than 128.
- bit addend B is an even number between [2, 2048], which requires 12 bits. 10 bits can be used to represent B/2-1.
- bit addend the "bit addend", "state addend 1", “state threshold”, and “state addend 2" of each symbol require 10 bits, 8 bits, 7 bits, and 7 bits respectively, for a total of 32 bits.
- the present application also provides a data encoding method, which is applied to an encoder based on an asymmetric digital system ANS, and the method includes: obtaining a first symbol, the sum of the quantization probability corresponding to the first symbol and the quantization probability corresponding to the second symbol is 1, and the difference between the quantization probability corresponding to the first symbol and 1 is less than a threshold, and the difference between the quantization probability corresponding to the second symbol and 0 is less than a threshold; based on the relationship between the numerical size of the state information of the encoder and the numerical value M satisfying a first condition, performing a first operation between the state information and the numerical value M to obtain first encoded data, and updating the state information to 0; based on the relationship between the numerical size of the state information of the encoder and the numerical value M not satisfying the first condition, adding 1 to the state information.
- the method further includes: acquiring the second symbol; using the state information of the encoder as the first encoded data, and updating the state information to the difference between the value M and 1.
- the above embodiment can be used for encoding and decoding schemes when there are two symbols and the probability of a single symbol is close to 1.
- This embodiment does not need to build encoding and decoding tables, so no additional memory is required to store the tables. Assuming there are two symbols a and b, and the probability of symbol a is close to 1, the encoding algorithm is as follows:
- Compression symbol a If the state s ⁇ M-2, write s-M+2 (0 or 1) to the storage as 1 bit, and then update s to 0; otherwise, update s to s+1;
- Compress symbol b Write all m bits of s to storage and update s to M-1.
- FIG. 9 is a schematic diagram of an embodiment of a data decoding method provided in an embodiment of the present application.
- a data decoding method provided in an embodiment of the present application includes:
- FIG. 10A is a specific schematic diagram of a data decoding method provided in an embodiment of the present application.
- the state information (decoding state) may be obtained from the encoding side, or may be state information obtained by updating the state information during the decoding process.
- the storage bit may be obtained from the encoding side, or may be a storage bit obtained by updating the storage bit during the decoding process.
- the 902. Determine, based on the first mapping relationship, the first information, the second information and the third information corresponding to the status information; the first information is the target symbol corresponding to the first bit, the target symbol is the decoding result of the first bit, the second information represents the number of bits selected from the storage bits, the third information is used to perform an addition operation with the bits selected from the storage bits according to the third information, the addition operation result is used to update the status information, the updated status information corresponds to the second bit, and the second bit is the bit to be decoded after the first bit.
- the first mapping relationship described in Figure 6 and the first mapping relationship described in Figure 9 are different mapping relationships.
- the first mapping relationship described in Figure 9 is a decoding table.
- the first information can be called a decoding symbol
- the second information can be called a read bit number
- the third information can be called a state base.
- the first information, the second information or the third information is obtained based on probability information;
- the probability information includes the value of a probability mass function PMF;
- the value of the PMF is constructed in the following manner: sequentially determining the value of the PMF of each symbol in a plurality of symbols, the plurality of symbols including the target symbol; wherein, when determining the value of the PMF of the target symbol, the total value of the remaining PMF excluding the PMF of the determined symbol is multiplied by the probability of the target symbol, and the ratio between the product of the multiplication result and the remaining probability excluding the determined symbol is calculated, and the PMF of the target symbol is determined based on the relationship between the ratio and a preset value.
- the first information, the second information or the third information is obtained based on probability information;
- the probability information includes the value of the cumulative distribution function CDF;
- the value of the CDF is constructed in the following manner: based on a preset order, the value of the CDF of each symbol is determined in turn, wherein the preset order is determined according to the relationship between the values of PMFs corresponding to multiple symbols, and the multiple symbols include the target symbol; wherein, when the probability distribution corresponding to the probability information of the target symbol is a symmetrical distribution, the preset order is an order staggered along both sides of the peak point in the symmetrical distribution; or, when the probability distribution corresponding to the probability information of the target symbol is a discrete distribution, the preset order is specifically an order from large to small; or, when the probability distribution corresponding to the probability information of the target symbol is a discrete distribution, the preset order is specifically an order from small to large.
- the first information in the first mapping relationship is constructed in the following manner: x where C(x) ⁇ s ⁇ (C(x)+P(x)) is used as the first information; wherein C represents the value of CDF, P represents the value of PMF, and s represents the state information.
- the second information in the first mapping relationship is constructed in the following manner: the value of clz(s-C(x)+P(x))+X is used as the second information; wherein, clz represents the number of consecutive bits whose highest bit in the value is 0, and X is a preset fifth value.
- the third information in the first mapping relationship is constructed in the following manner: performing a bit shift operation on the numerical value of s-C(x)+P(x) to obtain the third information, and the shift amount of the bit shift operation is obtained according to the second information; or performing a bit shift operation on the numerical value of s-C(x)+P(x), and subtracting a numerical value M from the operation result of the bit shift operation to obtain the third information, wherein M is the denominator of the quantization probability, and the shift amount of the bit shift operation is obtained according to the second information.
- the "decoding symbol” is the value of x that satisfies C(x) ⁇ s ⁇ C(x)+P(x); the value of the "number of bits read” is clz(s-C(x)+P(x))+m-31; the value of the "state cardinality” is the result of shifting the "number of bits read” left by s-C(x)+P(x), the difference between this and M.
- Table 10 is a schematic diagram of a decoding table obtained using the above method:
- the first information, the second information or the third information represents an integer value, that is, a single integer.
- the first information may represent an integer value
- the second information may represent an integer value
- the third information may represent an integer value.
- the index information in the decoding table only includes symbols
- the mapped objects only include the first information, the second information and the third information, which reduces the memory usage in the encoding table.
- mapping relationships may also be configured for different probability distributions.
- a coding result can be obtained; the coding result is obtained by encoding pixel data of an image, and the status information and the storage bits are obtained based on the coding result; the coding result is processed, and the distribution characteristics of the pixel data include a mean or a variance; based on the distribution characteristics, the first mapping relationship corresponding to the distribution characteristics is determined from multiple mapping relationships.
- FIG. 10B is a schematic diagram of a decoding process.
- the model consists of three parts.
- the first is to decode the header file in the codeword, such as the length and width of the image, some necessary parameters, etc. These parameters can establish the distribution index corresponding to the decoded data (transformed data) for the information in the codeword.
- the second is to predefine several probability distributions (such as Gaussian distribution with different variances, logistic distribution, etc.), and establish corresponding distribution indexes and decoding tables, where the encoding table is established based on the calculated discrete PMF and CDF.
- probability distributions such as Gaussian distribution with different variances, logistic distribution, etc.
- the third is the image decoder, which decodes the transformed data and restores the image.
- the decoder can be a neural network or a post-processing process of image color transformation, such as inverse Fourier transform, YUV to RGB, etc.
- the model is first used to read the basic configuration in the header file, and the necessary distribution index of the decoded data is established according to the codeword.
- the decoded data transformed data
- the corresponding decoding table is found through the distribution index, and the decoded transformed data is obtained by entropy decoding.
- the model is used to restore the transformed data to the original image.
- an integer value corresponding to the state information can be obtained through a first mapping relationship; the integer value is restored to the first information, the second information and the third information, and the first information, the second information and the third information are respectively an integer value.
- decoding symbol For example, "decoding symbol”, "number of read bits” and “state cardinality” can be combined according to the above rules.
- the first information is a target symbol corresponding to the first bit
- the target symbol is a decoding result of the first bit
- the second information indicates the number of bits selected from the stored bits
- the third information is used to perform an addition operation with the bits selected from the stored bits according to the third information
- the addition operation result is used to update the state information
- the updated state information corresponds to the second bit
- the second bit is a bit to be decoded after the first bit.
- the selected bits can be removed from the stored bits to obtain updated stored bits.
- the "decoding symbol”, "read bit number” and “state cardinality” can be obtained by looking up a table according to the current state value; s is updated to: the sum of the number obtained by reading the "read bit number” bits from the storage and the "state cardinality".
- decoding 00101110 (state 001 represents 1, 01110 is a storage bit), and the decoding result is AAABA.
- Subtable 1 For each state s, find the "decoding symbol", the method and result are the same as the above decoding process;
- Subtable 2 For each symbol x, find the "state addend", the method and result are the same as the "state addend" of method 1 described in the above encoding process;
- Subtable 3 (all distributions share one table): For each integer i ⁇ [1,M ⁇ 2-1], find the “number of state bits” as clz(i)+m-31.
- Update state s as follows: subtract the "state addend" from the current value of s, shift left by the number of bits of the "state bit number”, add the value of the "state bit number” read from the storage, and take the modulus of M.
- Table 13 is a schematic diagram of a decoding table obtained using the above method:
- the embodiment of the present application can achieve a shorter compression time. Compared with rANS, the encoding and decoding time is improved by 3-4 times.
- the table memory of the embodiment of the present application is smaller. For the total number of symbols X and the number of states M, if each element of the table is stored with 32 bits, the encoding table size is 4X and the decoding table size is 3M; if compressed to 24 bits for storage, the encoding table size is 3X and the decoding table size is 3M.
- the table memory usage is greatly reduced.
- the first information in the first mapping relationship is constructed in the following manner:
- C1 represents the third value corresponding to CDF
- P1 represents the first value corresponding to PMF
- C2 represents the fourth value corresponding to CDF
- P2 represents the second value corresponding to PMF
- s represents the status information
- the sum of the first value and the second value is the value of PMF.
- the second information in the first mapping relationship is constructed in the following manner:
- clz(s′-C(x)+P(x))+X is used as the second information; wherein clz represents the number of bits whose highest bit is consecutively 0 in the value, X is a preset fifth value, and s′ is obtained as follows:
- the third information in the first mapping relationship is constructed in the following manner: performing a bit shift operation on the value of s′-C(x)+P(x) to obtain the third information, and the shift amount of the bit shift operation is obtained according to the second information.
- Decoding symbol is the value of x that satisfies C1(x) ⁇ s ⁇ C1(x)+P1(x) or C2(x) ⁇ s ⁇ C2(x)+P2(x);
- each decoded symbol may correspond to 1 to 2 consecutive states s.
- A corresponds to 0 to 2, and 4 to 5.
- the "decoded symbol”, “number of read bits”, and “state cardinality” can be obtained by looking up the table according to the current state value s; s is updated to: the sum of the number obtained by reading the "number of read bits” bits from the storage and the "state cardinality";
- the present application also provides a data decoding method, which is applied to a decoder based on an asymmetric digital system ANS, and the method comprises:
- Acquire state information of the decoder where the state information corresponds to a first bit, and the first bit is a bit currently to be decoded;
- state information is the difference between the value M and 1, determining that the decoding result of the first bit is a second symbol, and updating the state information to the result of reading the value M bits from the storage;
- the decoding result of the first bit is determined to be the first symbol; if the status information is 0, the status information is updated to the sum of the difference between the numerical value M and 2 and the value of 1 bit read from the storage; if the status information is not 0, the status information is updated to the difference between the status information and 1; the updated status information corresponds to the second bit, and the second bit is the bit to be decoded after the first bit.
- the above embodiment is an encoding and decoding scheme for a total of two symbols and when the probability of a single symbol is close to 1.
- this embodiment does not need to construct encoding and decoding tables, so no additional memory is required to store the tables. Assuming there are two symbols a and b, and the probability of symbol a is close to 1, the encoding algorithm is as follows:
- Compression symbol a If the state s ⁇ M-2, write s-M+2 (0 or 1) to the storage as 1 bit, and then update s to 0; otherwise, update s to s+1;
- Compress symbol b Write all m bits of s to storage and update s to M-1.
- a data encoding device 1100 provided by an embodiment of the present application includes:
- An acquisition module 1101 is used to acquire a target symbol
- An encoding module 1102 is configured to obtain first information and second information corresponding to the target symbol through a first mapping relationship; the first information and the second information are obtained according to probability information corresponding to the target symbol;
- the state information is updated through a second operation to obtain second coded data
- the first coded data and the second coded data are used to obtain a coding result of the target symbol, and the first operation and the second operation do not include a division operation.
- step 602 For the specific description of the encoding module 1102, reference may be made to the description of step 602 in the above embodiment, which will not be repeated here.
- the first information or the second information represents an integer value.
- the first operation and the second operation do not include a judgment operation.
- the first operation includes:
- a portion of bits is selected from the state information as first coded data, and positions of the portion of bits in the state information are determined according to a shift result of the bit shift operation.
- the second operation includes:
- the probability information includes a quantization probability
- M is a denominator of the quantization probability
- An addition operation is performed on a shift result of the bit shift operation and the second information.
- the probability information includes a value of a probability mass function PMF; the value of the PMF is constructed in the following manner:
- the total value of the remaining PMF excluding the PMF of the determined symbol is multiplied by the probability of the target symbol, and the ratio between the product of the multiplication and the remaining probability excluding the determined symbol is calculated. Based on the relationship between the ratio and a preset fifth value, the PMF of the target symbol is determined.
- the fifth value is 1, and the relationship is to take a larger value.
- the probability information includes a value of a cumulative distribution function CDF; the value of the CDF is constructed in the following manner:
- the preset order is an order staggered along both sides of a peak point in the symmetrical distribution
- the preset order is specifically an order from large to small; or,
- the preset order is specifically an order from small to large.
- the target symbol is obtained by transforming pixel data of an image
- the data obtained by transforming the pixel data of the image satisfies a preset distribution
- the transformation is further used to obtain a distribution feature of the pixel data
- the distribution feature includes a mean or a variance
- the acquisition module is further used to:
- the first mapping relationship corresponding to the distribution feature is determined from a plurality of mapping relationships.
- the multiple distribution features include a first distribution feature and a second distribution feature, and the entropy of the first distribution feature is greater than the entropy of the second distribution feature;
- a value of a denominator of a quantization probability in a mapping relationship corresponding to the second distribution feature is greater than a value of a denominator of a quantization probability in a mapping relationship corresponding to the first distribution feature.
- the first information in the first mapping relationship is constructed in the following manner:
- a bit shift operation is performed on the sum result of the addition operation, and a subtraction operation is performed on the shift result of the bit shift operation and the shift result of the bit shift operation on the numerical value of the PMF of the target symbol, and the operation result of the subtraction operation is added to the numerical value M to obtain the first information, wherein the probability information includes a quantization probability, and M is the denominator of the quantization probability.
- the second information in the first mapping relationship is constructed in the following manner:
- the second information in the first mapping relationship is constructed in the following manner:
- the result of the subtraction operation between the numerical value of the CDF of the target symbol and the numerical value of the PMF of the target symbol is less than 0, the result of the subtraction operation is added to the numerical value M to obtain the second information, where the probability information includes a quantization probability, and M is the denominator of the quantization probability.
- the encoding module is specifically used to:
- the integer value is restored to the first information and the second information, where the first information and the second information are respectively an integer value.
- the probability information includes PMF information corresponding to each symbol, the PMF information includes a first value and a second value; the sum of the first value and the second value is the value of the PMF; the probability information also includes CDF information corresponding to each symbol, the CDF information includes a third value and a fourth value; the third value and the fourth value are constructed in the following manner:
- the fourth value corresponding to each symbol is determined in sequence by accumulation according to the second values and the third values of the plurality of symbols.
- the second information includes first sub-information, second sub-information and third sub-information
- the first sub-information in the first mapping relationship is constructed in the following manner: performing a subtraction operation on the third value of the target symbol and the value of the PMF of the target symbol to obtain the first sub-information;
- the second sub-information in the first mapping relationship is constructed by: performing an addition operation on the third value of the target symbol and the first value of the target symbol, and performing a subtraction operation on the result of the addition operation and 1 to obtain the second sub-information;
- the third sub-information in the first mapping relationship is constructed in the following manner: subtracting the fourth value of the target symbol from the third value of the target symbol, and subtracting the result of the subtraction operation from the first value of the target symbol to obtain the third sub-information.
- the second operation includes:
- An addition operation is performed on the state information and a value M, and a bit shift operation is performed on the addition result of the addition operation; wherein the probability information includes a quantization probability, and M is a denominator of the quantization probability; the shift result of the bit shift operation is The summing operation performed on the first sub-information;
- the operation result of the addition operation is smaller than the second sub-information, the operation result of the addition operation is used as the second encoded data.
- the first information is stored using 10 bits
- the first sub-information is stored using 8 bits
- the second sub-information is stored using 7 bits
- the third sub-information is stored using 7 bits.
- the sum of the first values of multiple symbols is 128, and the third sub-information is less than 128.
- the present application also provides a data encoding device, which is applied to an encoder based on an asymmetric digital system ANS, and the device comprises:
- an acquisition module configured to acquire a first symbol, wherein the sum of a quantization probability corresponding to the first symbol and a quantization probability corresponding to the second symbol is 1, and a difference between the quantization probability corresponding to the first symbol and 1 is less than a threshold, and a difference between the quantization probability corresponding to the second symbol and 0 is less than a threshold;
- An encoding module configured to perform a first operation between the state information and the value M of the encoder to obtain first encoded data, and update the state information to 0 according to a numerical relationship between the state information and the value M of the encoder satisfying a first condition
- the acquisition module is further used to:
- the encoding module is further configured to use the state information of the encoder as the first encoding data, and update the state information to a difference between the value M and 1.
- a data decoding device 1200 provided by an embodiment of the present application includes:
- An acquisition module 1201 is used to acquire state information of the decoder and a storage bit, wherein the state information corresponds to a first bit, and the first bit is a bit currently to be decoded;
- the decoding module 1202 is used to determine the first information, the second information and the third information corresponding to the status information according to the first mapping relationship; the first information is the target symbol corresponding to the first bit, the target symbol is the decoding result of the first bit, the second information represents the number of bits selected from the storage bits, the third information is used to perform an addition operation with the bits selected from the storage bits according to the third information, and the addition operation result is used to update the status information, the updated status information corresponds to the second bit, and the second bit is the bit to be decoded after the first bit.
- decoding module 1202 For the specific description of the decoding module 1202, reference may be made to the description of step 902 in the above embodiment, which will not be repeated here.
- the decoding module is further used to:
- the selected bits are removed from the storage bits to obtain updated storage bits.
- the first information, the second information or the third information represents an integer value.
- the first information in the first mapping relationship is constructed in the following manner:
- C represents the value of CDF
- P represents the value of PMF
- s represents the state information
- C1 represents the third value corresponding to CDF
- P1 represents the first value corresponding to PMF
- C2 represents the fourth value corresponding to CDF
- P2 represents the second value corresponding to PMF
- s represents the status information
- the sum of the first value and the second value is the value of PMF.
- the second information in the first mapping relationship is constructed in the following manner:
- clz(sC(x)+P(x))+X is used as the second information; wherein clz represents the number of consecutive bits of the highest bit in the value being 0, and X is a preset fifth value; or,
- clz(s′-C(x)+P(x))+X is used as the second information; wherein clz represents the number of bits whose highest bit is consecutively 0 in the value, X is a preset fifth value, and s′ is obtained as follows:
- the third information in the first mapping relationship is constructed in the following manner:
- a bit shift operation is performed on the value of s′-C(x)+P(x) to obtain the third information, and the shift amount of the bit shift operation is obtained according to the second information.
- the first information, the second information, or the third information is obtained according to probability information;
- the probability information includes a value of a probability mass function PMF; and the value of the PMF is constructed in the following manner:
- the total value of the remaining PMF excluding the PMF of the determined symbol is multiplied by the probability of the target symbol, and the ratio between the product of the multiplication and the remaining probability excluding the determined symbol is calculated. Based on the relationship between the ratio and the preset value, the PMF of the target symbol is determined.
- the preset value is 1, and the relationship is to take a larger value.
- the first information, the second information or the third information is obtained according to probability information;
- the probability information includes a value of a cumulative distribution function CDF;
- the value of the CDF is constructed in the following manner:
- the preset order is an order staggered along both sides of a peak point in the symmetrical distribution
- the preset order is specifically an order from large to small; or,
- the preset order is specifically an order from small to large.
- the acquisition module is further used to:
- the coding result is obtained by encoding pixel data of an image, and the state information and the storage bit are obtained according to the coding result;
- the distribution characteristics of the pixel data including mean or variance
- the first mapping relationship corresponding to the distribution feature is determined from a plurality of mapping relationships.
- the present application also provides a data decoding device, which is applied to a decoder based on an asymmetric digital system ANS, and the device comprises:
- An acquisition module configured to acquire state information of the decoder, wherein the state information corresponds to a first bit, and the first bit is a bit currently to be decoded;
- a decoding module configured to determine, if the state information is a difference between a value M and 1, that a decoding result of the first bit is a second symbol, and update the state information to a result of reading the value M bits from a storage;
- the decoding result of the first bit is determined to be the first symbol; if the status information is 0, the status information is updated to the sum of the difference between the numerical value M and 2 and the value of 1 bit read from the storage; if the status information is not 0, the status information is updated to the difference between the status information and 1; the updated status information corresponds to the second bit, and the second bit is the bit to be decoded after the first bit.
- Figure 13 is a structural schematic diagram of an execution device provided by an embodiment of the present application.
- the execution device 1300 can be specifically expressed as a mobile phone, a tablet, a laptop computer, an intelligent wearable device, a server, etc., which is not limited here. Among them, the execution device 1300 implements the function of the data encoding and decoding method in the corresponding embodiments of Figures 6 and 9.
- the execution device 1300 includes: a receiver 1301, a transmitter 1302, a processor 1303 and a memory 1304 (wherein the number of processors 1303 in the execution device 1300 can be one or more), wherein the processor 1303 may include an application processor 13031 and a communication processor 13032.
- the receiver 1301, the transmitter 1302, the processor 1303 and the memory 1304 may be connected via a bus or other means.
- the memory 1304 may include a read-only memory and a random access memory, and provides instructions and data to the processor 1303. A portion of the memory 1304 may also include a non-volatile random access memory (NVRAM).
- NVRAM non-volatile random access memory
- the memory 1304 stores processor and operation instructions, executable modules or data structures, or subsets thereof, or extended sets thereof, wherein the operation instructions may include various operation instructions for implementing various operations.
- the processor 1303 controls the operation of the execution device.
- the various components of the execution device are coupled together through a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus, and a status signal bus, etc.
- the bus system includes not only a data bus but also a power bus, a control bus, and a status signal bus, etc.
- various buses are referred to as bus systems in the figure.
- the method disclosed in the above embodiment of the present application can be applied to the processor 1303, or implemented by the processor 1303.
- the processor 1303 can be an integrated circuit chip with signal processing capabilities.
- each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 1303.
- the above processor 1303 can be a general-purpose processor, a digital signal processor (digital signal processing, DSP), a microprocessor or a microcontroller, and a vision processor (vision processing unit, VPU), a tensor processor (tensor processing unit, TPU) and other processors suitable for AI computing, and can further include an application specific integrated circuit (application specific integrated circuit, ASIC), a field programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
- the processor 1303 can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.
- the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
- the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor, or a combination of hardware and software modules in the decoding processor.
- the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc.
- the storage medium is located in the memory 1304, and the processor 1303 reads the information in the memory 1304, and combines its hardware to complete the data encoding and decoding method in the above-mentioned embodiment of Figure 6 and the corresponding embodiment of Figure 9.
- the receiver 1301 can be used to receive input digital or character information and generate signal input related to the relevant settings and function control of the execution device.
- the transmitter 1302 can be used to output digital or character information through the first interface; the transmitter 1302 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; the transmitter 1302 can also include a display device such as a display screen.
- FIG 14 is a schematic diagram of a structure of a server provided by the embodiment of the present application, specifically, the server 1400 is implemented by one or more servers, and the server 1400 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1414 (for example, one or more processors) and memory 1432, one or more storage media 1430 (for example, one or more mass storage devices) storing application programs 1442 or data 1444.
- the memory 1432 and the storage medium 1430 can be short-term storage or permanent storage.
- the program stored in the storage medium 1430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server. Furthermore, the central processor 1414 can be configured to communicate with the storage medium 1430 and execute a series of instruction operations in the storage medium 1430 on the server 1400.
- the server 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input and output interfaces 1458; or, one or more operating systems 1441, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
- operating systems 1441 such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
- the server may perform the steps related to model training in the above embodiments.
- the present application also provides a computer program product which, when executed on a computer, enables the computer to execute the steps in FIG. And the data encoding and decoding method in the embodiment corresponding to FIG. 9 .
- a computer-readable storage medium is also provided in an embodiment of the present application.
- the computer-readable storage medium stores a program for signal processing.
- the program When the program is run on a computer, the computer executes the data encoding and decoding method in the corresponding embodiments of Figures 6 and 9.
- the execution device, training device or terminal device provided in the embodiments of the present application may specifically be a chip, and the chip includes: a processing unit and a communication unit, wherein the processing unit may be, for example, a processor, and the communication unit may be, for example, an input/output interface, a pin or a circuit, etc.
- the processing unit may execute the computer execution instructions stored in the storage unit so that the chip in the execution device executes the data processing method described in the above embodiment, or so that the chip in the training device executes the data processing method described in the above embodiment.
- the storage unit is a storage unit in the chip, such as a register, a cache, etc.
- the storage unit may also be a storage unit located outside the chip in the wireless access device end, such as a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM), etc.
- ROM read-only memory
- RAM random access memory
- FIG. 15 is a schematic diagram of a structure of a chip provided in an embodiment of the present application.
- the chip can be expressed as a neural network processor NPU 1500.
- NPU 1500 is mounted on the host CPU (Host CPU) as a coprocessor, and tasks are assigned by the Host CPU.
- the core part of the NPU is the operation circuit 1503, which is controlled by the controller 1504 to extract matrix data from the memory and perform multiplication operations.
- NPU 1500 can implement the data encoding and decoding methods in the corresponding embodiments of Figures 6 and 9 through the mutual cooperation between various internal devices.
- the operation circuit 1503 in the NPU 1500 includes multiple processing units (Process Engine, PE) inside.
- the operation circuit 1503 is a two-dimensional systolic array.
- the operation circuit 1503 can also be a one-dimensional systolic array or other electronic circuits capable of performing mathematical operations such as multiplication and addition.
- the operation circuit 1503 is a general-purpose matrix processor.
- the operation circuit takes the corresponding data of matrix B from the weight memory 1502 and caches it on each PE in the operation circuit.
- the operation circuit takes the matrix A data from the input memory 1501 and performs matrix operation with matrix B, and the partial result or final result of the matrix is stored in the accumulator 1508.
- Unified memory 1506 is used to store input data and output data. Weight data is directly transferred to weight memory 1502 through Direct Memory Access Controller (DMAC) 1505. Input data is also transferred to unified memory 1506 through DMAC.
- DMAC Direct Memory Access Controller
- BIU stands for Bus Interface Unit, that is, the bus interface unit 1510, which is used for the interaction between AXI bus and DMAC and instruction fetch buffer (IFB) 1509.
- IOB instruction fetch buffer
- the bus interface unit 1510 (Bus Interface Unit, BIU for short) is used for the instruction fetch memory 1509 to obtain instructions from the external memory, and is also used for the storage unit access controller 1505 to obtain the original data of the input matrix A or the weight matrix B from the external memory.
- BIU Bus Interface Unit
- DMAC is mainly used to transfer input data in the external memory DDR to the unified memory 1506 or to transfer weight data to the weight memory 1502 or to transfer input data to the input memory 1501.
- the vector calculation unit 1507 includes multiple operation processing units, which further process the output of the operation circuit 1503 when necessary, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc. It is mainly used for non-convolutional/fully connected layer network calculations in neural networks, such as Batch Normalization, pixel-level summation, upsampling of feature planes, etc.
- the vector calculation unit 1507 can store the processed output vector to the unified memory 1506.
- the vector calculation unit 1507 can apply a linear function; or a nonlinear function to the output of the operation circuit 1503, such as linear interpolation of the feature plane extracted by the convolution layer, and then, for example, a vector of accumulated values to generate an activation value.
- the vector calculation unit 1507 generates a normalized value, a pixel-level summed value, or both.
- the processed output vector can be used as an activation input to the operation circuit 1503, for example, for use in a subsequent layer in a neural network.
- An instruction fetch buffer 1509 connected to the controller 1504 is used to store instructions used by the controller 1504;
- Unified memory 1506, input memory 1501, weight memory 1502 and instruction fetch memory 1509 are all on-chip memories. External memories are private to the NPU hardware architecture.
- the processor mentioned in any of the above places can be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more An integrated circuit for controlling the execution of the above program.
- the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.
- the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
- the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
- a computer device which can be a personal computer, a training device, or a network device, etc.
- all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof.
- all or part of the embodiments may be implemented in the form of a computer program product.
- the computer program product includes one or more computer instructions.
- the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
- the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
- the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center.
- the computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations.
- the available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
- a magnetic medium e.g., a floppy disk, a hard disk, a tape
- an optical medium e.g., a DVD
- a semiconductor medium e.g., a solid-state drive (SSD)
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
- Error Detection And Correction (AREA)
Abstract
Description
Claims (68)
- 一种数据编码方法,其特征在于,应用于基于非对称数字系统ANS的编码器,所述方法包括:获取目标符号;通过第一映射关系,得到所述目标符号对应的第一信息和第二信息;所述第一信息和所述第二信息为根据所述目标符号对应的概率信息得到;根据所述第一信息以及所述编码器的状态信息,通过第一运算,得到第一编码数据;根据所述第二信息,通过第二运算,更新所述状态信息,得到第二编码数据;其中,所述第一编码数据和所述第二编码数据用于得到所述目标符号的编码结果,且所述第一运算和所述第二运算不包括除法运算。
- 根据权利要求1所述的方法,其特征在于,所述第一信息或所述第二信息表示一个整数数值。
- 根据权利要求1或2所述的方法,其特征在于,所述第一运算和所述第二运算不包括判断运算。
- 根据权利要求1至3任一所述的方法,其特征在于,所述第一运算包括:对所述第一信息与所述状态信息进行的加和操作,以及对所述加和操作的加和结果进行的比特移位操作;从所述状态信息中选择部分比特作为第一编码数据,所述部分比特在所述状态信息中的位置为根据所述比特移位操作的移位结果确定。
- 根据权利要求1至4任一所述的方法,其特征在于,所述第二运算包括:对所述状态信息与数值M进行的加和操作,以及对所述加和操作的加和结果进行的比特移位操作;其中,所述概率信息包括量化概率,所述M为所述量化概率的分母;对所述比特移位操作的移位结果与所述第二信息进行的加和操作;或者,在所述状态信息初始化为所述M的情况下,对所述状态信息进行的比特移位操作;对所述比特移位操作的移位结果与所述第二信息进行的加和操作;对所述加和操作的加和结果与所述M进行减法运算。
- 根据权利要求1至5任一所述的方法,其特征在于,所述概率信息包括概率质量函数PMF的数值;所述PMF的数值为通过如下方式构建的:依次确定多个符号中每个符号的PMF的数值,所述多个符号包括所述目标符号;其中,在确定所述目标符号的PMF的数值时,将除去已确定的符号的PMF之外的剩余PMF的总数值与所述目标符号的概率进行乘积,并计算所述乘积的乘积结果与除去已确定的符号的剩余概率之间的比值,根据所述比值与预设的第五数值之间的关系,确定所述目标符号的PMF。
- 根据权利要求6所述的方法,其特征在于,所述第一数值为1,所述关系为取较大值。
- 根据权利要求1至7任一所述的方法,其特征在于,所述概率信息包括累积分布函数CDF的数值;所述CDF的数值为通过如下方式构建的:基于预设顺序,依次确定每个符号的CDF的数值,其中所述预设顺序为根据多个符号对应的PMF的数值之间的关系确定,所述多个符号包括所述目标符号;其中,在所述目标符号的概率信息对应的概率分布为对称分布时,所述预设顺序为沿着所述对称分布中峰值点的两侧相交错的顺序;或者,在所述目标符号的概率信息对应的概率分布为离散分布时,所述预设顺序具体为从大到小的顺序;或者,在所述目标符号的概率信息对应的概率分布为离散分布时,所述预设顺序具体为从小到大的顺序。
- 根据权利要求1至8任一所述的方法,其特征在于,所述目标符号为对图像的像素数据进行变换得到,所述对图像的像素数据进行变换得到的数据满足预设分布,所述变换还用于得到所述像素数据的分布特征,所述分布特征包括均值或方差,所述方法还包括:根据所述分布特征,从多个映射关系中确定与所述分布特征对应的所述第一映射关系。
- 根据权利要求9所述的方法,其特征在于,所述多个分布特征包括第一分布特征和第二分布特征,所述第一分布特征的熵大于所述第二分布特征的熵;所述第二分布特征对应的映射关系中的量化概率的分母的数值大于所述第一分布特征对应的映射关系中的量化概率的分母。
- 根据权利要求1至10任一所述的方法,其特征在于,所述第一映射关系中的所述第一信息为通过如下方式构建的:将所述目标符号的PMF的数值中最高位连续为0的比特数量与预设的第六数值的加和运算;将所述加和运算的加和结果进行比特移位操作,并将所述比特移位操作的移位结果与对所述目标符号的PMF的数值进行比特移位操作的移位结果进行减法操作,得到所述第一信息;或者,将所述加和运算的加和结果进行比特移位操作,并将所述比特移位操作的移位结果与对所述目标符号的PMF的数值进行比特移位操作的移位结果进行减法操作,将所述减法操作的操作结果与数值M进行加和操作,得到所述第一信息,所述概率信息包括量化概率,所述M为所述量化概率的分母。
- 根据权利要求1至11任一所述的方法,其特征在于,所述第一映射关系中的所述第二信息为通过如下方式构建的:将所述目标符号的CDF的数值和所述目标符号的PMF的数值进行减法运算,得到所述第二信息;或者,将所述目标符号的CDF的数值和所述目标符号的PMF的数值进行减法运算,将所述减法操作的操作结果与数值M进行加和操作,得到所述第二信息,所述概率信息包括量化概率,所述M为所述量化概率的分母。
- 根据权利要求1至11任一所述的方法,其特征在于,所述第一映射关系中的所述第二信息为通过如下方式构建的:在所述目标符号的CDF的数值和所述目标符号的PMF的数值的减法运算的结果大于或等于0时,将所述减法运算的结果作为所述第二信息;或者,在所述目标符号的CDF的数值和所述目标符号的PMF的数值的减法运算的结果小于0时,将所述减法操作的操作结果与数值M进行加和操作,得到所述第二信息,所述概率信息包括量化概率,所述M为所述量化概率的分母。
- 根据权利要求1至13任一所述的方法,其特征在于,所述通过第一映射关系,得到所述目标符号对应的第一信息和第二信息,包括:通过第一映射关系,得到所述目标符号对应的一个整数数值;基于第三运算,将所述整数数值还原为所述第一信息和所述第二信息,所述第一信息和所述第二信息分别为一个整数数值。
- 根据权利要求1至14任一所述的方法,其特征在于,所述概率信息包括每个符号对应的PMF信息,所述PMF信息包括第一数值和第二数值;所述第一数值和所述第二数值的加和为所述PMF的数值;所述概率信息还包括每个符号对应的CDF信息,所述CDF信息包括第三数值和第四数值;所述第三数值和第四数值为通过如下方式构建的:基于预设顺序,根据多个符号的第一数值,通过累加依次确定每个符号的对应的第三数值;基于所述预设顺序,根据多个符号的第二数值和第三数值,通过累加依次确定每个符号对应的第四数值。
- 根据权利要求15所述的方法,其特征在于,所述第二信息包括第一子信息、第二子信息和第三子信息;所述第一映射关系中的所述第一子信息为通过如下方式构建的:将所述目标符号的第三数值和所述目标符号的PMF的数值进行减法运算,得到所述第一子信息;所述第一映射关系中的所述第二子信息为通过如下方式构建的:将所述目标符号的第三数值和所述目标符号的第一数值进行加法运算,将所述加法运算的操作结果与1进行减法操作,得到所述第二子信息;所述第一映射关系中的所述第三子信息为通过如下方式构建的:将所述目标符号的第四数值和所述目标符号的第三数值进行减法运算,将所述减法运算的操作结果与所述目标符号的第一数值进行减法操作,得到所述第三子信息。
- 根据权利要求16所述的方法,其特征在于,所述第二运算包括:对所述状态信息与数值M进行的加和操作,以及对所述加和操作的加和结果进行的比特移位操作;其中,所述概率信息包括量化概率,所述M为所述量化概率的分母;对所述比特移位操作的移位结果与所述第一子信息进行的加和操作;在所述加和操作的操作结果大于所述第二子信息时,将所述加和操作的操作结果与所述第三子信息的加和结果作为所述第二编码数据;在所述加和操作的操作结果小于所述第二子信息时,将所述加和操作的操作结果作为所述第二编码数据。
- 根据权利要求16或17所述的方法,其特征在于,在所述数值M为256时,所述第一信息通过10比特存储,所述第一子信息通过8比特存储,所述第二子信息通过7比特存储,所述第三子信息通过7比特存储,多个符号的第一数值的加和为128,所述第三子信息小于128。
- 一种数据编码方法,其特征在于,应用于基于非对称数字系统ANS的编码器,所述方法包括:获取第一符号,所述第一符号对应的量化概率和第二符号对应的量化概率的和为1,且所述第一符号对应的量化概率和1的差异小于阈值,所述第二符号对应的量化概率和0的差异小于阈值;根据所述编码器的状态信息和数值M之间的数值大小关系满足第一条件,将所述状态信息和所述数值M之间进行第一运算,得到第一编码数据,并将所述状态信息更新为0;根据所述编码器的状态信息和数值M之间的数值大小关系不满足所述第一条件,将所述状态信息加1。
- 根据权利要求19所述的方法,其特征在于,所述方法还包括:获取所述第二符号;将所述编码器的状态信息作为第一编码数据,并将所述状态信息更新为所述数值M与1的差值。
- 一种数据解码方法,其特征在于,应用于基于非对称数字系统ANS的解码器,所述方法包括:获取所述解码器的状态信息以及存储比特,所述状态信息与第一比特相对应,所述第一比特为当前待解码的比特;根据第一映射关系,确定所述状态信息对应的第一信息、第二信息以及第三信息;所述第一信息为所述第一比特对应的目标符号,所述目标符号为所述第一比特的解码结果,所述第二信息表示从所述存储比特中选择的比特位数,所述第三信息用于和根据所述第三信息从所述存储比特中选择的比特进行加和运算,所述加和运算结果用于更新所述状态信息,更新后的状态信息与第二比特相对应,所述第二比 特为所述第一比特之后的待解码比特。
- 根据权利要求21所述的方法,其特征在于,所述方法还包括:从所述存储比特中剔除根据所述选择的比特,得到更新后的存储比特。
- 根据权利要求21或22所述的方法,其特征在于,所述第一信息、所述第二信息或所述第三信息表示一个整数数值。
- 根据权利要求21至23任一所述的方法,其特征在于,所述第一映射关系中的所述第一信息为通过如下方式构建的:将满足C(x)≤s<(C(x)+P(x))的x作为所述第一信息;其中,所述C表示CDF的数值,所述P表示PMF的数值,所述s表示所述状态信息。
- 根据权利要求21至23任一所述的方法,其特征在于,所述第一映射关系中的所述第一信息为通过如下方式构建的:将满足C1(x)≤s<C1(x)+P1(x)或C2(x)≤s<C2(x)+P2(x)的x作为所述第一信息;其中,所述C1表示CDF对应的第三数值,所述P1表示PMF对应的第一数值,所述C2表示CDF对应的第四数值,所述P2表示PMF对应的第二数值,所述s表示所述状态信息;所述第一数值和所述第二数值的加和为所述PMF的数值。
- 根据权利要求21至25任一所述的方法,其特征在于,所述第一映射关系中的所述第二信息为通过如下方式构建的:将clz(s-C(x)+P(x))+X的数值作为所述第二信息;其中,所述clz表示取数值中最高位连续为0的比特数量,所述X为预设的第五数值。
- 根据权利要求21至25任一所述的方法,其特征在于,所述第一映射关系中的所述第二信息为通过如下方式构建的:将clz(s′-C(x)+P(x))+X的数值作为所述第二信息;其中,所述clz表示取数值中最高位连续为0的比特数量,所述X为预设的第五数值,所述s′为通过如下得到:若C2(x)≤s,则s’=P1(x)+s-C2(x)+P(x),否则s’=s-C1(x)+P(x)。
- 根据权利要求21至27任一所述的方法,其特征在于,所述第一映射关系中的所述第三信息为通过如下方式构建的:将s-C(x)+P(x)的数值进行比特移位操作,得到所述第三信息,所述比特移位操作的移位数量为根据所述第二信息得到;或者,将s-C(x)+P(x)的数值进行比特移位操作,并将所述比特移位操作的操作结果减去数值M,得到所述第三信息,所述M为所述量化概率的分母,所述比特移位操作的移位数量为根据所述第二信息得到;或者,将s′-C(x)+P(x)的数值进行比特移位操作,得到所述第三信息,所述比特移位操作的移位数量为根据所述第二信息得到。
- 根据权利要求21至28任一所述的方法,其特征在于,所述第一信息、所述第二信息或所述第三信息为根据概率信息得到;所述概率信息包括概率质量函数PMF的数值;所述PMF的数值为通过如下方式构建的:依次确定多个符号中每个符号的PMF的数值,所述多个符号包括所述目标符号;其中,在确定所述目标符号的PMF的数值时,将除去已确定的符号的PMF之外的剩余PMF的总数值与所述 目标符号的概率进行乘积,并计算所述乘积的乘积结果与除去已确定的符号的剩余概率之间的比值,根据所述比值与预设数值之间的关系,确定所述目标符号的PMF。
- 根据权利要求21至29任一所述的方法,其特征在于,所述第一信息、所述第二信息或所述第三信息为根据概率信息得到;所述概率信息包括累积分布函数CDF的数值;所述CDF的数值为通过如下方式构建的:基于预设顺序,依次确定每个符号的CDF的数值,其中所述预设顺序为根据多个符号对应的PMF的数值之间的关系确定,所述多个符号包括所述目标符号;其中,在所述目标符号的概率信息对应的概率分布为对称分布时,所述预设顺序为沿着所述对称分布中峰值点的两侧相交错的顺序;或者,在所述目标符号的概率信息对应的概率分布为离散分布时,所述预设顺序具体为从大到小的顺序;或者,在所述目标符号的概率信息对应的概率分布为离散分布时,所述预设顺序具体为从小到大的顺序。
- 根据权利要求21至30任一所述的方法,其特征在于,所述方法还包括:获取编码结果;所述编码结果为对图像的像素数据进行编码得到的,所述状态信息以及所述存储比特为根据所述编码结果得到;对所述编码结果进行处理,所述像素数据的分布特征,所述分布特征包括均值或方差;根据所述分布特征,从多个映射关系中确定与所述分布特征对应的所述第一映射关系。
- 根据权利要求21至31任一所述的方法,其特征在于,所述根据第一映射关系,确定所述状态信息对应的第一信息、第二信息以及第三信息,包括:通过第一映射关系,得到所述状态信息对应的一个整数数值;将所述整数数值还原为所述第一信息、所述第二信息和所述第三信息,所述第一信息、所述第二信息和所述第三信息分别为一个整数数值。
- 一种数据解码方法,其特征在于,应用于基于非对称数字系统ANS的解码器,所述方法包括:获取所述解码器的状态信息,所述状态信息与第一比特相对应,所述第一比特为当前待解码的比特;若所述状态信息为数值M与1的差值,则确定所述第一比特的解码结果为第二符号,并将所述状态信息更新为从存储中读取所述数值M位的结果;若所述状态信息不为数值M与1的差值,则确定所述第一比特的解码结果为第一符号,若所述状态信息为0,则将所述状态信息更新为所述数值M与2的差值与从存储中读出1个比特的值的加和结果;若所述状态信息不为0,则将所述状态信息更新为所述状态信息与1的差值;更新后的状态信息与第二比特相对应,所述第二比特为所述第一比特之后的待解码比特。
- 一种数据编码装置,其特征在于,应用于基于非对称数字系统ANS的编码器,所述装置包括:获取模块,用于获取目标符号;编码模块,用于通过第一映射关系,得到所述目标符号对应的第一信息和第二信息;所述第一信息和所述第二信息为根据所述目标符号对应的概率信息得到;根据所述第一信息以及所述编码器的状态信息,通过第一运算,得到第一编码数据;根据所述第二信息,通过第二运算,更新所述状态信息,得到第二编码数据;其中,所述第一编码数据和所述第二编码数据用于得到所述目标符号的编码结果,且所述第一运算和所述第二运算不包括除法运算。
- 根据权利要求34所述的装置,其特征在于,所述第一信息或所述第二信息表示一个整数数值。
- 根据权利要求34或35所述的装置,其特征在于,所述第一运算和所述第二运算不包括判断运算。
- 根据权利要求34至36任一所述的装置,其特征在于,所述第一运算包括:对所述第一信息与所述状态信息进行的加和操作,以及对所述加和操作的加和结果进行的比特移位操作;从所述状态信息中选择部分比特作为第一编码数据,所述部分比特在所述状态信息中的位置为根据所述比特移位操作的移位结果确定。
- 根据权利要求34至37任一所述的装置,其特征在于,所述第二运算包括:对所述状态信息与数值M进行的加和操作,以及对所述加和操作的加和结果进行的比特移位操作;其中,所述概率信息包括量化概率,所述M为所述量化概率的分母;对所述比特移位操作的移位结果与所述第二信息进行的加和操作。
- 根据权利要求34至38任一所述的装置,其特征在于,所述概率信息包括概率质量函数PMF的数值;所述PMF的数值为通过如下方式构建的:依次确定多个符号中每个符号的PMF的数值,所述多个符号包括所述目标符号;其中,在确定所述目标符号的PMF的数值时,将除去已确定的符号的PMF之外的剩余PMF的总数值与所述目标符号的概率进行乘积,并计算所述乘积的乘积结果与除去已确定的符号的剩余概率之间的比值,根据所述比值与预设的第五数值之间的关系,确定所述目标符号的PMF。
- 根据权利要求39所述的装置,其特征在于,所述第五数值为1,所述关系为取较大值。
- 根据权利要求34至40任一所述的装置,其特征在于,所述概率信息包括累积分布函数CDF的数值;所述CDF的数值为通过如下方式构建的:基于预设顺序,依次确定每个符号的CDF的数值,其中所述预设顺序为根据多个符号对应的PMF的数值之间的关系确定,所述多个符号包括所述目标符号;其中,在所述目标符号的概率信息对应的概率分布为对称分布时,所述预设顺序为沿着所述对称分布中峰值点的两侧相交错的顺序;或者,在所述目标符号的概率信息对应的概率分布为离散分布时,所述预设顺序具体为从大到小的顺序;或者,在所述目标符号的概率信息对应的概率分布为离散分布时,所述预设顺序具体为从小到大的顺序。
- 根据权利要求34至41任一所述的装置,其特征在于,所述目标符号为对图像的像素数据进行变换得到,所述对图像的像素数据进行变换得到的数据满足预设分布,所述变换还用于得到所述像素数据的分布特征,所述分布特征包括均值或方差,所述获取模块,还用于:根据所述分布特征,从多个映射关系中确定与所述分布特征对应的所述第一映射关系。
- 根据权利要求42所述的装置,其特征在于,所述多个分布特征包括第一分布特征和第二分布特征,所述第一分布特征的熵大于所述第二分布特征的熵;所述第二分布特征对应的映射关系中的量化概率的分母的数值大于所述第一分布特征对应的映射关系中的量化概率的分母。
- 根据权利要求34至43任一所述的装置,其特征在于,所述第一映射关系中的所述第一信息为通过如下方式构建的:将所述目标符号的PMF的数值中最高位连续为0的比特数量与预设的第六数值的加和运算;将所述加和运算的加和结果进行比特移位操作,并将所述比特移位操作的移位结果与对所述目标符号的PMF的数值进行比特移位操作的移位结果进行减法操作,得到所述第一信息;或者,将所述加和运算的加和结果进行比特移位操作,并将所述比特移位操作的移位结果与对所述目标符号的PMF的数值进行比特移位操作的移位结果进行减法操作,将所述减法操作的操作结果与数值M进行加和操作,得到所述第一信息,所述概率信息包括量化概率,所述M为所述量化概率的分母。
- 根据权利要求34至44任一所述的装置,其特征在于,所述第一映射关系中的所述第二信息为通过如下方式构建的:将所述目标符号的CDF的数值和所述目标符号的PMF的数值进行减法运算,得到所述第二信息;或者,将所述目标符号的CDF的数值和所述目标符号的PMF的数值进行减法运算,将所述减法操作的操作结果与数值M进行加和操作,得到所述第二信息,所述概率信息包括量化概率,所述M为所述量化概率的分母。
- 根据权利要求34至44任一所述的装置,其特征在于,所述第一映射关系中的所述第二信息为通过如下方式构建的:在所述目标符号的CDF的数值和所述目标符号的PMF的数值的减法运算的结果大于或等于0时,将所述减法运算的结果作为所述第二信息;或者,在所述目标符号的CDF的数值和所述目标符号的PMF的数值的减法运算的结果小于0时,将所述减法操作的操作结果与数值M进行加和操作,得到所述第二信息,所述概率信息包括量化概率,所述M为所述量化概率的分母。
- 根据权利要求34至46任一所述的装置,其特征在于,所述编码模块,具体用于:通过第一映射关系,得到所述目标符号对应的一个整数数值;基于第三运算,将所述整数数值还原为所述第一信息和所述第二信息,所述第一信息和所述第二信息分别为一个整数数值。
- 根据权利要求34至47任一所述的装置,其特征在于,所述概率信息包括每个符号对应的PMF信息,所述PMF信息包括第一数值和第二数值;所述第一数值和所述第二数值的加和为所述PMF的数值;所述概率信息还包括每个符号对应的CDF信息,所述CDF信息包括第三数值和第四数值;所述第三数值和第四数值为通过如下方式构建的:基于预设顺序,根据多个符号的第一数值,通过累加依次确定每个符号的对应的第三数值;基于所述预设顺序,根据多个符号的第二数值和第三数值,通过累加依次确定每个符号对应的第四数值。
- 根据权利要求48所述的装置,其特征在于,所述第二信息包括第一子信息、第二子信息和第三子信息;所述第一映射关系中的所述第一子信息为通过如下方式构建的:将所述目标符号的第三数值和所述目标符号的PMF的数值进行减法运算,得到所述第一子信息;所述第一映射关系中的所述第二子信息为通过如下方式构建的:将所述目标符号的第三数值和所述目标符号的第一数值进行加法运算,将所述加法运算的操作结果与1进行减法操作,得到所述第二子信息;所述第一映射关系中的所述第三子信息为通过如下方式构建的:将所述目标符号的第四数值和所述目标符号的第三数值进行减法运算,将所述减法运算的操作结果与所述目标符号的第一数值进行减法操作,得到所述第三子信息。
- 根据权利要求49所述的装置,其特征在于,所述第二运算包括:对所述状态信息与数值M进行的加和操作,以及对所述加和操作的加和结果进行的比特移位操作;其中,所述概率信息包括量化概率,所述M为所述量化概率的分母;对所述比特移位操作的移位结果与所述第一子信息进行的加和操作;在所述加和操作的操作结果大于所述第二子信息时,将所述加和操作的操作结果与所述第三子信息的加和结果作为所述第二编码数据;在所述加和操作的操作结果小于所述第二子信息时,将所述加和操作的操作结果作为所述第二编码数据。
- 根据权利要求49或50所述的装置,其特征在于,在所述数值M为256时,所述第一信息通过10比特存储,所述第一子信息通过8比特存储,所述第二子信息通过7比特存储,所述第三子信息通过7比特存储,多个符号的第一数值的加和为128,所述第三子信息小于128。
- 一种数据编码装置,其特征在于,应用于基于非对称数字系统ANS的编码器,所述装置包括:获取模块,用于获取第一符号,所述第一符号对应的量化概率和第二符号对应的量化概率的和为1,且所述第一符号对应的量化概率和1的差异小于阈值,所述第二符号对应的量化概率和0的差异小于阈值;编码模块,用于根据所述编码器的状态信息和数值M之间的数值大小关系满足第一条件,将所述状态信息和所述数值M之间进行第一运算,得到第一编码数据,并将所述状态信息更新为0;根据所述编码器的状态信息和数值M之间的数值大小关系不满足所述第一条件,将所述状态信息加1。
- 根据权利要求52所述的装置,其特征在于,所述获取模块,还用于:获取所述第二符号;所述编码模块,还用于将所述编码器的状态信息作为第一编码数据,并将所述状态信息更新为所述数值M与1的差值。
- 一种数据解码装置,其特征在于,应用于基于非对称数字系统ANS的解码器,所述装置包括:获取模块,用于获取所述解码器的状态信息以及存储比特,所述状态信息与第一比特相对应,所述第一比特为当前待解码的比特;解码模块,用于根据第一映射关系,确定所述状态信息对应的第一信息、第二信息以及第三信息;所述第一信息为所述第一比特对应的目标符号,所述目标符号为所述第一比特的解码结果,所述第二信息表示从所述存储比特中选择的比特位数,所述第三信息用于和根据所述第三信息从所述存储比特中选择的比特进行加和运算,所述加和运算结果用于更新所述状态信息,更新后的状态信息与第二比特相对应,所述第二比特为所述第一比特之后的待解码比特。
- 根据权利要求54所述的装置,其特征在于,所述解码模块,还用于:从所述存储比特中剔除根据所述选择的比特,得到更新后的存储比特。
- 根据权利要求54或55所述的装置,其特征在于,所述第一信息、所述第二信息或所述第三信息表示一个整数数值。
- 根据权利要求54至56任一所述的装置,其特征在于,所述第一映射关系中的所述第一信息为通过如下方式构建的:将满足C(x)≤s<(C(x)+P(x))的x作为所述第一信息;其中,所述C表示CDF的数值,所述P表示PMF的数值,所述s表示所述状态信息;或者,将满足C1(x)≤s<C1(x)+P1(x)或C2(x)≤s<C2(x)+P2(x)的x作为所述第一信息;其中,所述C1表示CDF对应的第三数值,所述P1表示PMF对应的第一数值,所述C2表示CDF对应的第四数值,所述P2表示PMF对应的第二数值,所述s表示所述状态信息;所述第一数值和所述第二数值的加和为所述PMF的数值。
- 根据权利要求54至57任一所述的装置,其特征在于,所述第一映射关系中的所述第二信息为通过如下方式构建的:将clz(s-C(x)+P(x))+X的数值作为所述第二信息;其中,所述clz表示取数值中最高位连续为0的比特数量,所述X为预设的第五数值;或者,将s-C(x)+P(x)的数值进行比特移位操作,得到所述第三信息,所述比特移位操作的移位数量为根据所述第二信息得到;或者,将s-C(x)+P(x)的数值进行比特移位操作,并将所述比特移位操作的操作结果减去数值M,得到所述第三信息,所述M为所述量化概率的分母,所述比特移位操作的移位数量为根据所述第二信息得到;或者,将clz(s′-C(x)+P(x))+X的数值作为所述第二信息;其中,所述clz表示取数值中最高位连续为0的比特数量,所述X为预设的第五数值,所述s′为通过如下得到:若C2(x)≤s,则s’=P1(x)+s-C2(x)+P(x),否则s’=s-C1(x)+P(x)。
- 根据权利要求54至58任一所述的装置,其特征在于,所述第一映射关系中的所述第三信息为通过如下方式构建的:将s-C(x)+P(x)的数值进行比特移位操作,得到所述第三信息,所述比特移位操作的移位数量为根据所述第二信息得到;或者,将s-C(x)+P(x)的数值进行比特移位操作,并将所述比特移位操作的操作结果减去数值M,得到所述第三信息,所述M为所述量化概率的分母,所述比特移位操作的移位数量为根据所述第二信息得到;或者,将s′-C(x)+P(x)的数值进行比特移位操作,得到所述第三信息,所述比特移位操作的移位数量为根据所述第二信息得到。
- 根据权利要求54至59任一所述的装置,其特征在于,所述第一信息、所述第二信息或所述第三信息为根据概率信息得到;所述概率信息包括概率质量函数PMF的数值;所述PMF的数值为通过如下方式构建的:依次确定多个符号中每个符号的PMF的数值,所述多个符号包括所述目标符号;其中,在确定所述目标符号的PMF的数值时,将除去已确定的符号的PMF之外的剩余PMF的总数值与所述目标符号的概率进行乘积,并计算所述乘积的乘积结果与除去已确定的符号的剩余概率之间的比值,根据所述比值与预设数值之间的关系,确定所述目标符号的PMF。
- 根据权利要求60所述的装置,其特征在于,所述预设数值为1,所述关系为取较大值。
- 根据权利要求54至61任一所述的装置,其特征在于,所述第一信息、所述第二信息或所述第三信息为根据概率信息得到;所述概率信息包括累积分布函数CDF的数值;所述CDF的数值为通过如下方式构建的:基于预设顺序,依次确定每个符号的CDF的数值,其中所述预设顺序为根据多个符号对应的PMF的数值之间的关系确定,所述多个符号包括所述目标符号;其中,在所述目标符号的概率信息对应的概率分布为对称分布时,所述预设顺序为沿着所述对称分布中峰值点的两侧相交错的顺序;或者,在所述目标符号的概率信息对应的概率分布为离散分布时,所述预设顺序具体为从大到小的顺序; 或者,在所述目标符号的概率信息对应的概率分布为离散分布时,所述预设顺序具体为从小到大的顺序。
- 根据权利要求54至62任一所述的装置,其特征在于,所述获取模块,还用于:获取编码结果;所述编码结果为对图像的像素数据进行编码得到的,所述状态信息以及所述存储比特为根据所述编码结果得到;对所述编码结果进行处理,所述像素数据的分布特征,所述分布特征包括均值或方差;根据所述分布特征,从多个映射关系中确定与所述分布特征对应的所述第一映射关系。
- 根据权利要求54至63任一所述的装置,其特征在于,所述解码模块,具体用于:通过第一映射关系,得到所述状态信息对应的一个整数数值;将所述整数数值还原为所述第一信息、所述第二信息和所述第三信息,所述第一信息、所述第二信息和所述第三信息分别为一个整数数值。
- 一种数据解码装置,其特征在于,应用于基于非对称数字系统ANS的解码器,所述装置包括:获取模块,用于获取所述解码器的状态信息,所述状态信息与第一比特相对应,所述第一比特为当前待解码的比特;解码模块,用于若所述状态信息为数值M与1的差值,则确定所述第一比特的解码结果为第二符号,并将所述状态信息更新为从存储中读取所述数值M位的结果;若所述状态信息不为数值M与1的差值,则确定所述第一比特的解码结果为第一符号,若所述状态信息为0,则将所述状态信息更新为所述数值M与2的差值与从存储中读出1个比特的值的加和结果;若所述状态信息不为0,则将所述状态信息更新为所述状态信息与1的差值;更新后的状态信息与第二比特相对应,所述第二比特为所述第一比特之后的待解码比特。
- 一种计算设备,其特征在于,所述计算设备包括存储器和处理器;所述存储器存储有代码,所述处理器被配置为获取所述代码,并执行如权利要求1至33任一所述的方法。
- 一种计算机存储介质,其特征在于,所述计算机存储介质存储有一个或多个指令,所述指令在由一个或多个计算机执行时使得所述一个或多个计算机实施权利要求1至33任一所述的方法。
- 一种计算机程序产品,包括代码,其特征在于,在所述代码被执行时用于实现如权利要求1至33任一所述的方法。
Priority Applications (5)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| EP24741236.4A EP4637150A4 (en) | 2023-01-09 | 2024-01-09 | DATA ENCODING METHOD, DATA DECODING METHOD AND ASSOCIATED DEVICES |
| KR1020257025879A KR20250134629A (ko) | 2023-01-09 | 2024-01-09 | 데이터 인코딩 방법, 데이터 디코딩 방법, 및 관련 장치들 |
| JP2025540186A JP2026503281A (ja) | 2023-01-09 | 2024-01-09 | データ符号化方法、データ復号方法、及び関連装置 |
| US19/262,813 US20250358456A1 (en) | 2023-01-09 | 2025-07-08 | Data Encoding Method, Data Decoding Method, and Related Apparatus |
| MX2025008015A MX2025008015A (es) | 2023-01-09 | 2025-07-08 | Metodo de codificacion de datos, metodo de decodificacion de datos y aparato relacionado |
Applications Claiming Priority (4)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310028884.0 | 2023-01-09 | ||
| CN202310028884 | 2023-01-09 | ||
| CN202310295323.7A CN118317095A (zh) | 2023-01-09 | 2023-03-22 | 一种数据编解码方法及相关装置 |
| CN202310295323.7 | 2023-03-22 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US19/262,813 Continuation US20250358456A1 (en) | 2023-01-09 | 2025-07-08 | Data Encoding Method, Data Decoding Method, and Related Apparatus |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024149238A1 true WO2024149238A1 (zh) | 2024-07-18 |
Family
ID=91730985
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/071323 Ceased WO2024149238A1 (zh) | 2023-01-09 | 2024-01-09 | 一种数据编解码方法及相关装置 |
Country Status (7)
| Country | Link |
|---|---|
| US (1) | US20250358456A1 (zh) |
| EP (1) | EP4637150A4 (zh) |
| JP (1) | JP2026503281A (zh) |
| KR (1) | KR20250134629A (zh) |
| CN (2) | CN118317095A (zh) |
| MX (1) | MX2025008015A (zh) |
| WO (1) | WO2024149238A1 (zh) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20190068994A1 (en) * | 2017-08-29 | 2019-02-28 | Google Llc | Mixing for entropy coding in video compression |
| US20190387232A1 (en) * | 2018-06-19 | 2019-12-19 | Qualcomm Incorporated | Efficient weighted probability estimation for binary arithmetic coding |
| CN114598873A (zh) * | 2020-12-03 | 2022-06-07 | 华为技术有限公司 | 量化参数的解码方法和装置 |
-
2023
- 2023-03-22 CN CN202310295323.7A patent/CN118317095A/zh active Pending
- 2023-03-22 CN CN202511180284.1A patent/CN121357331A/zh active Pending
-
2024
- 2024-01-09 JP JP2025540186A patent/JP2026503281A/ja active Pending
- 2024-01-09 EP EP24741236.4A patent/EP4637150A4/en active Pending
- 2024-01-09 KR KR1020257025879A patent/KR20250134629A/ko active Pending
- 2024-01-09 WO PCT/CN2024/071323 patent/WO2024149238A1/zh not_active Ceased
-
2025
- 2025-07-08 US US19/262,813 patent/US20250358456A1/en active Pending
- 2025-07-08 MX MX2025008015A patent/MX2025008015A/es unknown
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20190068994A1 (en) * | 2017-08-29 | 2019-02-28 | Google Llc | Mixing for entropy coding in video compression |
| US20190387232A1 (en) * | 2018-06-19 | 2019-12-19 | Qualcomm Incorporated | Efficient weighted probability estimation for binary arithmetic coding |
| CN114598873A (zh) * | 2020-12-03 | 2022-06-07 | 华为技术有限公司 | 量化参数的解码方法和装置 |
Non-Patent Citations (1)
| Title |
|---|
| See also references of EP4637150A1 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN118317095A (zh) | 2024-07-09 |
| CN121357331A (zh) | 2026-01-16 |
| EP4637150A1 (en) | 2025-10-22 |
| EP4637150A4 (en) | 2026-03-25 |
| KR20250134629A (ko) | 2025-09-11 |
| JP2026503281A (ja) | 2026-01-28 |
| US20250358456A1 (en) | 2025-11-20 |
| MX2025008015A (es) | 2025-10-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR102767916B1 (ko) | 서브블록 병합 후보를 위한 개별적인 병합 목록 및 비디오 코딩을 위한 인트라-인터 기술 조화 | |
| CN114303380B (zh) | 用于几何划分标志的索引的cabac译码的编码器、解码器及对应方法 | |
| US12348732B2 (en) | Encoder, a decoder and corresponding methods using compact MV storage | |
| WO2020125595A1 (zh) | 视频译码器及相应方法 | |
| CN112055200A (zh) | Mpm列表构建方法、色度块的帧内预测模式获取方法及装置 | |
| WO2020143585A1 (zh) | 视频编码器、视频解码器及相应方法 | |
| CN113411613B (zh) | 对图像块进行视频译码的方法、解码设备和编/解码器 | |
| WO2022117036A1 (zh) | 量化参数的解码方法和装置 | |
| WO2020253681A1 (zh) | 融合候选运动信息列表的构建方法、装置及编解码器 | |
| CN111263166B (zh) | 一种视频图像预测方法及装置 | |
| WO2020147514A1 (zh) | 视频编码器、视频解码器及相应方法 | |
| CN112135148B (zh) | 非可分离变换方法以及设备 | |
| CN111294603A (zh) | 视频编解码方法及装置 | |
| CN116634174A (zh) | 编码器、解码器及对应的使用帧内模式译码进行帧内预测的方法 | |
| CN112135128A (zh) | 图像预测方法、编码树节点划分方法及其装置 | |
| US20250358456A1 (en) | Data Encoding Method, Data Decoding Method, and Related Apparatus | |
| HK40128054A (zh) | 数据编码方法、数据解码方法及相关装置 | |
| RU2786022C1 (ru) | Устройство и способ для ограничений уровня блока в зависимости от режима и размера | |
| RU2787217C1 (ru) | Способ и устройство интерполяционной фильтрации для кодирования с предсказанием | |
| RU2771925C1 (ru) | Кодер, декодер и соответствующие способы с использованием компактного mv хранилища | |
| RU2783385C2 (ru) | Кодер, декодер и соответствующие способы с использованием компактного mv хранилища | |
| WO2025011104A1 (zh) | 编解码方法和装置 | |
| CN116260979A (zh) | 从帧内子划分译码模式工具限制子分区的尺寸的编码器、解码器、及对应方法 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24741236 Country of ref document: EP Kind code of ref document: A1 |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 202527064550 Country of ref document: IN |
|
| ENP | Entry into the national phase |
Ref document number: 2025540186 Country of ref document: JP Kind code of ref document: A |
|
| WWE | Wipo information: entry into national phase |
Ref document number: MX/A/2025/008015 Country of ref document: MX Ref document number: 2025540186 Country of ref document: JP |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 2024741236 Country of ref document: EP |
|
| ENP | Entry into the national phase |
Ref document number: 2024741236 Country of ref document: EP Effective date: 20250716 |
|
| REG | Reference to national code |
Ref country code: BR Ref legal event code: B01A Ref document number: 112025014227 Country of ref document: BR |
|
| WWP | Wipo information: published in national office |
Ref document number: 202527064550 Country of ref document: IN |
|
| ENP | Entry into the national phase |
Ref document number: 1020257025879 Country of ref document: KR Free format text: ST27 STATUS EVENT CODE: A-0-1-A10-A15-NAP-PA0105 (AS PROVIDED BY THE NATIONAL OFFICE) |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 1020257025879 Country of ref document: KR |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 11202504635Q Country of ref document: SG |
|
| WWP | Wipo information: published in national office |
Ref document number: 11202504635Q Country of ref document: SG |
|
| WWP | Wipo information: published in national office |
Ref document number: 1020257025879 Country of ref document: KR |
|
| WWP | Wipo information: published in national office |
Ref document number: MX/A/2025/008015 Country of ref document: MX |
|
| WWP | Wipo information: published in national office |
Ref document number: 2024741236 Country of ref document: EP |
|
| ENP | Entry into the national phase |
Ref document number: 112025014227 Country of ref document: BR Kind code of ref document: A2 Effective date: 20250709 |