WO2025199745A1 - 连续性代价确定方法、解码方法、装置及存储介质 - Google Patents
连续性代价确定方法、解码方法、装置及存储介质Info
- Publication number
- WO2025199745A1 WO2025199745A1 PCT/CN2024/083833 CN2024083833W WO2025199745A1 WO 2025199745 A1 WO2025199745 A1 WO 2025199745A1 CN 2024083833 W CN2024083833 W CN 2024083833W WO 2025199745 A1 WO2025199745 A1 WO 2025199745A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- current block
- neighboring samples
- samples
- determining
- value
- 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.)
- Pending
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/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/17—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 an image region, e.g. an object
- H04N19/176—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 an image region, e.g. an object the region being a block, e.g. a macroblock
Definitions
- the quantization coefficient may be positive or negative, the sign of the quantization coefficient needs to be encoded into the bitstream during the entropy coding process.
- the present invention provides a method for determining continuity cost, a decoding method, an apparatus, and a storage medium.
- the technical solution is as follows:
- an embodiment of the present application provides a method for determining continuity cost, the method comprising:
- a continuity cost of the current block is determined based on a prediction value of the current block, a hypothesized residual value, and neighboring samples.
- an embodiment of the present application provides a decoding method, the method comprising:
- the code stream is decoded according to the sign combination of the hypothesis corresponding to the minimum continuity cost.
- an embodiment of the present application provides a decoding method, the method comprising:
- a transform kernel is determined from the assumed transform kernels according to the continuity cost, and a code stream is decoded based on the determined transform kernel.
- an embodiment of the present application provides a decoder, comprising:
- the decoding unit is configured to determine a continuity cost of the current block based on a predicted value of the current block, an assumed residual value, and neighboring samples.
- an embodiment of the present application provides a decoder, comprising:
- a decoding unit for determining a prediction value of a current block
- the decoding unit is configured to perform an inverse transform on the quantization coefficients according to a hypothesized sign combination of the quantization coefficients to obtain a hypothesized residual value of the current block;
- the decoding unit is configured to decode the code stream according to the hypothetical sign combination corresponding to the minimum continuity cost.
- an embodiment of the present application provides a decoder, comprising:
- an embodiment of the present application provides a decoder, which includes a memory and a processor, wherein the memory is used to store a computer program running on the processor; and the processor is used to execute the continuity cost determination method or the decoding method as described in the above aspects when running the computer program.
- the embodiment of the present application provides a non-volatile computer-readable storage medium for storing a code stream, wherein the code stream is decoded by using The decoding method is as described in the above aspect.
- an embodiment of the present application provides a computer program product, which includes computer instructions, the computer instructions are stored in a computer-readable storage medium, the processor obtains the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to implement the continuity cost determination method or decoding method as described in the above aspects.
- the continuity cost of the current block is determined based on the predicted value of the current block, the assumed residual value, and the neighboring samples. Since the continuity cost can characterize the continuity of pixels between the current block and the neighboring blocks under the assumed residual value, and the continuity is related to the accuracy of the assumed residual value, the sign of the quantization coefficient can be predicted based on the continuity cost corresponding to each of the different assumed residual values.
- the encoder can encode the binary symbol that characterizes the accuracy of the prediction of the quantization coefficient sign into the bitstream.
- the decoder can decode the sign of the quantization coefficient based on the continuity cost and the binary symbol that characterizes the accuracy of the prediction of the quantization coefficient sign in the bitstream, thereby ensuring decoding accuracy.
- FIG1 is a schematic diagram of an encoding process at an encoding end according to an exemplary embodiment of the present application
- FIG2 is a schematic diagram of a decoding process at a decoding end according to an exemplary embodiment of the present application
- FIG3 is a flow chart of a method for determining continuity cost according to an exemplary embodiment of the present application
- FIG6 is a flowchart of a decoding method according to another exemplary embodiment of the present application.
- FIG8 is a schematic diagram of a sample in a current block and feature-adjacent samples according to an exemplary embodiment of the present application
- FIG9 is a flow chart of an estimated value determination process shown in an exemplary embodiment of the present application.
- FIG10 is a schematic diagram of an intra-frame prediction mode
- FIG11 is a schematic diagram illustrating an implementation of an estimated value determination process according to an exemplary embodiment of the present application.
- FIG12 is a flowchart of a process for determining an estimated value according to another exemplary embodiment of the present application.
- FIG13 is a schematic diagram of a texture feature classification method according to an exemplary embodiment of the present application.
- FIG14 is a schematic diagram of reference neighboring samples according to an exemplary embodiment of the present application.
- FIG15 is a schematic diagram of sample weight combinations under different types shown in an exemplary embodiment of the present application.
- FIG16 is a schematic diagram showing a group division method according to an exemplary embodiment of the present application.
- FIG17 is a schematic diagram showing a group division method according to another exemplary embodiment of the present application.
- FIG18 shows a structural block diagram of an encoder provided by an exemplary embodiment of the present application.
- FIG19 shows a structural block diagram of an encoder provided by another exemplary embodiment of the present application.
- FIG20 shows a structural block diagram of an encoder provided by another exemplary embodiment of the present application.
- FIG21 shows a structural block diagram of a decoder provided by an exemplary embodiment of the present application.
- plural refers to two or more.
- “And/or” describes a relationship between associated objects, indicating that three possible relationships exist. For example, “A and/or B” can mean: A exists alone, A and B exist simultaneously, or B exists alone. The character “/” generally indicates an "or” relationship between the associated objects.
- LCUs square Largest Coding Units
- CTUs Coding Tree Units
- CUs rectangular Coding Units
- Coding Units may also be divided into Prediction Units (PUs) and Transform Units (TUs).
- PUs Prediction Units
- TUs Transform Units
- the encoder first divides the image into multiple coding blocks, and then uses intra-frame or inter-frame prediction for the current block.
- the algorithm (including motion estimation and motion compensation) generates a prediction block for the current block, and subtracts the prediction block from the original block of the current block to obtain a residual block, thereby transforming and quantizing the residual block to obtain quantized coefficients, and finally encoding the quantized coefficients into the bitstream through entropy coding.
- continuity cost determination method will be described in detail below using an exemplary embodiment. It should be noted that the continuity cost determination method can be used in an encoder or a decoder. For ease of description, the following embodiments are described using the decoder as an example.
- the assumed residual value is determined based on the assumed sign combination of the quantization coefficients.
- the decoder can obtain the corresponding hypothetical residual value, resulting in a total of 2N hypothetical residual values.
- the decoder determines the continuity costs corresponding to the various assumed sign combinations.
- the assumed residual value is determined based on the assumed transformation kernel of the quantized coefficient.
- the quantized coefficients after sign prediction are inversely transformed.
- the decoder does not predict the signs of the non-zero quantized coefficients one by one, but uses different transform kernels to inversely transform the quantized coefficients.
- the encoder and decoder are configured with several consistent hypothetical transform kernels (or candidate transform kernels). After obtaining the quantized coefficients, the decoder uses different hypothetical transform kernels to perform inverse transform processing on the quantized coefficients to obtain hypothetical residual values corresponding to the different hypothetical transform kernels.
- M hypothetical residual values can be obtained by performing inverse transform processing on the quantized coefficients using different hypothetical transform kernels.
- the decoder determines the continuity costs corresponding to the various assumed transform kernels.
- the neighboring samples used to determine the continuity cost are selected from neighboring blocks of the current block.
- the neighboring blocks may be reconstructed blocks adjacent to the current block in a specified direction, and the neighboring samples may be samples in the neighboring blocks that are adjacent to samples in the current block in the specified direction.
- the neighboring blocks may be reconstructed blocks located above and to the left of the current block, and the neighboring samples may be samples in the above reconstructed block that are adjacent to the upper edge samples of the current block, and samples in the left reconstructed block that are adjacent to the left edge samples of the current block.
- the residual value used to determine the hypothesis of continuity cost may be the residual value corresponding to all samples in the current block, or the residual value corresponding to all samples in the current block.
- the part of samples may be samples located at a specified edge in the current block.
- the portion of samples may be the first n rows of samples at the upper edge of the current block, and the first m rows of samples at the left edge, where n and m are both positive integers.
- the parameter values used to determine the hypothesis of the continuity cost include the residual values corresponding to the first n rows of samples at the upper edge of the current block, and the residual values corresponding to the first m rows of samples at the left edge.
- the decoder determines the continuity cost of the current block 42 based on the predicted values of the first row sample 411 of the upper edge and the first column sample 412 of the left edge in the current block 41, the residual values corresponding to the first row sample 411 of the upper edge and the first column sample 412 of the left edge, and the neighboring samples 42 located above and to the left of the current block 41.
- the continuity cost of the current block is determined based on the predicted value of the current block, the assumed residual value and the adjacent samples. Since the continuity cost can characterize the continuity of the pixels between the current block and the adjacent blocks under the assumed residual value, and the continuity is related to the accuracy of the assumed residual value, the sign of the quantization coefficient can be predicted based on the continuity cost corresponding to each of the different assumed residual values.
- the encoder can encode the binary symbol that characterizes the accuracy of the prediction of the quantization coefficient sign into the bitstream.
- the decoder can decode the sign of the quantization coefficient based on the continuity cost and the binary symbol that characterizes the accuracy of the prediction of the quantization coefficient sign in the bitstream, thereby ensuring decoding accuracy.
- the above continuity cost determination method can be applied to a decoding process based on sign prediction or a decoding process based on transform kernel selection, and will be described below using exemplary embodiments.
- FIG. 5 shows a flowchart of a decoding method provided by an exemplary embodiment of the present application.
- the method may include the following steps:
- Step 501 Determine the prediction value of the current block.
- the decoder performs intra-frame or inter-frame prediction on the current block based on the prediction information contained in the bitstream and the decoded blocks to obtain the predicted value of the current block.
- Step 502 Perform inverse transformation on the quantized coefficients according to the assumed sign combination of the quantized coefficients to obtain the assumed residual value of the current block.
- the decoder determines non-zero quantized coefficients in the quantized coefficients (obtained through entropy decoding and inverse quantization), and assumes the signs of the non-zero quantized coefficients through permutations and combinations, thereby obtaining several assumed sign combinations.
- the decoder processes the non-zero quantized coefficients based on the assumed positive and negative sign combination (adds signs to the non-zero quantized coefficients), and performs inverse transformation on the processed quantized coefficients to obtain the assumed residual value of the current block.
- the eight hypothetical sign combinations are +++, ++-, +-+, +--, -++, -+-, --+, and ---.
- the quantization coefficients are 1, 0, 5, and 3, respectively, the quantization coefficients are processed based on the hypothetical sign combination "+++" to obtain the quantization coefficients of +1, 0, +5, and +3, respectively.
- Inverse transform processing is performed on the quantization coefficients of +1, 0, +5, and +3 to obtain the hypothetical residual values corresponding to the hypothetical sign combination "+++.”
- the quantization coefficients are processed based on the hypothetical sign combination "++-" to obtain the hypothetical residual values corresponding to the hypothetical sign combination "++-.”
- eight hypothetical residual values corresponding to eight hypothetical sign combinations are obtained.
- Step 503 Determine the continuity cost of the current block under the assumed sign combination based on the predicted value of the current block, the assumed residual value, and the neighboring samples.
- the decoder determines the continuity cost of the current block under different hypothesized sign combinations based on the prediction value of the current block, the hypothesized residual value, and neighboring samples.
- the decoder determines the continuity costs of the current block under 8 combinations of positive and negative signs.
- Step 504 Decode the code stream according to the hypothetical sign combination corresponding to the minimum continuity cost.
- the encoder determines the continuity costs corresponding to different hypothetical sign combinations in the same manner as the decoder.
- the encoder determines the hypothetical sign combination corresponding to the minimum continuity cost, determines the difference between the hypothetical sign combination corresponding to the minimum continuity cost and the actual sign combination of the quantized coefficients, and encodes a binary symbol representing the difference into the bitstream.
- the encoder compares the symbol at the same position in the assumed positive and negative sign combination corresponding to the minimum continuity cost and the real positive and negative sign combination. If the symbols are consistent (that is, the symbol prediction is correct), the binary symbol corresponding to the position is 1; if the symbols are inconsistent (that is, the symbol prediction is wrong), the binary symbol corresponding to the position is 0.
- the comparison result can be expressed as 111; when the assumed sign combination corresponding to the minimum continuity cost is “+++” and the actual sign combination is “++-”, the comparison result can be expressed as 110.
- the decoder and encoder use the same continuity cost determination method, the hypothetical sign combinations corresponding to the minimum continuity costs determined by the decoder and encoder are consistent. Furthermore, the decoder can determine the actual sign combination corresponding to the quantization coefficients based on the comparison results in the bitstream and the hypothetical sign combination corresponding to the minimum continuity cost. After performing an inverse transform on the quantization coefficients under the actual sign combination to obtain the residual value, the decoder can then derive the reconstructed block based on the predicted value of the current block and the residual value, and then obtain the reconstructed image based on the reconstructed block.
- encoding the comparison result between the sign combination corresponding to the minimum continuity cost and the true sign combination can save codewords compared to directly encoding the signs of the quantized coefficients. Furthermore, the encoder and decoder use a consistent continuity cost determination scheme, ensuring that the decoder restores the true sign combination and guarantees decoding accuracy.
- FIG. 6 shows a flowchart of a decoding method provided by another exemplary embodiment of the present application.
- the method may include the following steps:
- Step 601 Determine the prediction value of the current block.
- the decoder performs intra-frame or inter-frame prediction on the current block based on the prediction information contained in the bitstream and the decoded blocks to obtain the predicted value of the current block.
- Step 602 Perform inverse transformation on the quantized coefficients according to the assumed transformation kernel of the quantized coefficients to obtain the assumed residual value of the current block.
- the decoder uses different assumed transform kernels to perform inverse transform processing on the quantization coefficients to obtain assumed residual values of the current block under the different assumed transform kernels.
- the decoder when the decoder is provided with four candidate transform kernels, four hypothetical residual values are obtained after inverse transform processing is performed on the quantized coefficients using different candidate transform kernels.
- the decoder determines the continuity cost of the current block under different assumed transform kernels based on the prediction value of the current block, the assumed residual value, and the neighboring samples.
- the decoder determines the continuity costs of the current block under four assumed transformation kernels.
- Step 604 Determine a transform kernel from the assumed transform kernels according to the continuity cost, and decode the bitstream based on the determined transform kernel.
- the decoder determines the hypothetical transform kernel corresponding to the minimum continuity cost as the transform kernel for the current block. The decoder then uses the determined transform kernel to perform an inverse transform on the quantized coefficients to obtain a residual value. The decoder then reconstructs the block based on the predicted value of the current block and the residual value, and then reconstructs the image based on the reconstructed block. It should be noted that in this approach, the encoder does not need to encode information related to the transform kernel selection in the bitstream.
- P′ x,y represents the estimated value of the sample
- P x,y represents the predicted value of the sample
- r x,y represents the assumed residual value of the sample.
- the sum of the continuity costs of the samples in the current block is the continuity cost of the current block.
- the decoder determines a hypothetical residual value corresponding to the minimum difference value, and reconstructs the current block based on the hypothetical residual value to obtain a reconstructed block.
- determining the estimated value of the current block based on neighboring samples may adopt either of the following two methods.
- the decoder may estimate samples of the current block using neighboring samples of the current block in a preset direction.
- the decoder determines at least two neighboring samples of the sample in a preset direction, and determines the sample change trend based on the at least two neighboring samples, thereby estimating the sample based on the at least two neighboring samples and the sample change trend to obtain an estimated value of the sample.
- the sample change trend can be represented by the sample difference between adjacent samples.
- the decoder can determine an estimated value of the upper edge sample 711 based on two adjacent samples 721 above the upper edge sample 711; for a left edge sample 712 in the current block 71, the decoder can determine an estimated value of the left edge sample 712 based on two adjacent samples 722 to the left of the upper edge sample 712.
- the continuity cost of the current block 71 can be expressed as:
- w is the width of the current block
- h is the height of the current block
- the position of the upper left corner sample of the current block is represented as (0, 0).
- R represents the neighboring sample
- P represents the predicted value of the sample in the current block
- r represents the residual value of the hypothesis of the sample.
- the preset directions are upward and left, and the adjacent samples are two adjacent samples above the current block and two adjacent samples on the left are used as an example for explanation.
- the preset direction can also be set to other directions as needed, and the adjacent samples can be selected as needed. The embodiment of the present application does not limit this.
- the texture feature may include a texture direction feature.
- the horizontal gradient is used to characterize the change direction and change intensity of the sample in the horizontal direction
- the vertical gradient is used to characterize the change direction and change intensity of the sample in the vertical direction.
- the decoder locates feature-adjacent samples in the vertical direction of the top edge sample and determines the texture features of the feature-adjacent samples.
- the decoder locates feature-adjacent samples in the horizontal direction of the left edge sample and determines the texture features of the feature-adjacent samples.
- the interval between the feature-adjacent samples and the top edge sample or the left edge sample is m, where m is a natural number.
- the decoder determines the neighboring sample at (x, -2) (with an interval of 1 from the upper edge sample) as a feature neighboring sample 821, and determines the estimated value of the upper edge sample 811 based on the texture features of the feature neighboring sample 821.
- the decoder determines the neighboring sample at (-2, y) (with an interval of 1 from the left edge sample) as a feature neighboring sample 822, and determines the estimated value of the left edge sample 812 based on the texture features of the feature neighboring sample 822.
- the decoder may calculate the gradient of a position corresponding to the feature neighboring sample based on other samples surrounding the feature neighboring sample and a gradient operator.
- the gradient operator may be a Sobel operator, a Prewitt operator, a Roberts operator, a Kirsch operator, etc.
- the embodiment of the present application does not limit the specific gradient operator used.
- the decoder can also directly determine the difference between adjacent samples in the horizontal direction as the horizontal gradient, and determine the difference between adjacent samples in the vertical direction as the vertical gradient.
- the embodiments of the present application do not limit the specific gradient calculation method.
- the estimated value of the current block may be determined in any of the following ways.
- texture features may be divided into at least two texture feature types, and corresponding estimation algorithms may be set for different texture feature types, so as to determine an estimated value of the current block using the estimation algorithm and neighboring samples.
- Figure 9 shows a flow chart of a method for determining an estimated value of a current block provided by an exemplary embodiment of the present application.
- the method may include the following steps:
- the decoder determines the intra prediction mode of the current block based on the horizontal gradient and the vertical gradient of neighboring samples.
- the decoder when determining the intra prediction mode in units of a current block, for a sample in the current block, calculates the prediction mode based on the sample. Corresponding to the horizontal gradients and vertical gradients of the adjacent samples, the candidate intra prediction modes corresponding to the samples are determined, thereby determining the intra prediction mode of the current block according to the candidate intra prediction modes of the samples.
- the decoder determines the gradient ratio based on the horizontal and vertical gradients of neighboring samples, and then determines the candidate intra prediction mode corresponding to the sample from the above correspondence according to the gradient ratio and the gradient sign.
- the above correspondence may include all intra-frame prediction modes or some intra-frame prediction modes.
- intra-frame prediction modes may be selected at intervals, and the above correspondence may be configured for the selected intra-frame prediction modes.
- configuring a correspondence for all intra-frame prediction modes configuring a correspondence for some intra-frame prediction modes results in a larger gradient ratio range for the intra-frame prediction modes.
- the decoder determines that the candidate intra-frame prediction mode of the sample is mode 18 based on the corresponding relationship.
- the decoder determines that the candidate intra prediction mode of the sample is mode 50 based on the corresponding relationship.
- the decoder determines that the candidate intra-frame prediction mode of the sample is mode 34 based on the corresponding relationship.
- the decoder determines that the candidate intra prediction mode for the sample is mode 40 based on the corresponding relationship.
- the gradient magnitudes of the horizontal gradient and the vertical gradient may be used to represent the importance of the candidate intra prediction mode.
- the sum of the gradient amplitudes of the first sample corresponding to the neighboring samples in the current block is amp1, and the candidate intra-frame prediction mode corresponding to the first sample is intra-frame prediction mode 34.
- the sum of the gradient amplitudes of the second sample corresponding to the neighboring samples is amp2, and the candidate intra-frame prediction mode corresponding to the second sample is intra-frame prediction mode 34.
- the sum of the gradient amplitudes of the third sample corresponding to the neighboring samples is amp3, and the candidate intra-frame prediction mode corresponding to the third sample is intra-frame prediction mode 18.
- the cumulative amplitude corresponding to intra-frame prediction mode 18 is determined to be amp3, and the cumulative amplitude corresponding to intra-frame prediction mode 34 is amp1+amp2.
- Step 901C determine the candidate intra prediction mode corresponding to the maximum cumulative amplitude as the intra prediction mode of the current block.
- the encoder After determining the cumulative amplitudes of various candidate intra-frame prediction modes, the encoder determines the candidate intra-frame prediction mode corresponding to the maximum cumulative amplitude as the intra-frame prediction mode of the current block, that is, the intra-frame prediction mode corresponding to the most significant texture feature of the neighboring samples is determined as the intra-frame prediction mode of the current block.
- the encoder determines the intra prediction mode 34 as the intra prediction mode of the current block.
- Step 902 Determine an estimated value of the current block based on the intra prediction mode of the current block and neighboring samples.
- the decoder multiplexes intra prediction logic to determine estimated values of samples in the current block based on neighboring samples above and to the left of the current block and an interpolation filter corresponding to the intra prediction mode of the current block.
- the decoder when the decoder determines the estimated values of the top edge sample 1111 and the left edge sample 1112 in the current block 1110, it first determines a candidate intra-frame prediction mode for the top edge sample 1111 based on the horizontal and vertical gradients of the neighboring sample 1121 above the top edge sample 1111, and determines a candidate intra-frame prediction mode for the left edge sample 1112 based on the horizontal and vertical gradients of the neighboring sample 1122 to the left of the left edge sample 1112. The decoder then determines the intra-frame prediction mode corresponding to the current block 1110 based on the accumulated magnitudes of the candidate intra-frame prediction modes. Finally, the decoder determines the estimated values of the top edge sample 1111 and the left edge sample 1112 through intra-frame prediction based on the upper and left adjacent neighboring samples 1130 of the current block 1110 and the intra-frame prediction mode of the current block.
- the process of determining the estimated value refers to the texture of the adjacent samples (horizontal and vertical gradient representation)
- the estimated value determined by this scheme is more accurate; and the decoder reuses the intra-frame prediction logic when estimating the current block, without the need for additional estimated value calculation logic, thereby simplifying the implementation complexity of the estimation process.
- Figure 12 shows a flow chart of a method for determining an estimated value of a current block provided by another exemplary embodiment of the present application.
- the method may include the following steps:
- Step 1201 Determine the texture feature type corresponding to the current block based on the texture features of neighboring samples.
- texture features are classified into several types, and different estimation calculation methods are configured for different texture feature types.
- the decoder determines the texture feature type of the sample's corresponding neighboring samples and then uses the estimation calculation method corresponding to the texture feature type to determine the estimated value of the sample.
- one possible design involves categorizing the texture feature types based on the texture direction angle represented by the texture feature, with different texture feature types corresponding to different texture direction angle ranges.
- the texture direction angle range to which the texture direction angle represented by the texture feature of the neighboring sample belongs is determined, and the texture feature type corresponding to the texture direction angle range is then determined as the texture feature type of the neighboring sample.
- the decoder may determine the texture feature type according to the horizontal gradient and the vertical gradient.
- the decoder when determining the texture feature type based on the current block, for the samples in the current block, determines the candidate texture feature type corresponding to each sample based on the horizontal gradient and vertical gradient of the adjacent samples corresponding to the sample, thereby determining the texture feature type corresponding to the current block based on the candidate texture feature type corresponding to the sample.
- this step may include the following sub-steps:
- Step 1201A Determine a candidate texture feature type based on the numerical relationship between the horizontal gradient and the vertical gradient.
- the numerical relationship between the horizontal gradient and the vertical gradient may include a gradient ratio and a sign relationship.
- the decoder is configured with a correspondence between a gradient ratio interval, a gradient sign and a type, where the gradient ratio interval is the interval to which the ratio of the horizontal gradient to the vertical gradient belongs, and the gradient sign includes the gradient signs (positive, negative or 0) corresponding to the horizontal gradient and the vertical gradient respectively.
- the decoder determines the gradient ratio based on the horizontal and vertical gradients of neighboring samples, and then determines the candidate texture feature type corresponding to the sample from the above correspondence according to the gradient ratio and gradient sign.
- the corresponding relationship may be stored in a configuration table or other forms.
- texture features can be divided into four types.
- the texture direction corresponding to the first texture feature type is a quasi-vertical direction (the texture direction angle range is an angle range with a first angle to the vertical direction)
- the texture direction corresponding to the second texture feature type is a quasi-horizontal direction (the texture direction angle range is an angle range with a second angle to the horizontal direction)
- the texture direction corresponding to the third texture feature type is a quasi-right oblique direction
- the texture direction angle range is an angle range with a third angle to the right oblique 45° direction
- the texture direction corresponding to the fourth texture feature type is a quasi-left oblique direction (the texture direction angle range is an angle range with a fourth angle to the left oblique 45° direction).
- Table 1 the correspondence between the gradient ratio interval, gradient sign, and type is shown in Table 1.
- the decoder determines that the texture feature of the sample belongs to texture feature type 1;
- the decoder determines that the texture feature of the sample belongs to texture feature type 2;
- the decoder determines that the texture feature of the sample belongs to texture feature type 3;
- the decoder determines that the texture feature of the sample belongs to texture feature type 4.
- Step 1201B Determine the cumulative amplitude corresponding to the candidate texture feature type based on the gradient amplitudes of the horizontal gradient and the vertical gradient.
- the sum of the gradient amplitudes of the first sample corresponding to the neighboring samples in the current block is amp1, and the first sample corresponds to texture feature type 1; the sum of the gradient amplitudes of the second sample corresponding to the neighboring samples is amp2, and the second sample corresponds to texture feature type 2; the sum of the gradient amplitudes of the third sample corresponding to the neighboring samples is amp3, and the third sample corresponds to texture feature type 1; the sum of the gradient amplitudes of the fourth sample corresponding to the neighboring samples is amp4, and the fourth sample corresponds to texture feature type 3.
- the cumulative amplitude corresponding to texture feature type 1 is determined to be amp1+amp3, the cumulative amplitude corresponding to texture feature type 2 is amp2, and the cumulative amplitude corresponding to texture feature type 3 is amp4.
- Step 1201C determine the candidate texture feature type corresponding to the maximum cumulative amplitude as the texture feature type corresponding to the current block.
- the encoder After determining the cumulative magnitudes of various candidate types, the encoder determines the candidate type corresponding to the maximum cumulative magnitude as the texture feature type corresponding to the current block.
- the encoder determines texture feature type 1 as the texture feature type corresponding to the current block.
- the number of occurrences of the candidate texture feature types can also be determined, so that the candidate texture feature type corresponding to the highest number of occurrences is determined as the texture feature type corresponding to the current block.
- the embodiments of the present application are not limited to this.
- the decoder determines the estimated value of the sample in the current block based on the estimated value calculation method corresponding to the texture feature type corresponding to the current block and in combination with neighboring samples.
- different neighboring samples are referenced when determining the estimated value of the sample in the current block.
- the decoder determines reference neighboring samples based on the texture feature type, and determines an estimated value of the current block based on the reference neighboring samples, where different texture feature types correspond to reference neighboring samples in different orientations.
- different reference neighboring samples may be configured for the samples at different positions.
- different reference neighboring samples may be configured for upper edge samples and lower edge samples.
- reference neighboring samples may be configured only for samples at a specific position in the current block, and the samples at the specific position may be estimated; for samples outside the specific position, reference neighboring samples may not be configured, and the samples outside the specific position may not be estimated.
- the decoder determines the estimated value based on the reference neighboring samples as 2R x,-1 -R x,-2 . No estimation is performed for the left edge sample (0, y). As shown in Figure 14, for the top edge sample at (0, 0), the estimated value of the top edge sample can be determined based on the neighboring samples at (0, -1) and (0, -2). For the top edge sample at (1, 0), the estimated value of the top edge sample can be determined based on the neighboring samples at (1, -1) and (1, -2).
- the decoder determines the estimated value based on the reference neighboring samples as 2R -1,y -R -2,y .
- the upper edge sample (x, 0) is not estimated.
- the estimated value of the left edge sample can be determined based on the neighboring samples at (-2, 0) and (-1, 0); for the left edge sample at (0, 1), the estimated value of the left edge sample can be determined based on the neighboring samples at (-2, 1) and (-1, 1).
- the decoder determines the estimated value based on the reference neighboring samples as 2R x-1,-1 -R x-2,-2 .
- the decoder determines the estimated value based on the reference neighboring samples as 2R -1,y-1 -R -2,y-2 .
- the estimated value determined by the decoder based on the reference neighboring samples can be expressed as 2R x+1,-1 -R x+2,-2 .
- the estimated value determined by the decoder based on the reference neighboring samples can be expressed as 2R -1,y+1 -R -2,y+2 .
- the above embodiments are only for illustrative purposes.
- the reference neighboring samples corresponding to the samples in the current block may be different from the above embodiments, and the method of determining the estimated value based on the reference neighboring samples may also be different from the above embodiments.
- the decoder After determining the estimated value, the decoder performs continuity cost calculation based on the estimated value, the predicted value, and the assumed residual value.
- , and the continuity cost of the left edge sample (0, y) is cost 0,y
- the decoder determines a sample weight combination based on the texture feature type, and determines an estimated value of the current block based on the sample weight combination and reference neighboring samples.
- the sample weight combination includes sample weights corresponding to different neighboring samples, and different texture feature types correspond to different sample weight combinations, and different texture feature types correspond to reference neighboring samples in the same orientation.
- the sample weight combination corresponding to the neighboring samples 1520 is (0, 0, -1, 0, 0, 0, 0, 2, 0, 0); if the current block 1510 corresponds to texture type 3, the sample weight combination corresponding to the neighboring samples 1520 is (-1, 0, 0, 0, 0, 2, 0, 0, 0); if the current block 1510 corresponds to texture type 4, the sample weight combination corresponding to the neighboring samples 1520 is (0, 0, 0, 0, -1, 0, 0, 0, 2, 0).
- the current block before determining the continuity cost of the current block, the current block may be divided into several groups, and then the groups are used as units. The continuity costs corresponding to the groups are determined, and finally the continuity cost of the current block is determined based on the continuity costs of at least one group.
- the decoder determines a continuity cost of the group based on the predicted value of the group, the assumed residual value, and neighboring samples, and determines a continuity cost of the current block based on the continuity cost of at least one group.
- the group used to determine the continuity cost of the current block may be all the groups in the current block. Accordingly, the decoder determines the continuity cost of the current block based on the sum of the continuity costs of the various groups.
- the group used to determine the continuity cost of the current block may be one or at least two groups specified in the current block. Accordingly, the decoder determines the continuity cost of the current block based on the sum of the continuity costs of the specified groups (the continuity costs of groups other than the specified groups do not need to be calculated).
- any of the following methods can be used.
- Division method 1 The upper edge samples and lower edge samples of the current block belong to the same group.
- the decoder determines the intra prediction mode of the current block based on candidate intra prediction modes corresponding to all samples in the current block, thereby determining estimated values of samples in the current block according to the intra prediction mode of the current block.
- Division method 2 the upper edge samples of the current block belong to the first group, and the left edge samples of the current block belong to the second group.
- the decoder determines a first intra-frame prediction mode corresponding to the first group based on the candidate intra-frame prediction modes corresponding to the upper edge samples in the first group, thereby determining an estimated value of the upper edge samples in the first group based on the first intra-frame prediction mode. Based on the candidate intra-frame prediction modes corresponding to the left edge samples in the second group, the decoder determines a second intra-frame prediction mode corresponding to the second group, thereby determining an estimated value of the left edge samples in the second group based on the second intra-frame prediction mode.
- the decoder determines that the first group corresponds to a first texture feature type based on the candidate types of texture features corresponding to the upper edge samples in the first group, and thereby determines estimated values of the upper edge samples in the first group based on the first texture feature type.
- the decoder determines that the second group corresponds to a second texture feature type based on the texture feature types corresponding to the left edge samples in the second group, and thereby determines estimated values of the left edge samples in the second group based on the second texture feature type.
- n consecutive edge samples in the current block belong to the same group, n is a positive integer, and the edge samples belong to the upper edge samples and the lower edge samples of the current block.
- every two consecutive edge samples in the current block 1610 are divided into the same group 1611 .
- the decoder determines the intra prediction mode of the group based on candidate intra prediction modes corresponding to edge samples in the same group, thereby determining the estimated value of the upper edge samples in the group according to the intra prediction mode of the group.
- the decoder determines the texture feature type corresponding to the group based on candidate types of texture features corresponding to edge samples in the same group, and thereby determines the estimated value of the edge samples in the group according to the texture feature type corresponding to the group.
- Division method 4 p consecutive upper edge samples in the current block belong to the same group, and q consecutive left edge samples in the current block belong to the same processing unit, where p and q are both positive integers.
- the degree of texture variation in different directions may be different, for example, in some images the degree of texture variation in the horizontal direction is significantly greater than that in the vertical direction, in some embodiments, different grouping methods may be used for upper edge samples and lower edge samples.
- p consecutive samples are divided into the same group, and among the left edge samples, q consecutive samples are divided into the same group.
- p and q can be the same or different.
- every two consecutive edge samples in the left edge samples are divided into the same group, and every four consecutive edge samples in the upper edge samples are divided into the same group.
- the process of determining the continuity cost of the group can refer to the continuity cost determination process based on the current block, which will not be described in detail in this embodiment.
- FIG. 18 shows a block diagram of an encoder provided by an exemplary embodiment of the present application.
- the encoder includes:
- the decoding unit 1810 is configured to determine a continuity cost of the current block based on a prediction value of the current block, an assumed residual value, and neighboring samples.
- the decoding unit 1810 is configured to:
- the continuity cost of the current block is determined based on a difference between a sum of a residual value between the predicted value and the hypothesis and the estimated value.
- the decoding unit 1810 is configured to determine the estimated value of the current block based on texture features of the neighboring samples of the current block.
- the decoding unit 1810 is configured to: determine an intra prediction mode of the current block based on the texture features of the neighboring samples of the current block;
- the estimated value of the current block is determined based on the intra prediction mode of the current block and the neighboring samples.
- the decoding unit 1810 is configured to determine an intra-frame prediction mode of the current block based on the horizontal gradient and the vertical gradient of the neighboring samples.
- the decoding unit 1810 is configured to: determine a texture feature type corresponding to the current block based on the texture features of the neighboring samples;
- the assumed residual value is determined based on a combination of assumed positive and negative signs of the quantization coefficients, or,
- FIG. 19 shows a block diagram of the structure of an encoder provided by another exemplary embodiment of the present application.
- the encoder includes:
- An embodiment of the present application also provides a computer program product, which includes computer instructions, the computer instructions are stored in a computer-readable storage medium, the processor obtains the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to implement the continuity cost determination method or decoding method as described in the above embodiment.
- Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another.
- the storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
本申请实施例公开了一种连续性代价确定方法、解码方法、装置及存储介质,属于视频编解码技术领域。所述方法包括:基于当前块的预测值、假设的残差值以及邻近样本,确定所述当前块的连续性代价。采用本申请实施例提供的方案,在保证解码准确性的前提下能够达到节约码字的效果。
Description
本申请实施例涉及视频编解码技术领域,特别涉及一种连续性代价确定方法、解码方法、装置及存储介质。
视频解码过程中,解码器一方面需要使用帧内预测或帧间预测方式对当前块进行预测,得到当前块的预测块;另一方面,解码器需要从码流中解码得到量化系数矩阵,并对该量化系数矩阵进行反量化和反变换处理,得到残差块,进而将预测块和残差块相加得到当前块的重建块。
由于量化系数可能为正值或者负值,因此在进行熵编码过程中,需要将量化系数的符号编码至码流中。
发明内容
本申请实施例提供了一种连续性代价确定方法、解码方法、装置及存储介质。所述技术方案如下:
一方面,本申请实施例提供了一种连续性代价确定方法,所述方法包括:
基于当前块的预测值、假设的残差值以及邻近样本,确定所述当前块的连续性代价。
另一方面,本申请实施例提供了一种解码方法,所述方法包括:
确定当前块的预测值;
根据量化系数的假设的正负号组合,对所述量化系数进行反变换处理,得到所述当前块的假设的残差值;
基于所述当前块的所述预测值、所述假设的残差值以及邻近样本,确定所述当前块在所述假设的正负号组合下的连续性代价;
根据最小连续性代价对应的所述假设的正负号组合对码流进行解码。
另一方面,本申请实施例提供了一种解码方法,所述方法包括:
确定当前块的预测值;
根据量化系数的假设的变换核,对所述量化系数进行反变换处理,得到所述当前块的假设的残差值;
基于所述当前块的所述预测值、所述假设的残差值以及邻近样本,确定所述当前块在所述假设的变换核下的连续性代价;
根据所述连续性代价从所述假设的变换核中确定变换核,并基于确定出的变换核对码流进行解码。
另一方面,本申请实施例提供了一种解码器,所述解码器包括:
解码单元,用于基于当前块的预测值、假设的残差值以及邻近样本,确定所述当前块的连续性代价。
另一方面,本申请实施例提供了一种解码器,所述解码器包括:
解码单元,用于确定当前块的预测值;
所述解码单元,用于根据量化系数的假设的正负号组合,对所述量化系数进行反变换处理,得到所述当前块的假设的残差值;
所述解码单元,用于基于所述当前块的所述预测值、所述假设的残差值以及邻近样本,确定所述当前块在所述假设的正负号组合下的连续性代价;
所述解码单元,用于根据最小连续性代价对应的所述假设的正负号组合对码流进行解码。
另一方面,本申请实施例提供了一种解码器,所述解码器包括:
解码单元,用于确定当前块的预测值;
所述解码单元,用于根据量化系数的假设的变换核,对所述量化系数进行反变换处理,得到所述当前块的假设的残差值;
所述解码单元,用于基于所述当前块的所述预测值、所述假设的残差值以及邻近样本,确定所述当前块在所述假设的变换核下的连续性代价;
所述解码单元,用于根据所述连续性代价从所述假设的变换核中确定变换核,并基于确定出的变换核对码流进行解码。
另一方面,本申请实施例提供了一种解码器,所述解码器包括存储器和处理器,所述存储器,用于存储在所述处理器上运行的计算机程序;所述处理器,用于在运行所述计算机程序时,执行如上述方面所述的连续性代价确定方法,或,解码方法。
另一方面,本申请实施例提供了一种存储码流的非易失性计算机可读存储介质,所述码流通过利用解
码器的解码方法而解码,其中,所述解码方法为如上述方面所述的解码方法。
另一方面,本申请实施例提供了一种计算机程序产品,所述计算机程序产品包括计算机指令,所述计算机指令存储在计算机可读存储介质中,处理器从所述计算机可读存储介质中获取所述计算机指令,所述处理器执行所述计算机指令以实现如上述方面所述的连续性代价确定方法,或,解码方法。
本申请实施例中,基于当前块的预测值、假设的残差值以及邻近样本确定当前块的连续性代价,由于连续性代价可以表征在假设的残差值下,当前块与邻近块之间像素的连续性,而连续性又与假设的残差值的准确性相关,因此可以基于不同假设的残差值各自对应的连续性代价预测量化系数的符号。采用本申请实施例提供的方案,编码器可以将表征量化系数符号预测准确性的二元符号编码至码流中,由于基于连续性代价进行符号预测的准确率高于错误率,因此可以达到节约码字的效果;相应的,解码器可以基于连续性代价以及码流中表征量化系数符号预测准确性的二元符号,解码出量化系数的符号,保证了解码准确性。
图1是本申请一个示例性实施例示出的编码端编码过程的示意图;
图2是本申请一个示例性实施例示出的解码端解码过程的示意图;
图3是本申请一个示例性实施例示出的连续性代价确定方法的方法流程图;
图4是本申请一个示例性实施例示出的连续性代价确定过程的实施示意图;
图5是本申请一个示例性实施例示出的解码方法的方法流程图;
图6是本申请另一个示例性实施例示出的解码方法的方法流程图;
图7是本申请一个示例性实施例示出的估计值确定过程的实施示意图;
图8是本申请一个示例性实施例示出的当前块中样本与特征邻近样本的示意图;
图9是本申请一个示例性实施例示出的估计值确定过程的流程图;
图10是帧内预测模式的示意图;
图11是本申请一个示例性实施例示出的估计值确定过程的实施示意图;
图12是本申请另一个示例性实施例示出的估计值确定过程的流程图;
图13是本申请一个示例性实施例示出的纹理特征分类方式的示意图;
图14是本申请一个示例性实施例示出的参考邻近样本的示意图;
图15是本申请一个示例性实施例示出的不同类型下样本权重组合的示意图;
图16是本申请一个示例性实施例示出的组划分方式的示意图;
图17是本申请另一个示例性实施例示出的组划分方式的示意图;
图18示出了本申请一个示例性实施例提供的编码器的结构方框图;
图19示出了本申请另一个示例性实施例提供的编码器的结构方框图;
图20示出了本申请另一个示例性实施例提供的编码器的结构方框图;
图21示出了本申请一个示例性实施例提供的解码器的结构方框图。
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
在本文中提及的“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。
目前通用的视频编解码标准都采用基于块的混合编码框架。视频中的一帧(frame)图像被分割成相同大小(如256×256,128×128,64×64等)的正方形的最大编码单元(Largest Coding Unit,LCU)或编码树单元(Coding Tree Unit,CTU)。最大编码单元或编码树单元可根据规则划分成矩形的编码单元(Coding Unit,CU)。编码单元可能还会划分预测单元(Prediction Unit,PU),变换单元(Transform Unit,TU)等。
混合编码框架包括预测(prediction)、变换(transform)、量化(quantization)、熵编码(entropy coding)、环路滤波(in loop filter)等模块。预测模块包括帧内预测(intra prediction)和帧间预测(inter prediction)。帧间预测包括运动估计(motion estimation)和运动补偿(motion compensation)。由于同一帧图像中相邻像素之间存在很强的相关性,因此可以在视频编解码技术中使用帧内预测的方法消除相邻像素之间的空间冗余。由于视频中的相邻帧图像之间存在较强相似性,因此可以在视频编解码技术中使用帧间预测方法消除相邻帧图像之间的时间冗余,从而提高编码效率。
在编码端,如图1所示,编码器首先将图像被划分为多个编码块,然后对当前块使用帧内或帧间预测
(包括运动估计和运动补偿)算法产生当前块的预测块,并使用当前块的原始块减去预测块得到残差块,从而对残差块进行变换、量化得到量化系数,最终通过熵编码将量化系数编码至码流中。
在解码端,如图2所示,解码器一方面使用帧内或帧间预测算法预测得到当前块的预测块,另一方面对码流进行熵解码得到量化系数,并对量化系数进行反量化、反变换得到残差块,从而将预测块和残差块相加得到重建块。解码器根据重建块组合得到重建图像,并对重建图像进行环路滤波得到解码图像。
由于量化系数的符号可能为正号或负号,而系数的正负号不同会导致残差块不同,进而导致重建块不同,因此在编码量化系数时,若量化系数为非零系数,则需要对该量化系数的符号进行编码。
相关技术中,量化系数的符号采用旁路模式进行编码。然而,由于旁路模式下认为量化系数的符号为正或负是等概率的,因此编码后量化系数的符号需要占用大量码字。
考虑到相邻像素之间具有一定的相关性,即当前块与其邻近块之间的像素通常具有连续性,因此可以基于像素之间的连续性预测量化参数的符号。相应的,编码器和解码器采用相同的方式确定连续性代价,解码器可以基于不同符号预测结果对应的连续性代价,选取连续性代价最小的符号预测结果,并将量化系数的真实符号与最小连续性代价对应符号预测结果之间的差异,以二元符号的方式编码至码流中。由于最小连续性代价对应的符号预测结果的预测准确率显著大于预测错误率,因此对真实符号与符号预测结果之间的差异进行编码时能够达到节约码字的效果。
解码器同样基于不同符号预测结果对应的连续性代价,选取连续性代价最小的符号预测结果,并基于解码得到的量化系数的真实符号与选取的符号预测结果之间的差异,对选取的符号预测结果进行修正,得到量化系数的真实符号。由于编码器与解码器确定连续性代价的方式相同,且码流中包含真实符号与最小连续性代价对应符号预测结果之间的差异,因此解码器最终能够准确确定出量化系数的符号,进而保证解码准确性。
下面将采用示例性的实施例对连续性代价确定方法进行详细说明。需要说明的是,连续性代价确定方法可以用于编码器或解码器,为了方便表述,下述实施例中以应用于解码器为例进行说明。
请参考图3,其示出了本申请一个示例性实施例提供的连续性代价确定方法的流程图。该方法可以包括如下步骤:
步骤301,基于当前块的预测值、假设的残差值以及邻近样本,确定当前块的连续性代价。
在一些实施例中,解码器和编码器基于一致的块划分信息确定当前块。其中,当前块可以是当前编码单元、当前预测单元或当前变换单元。
在一些实施例中,解码器根据码流中包含的预测信息以及已解码块,对当前块进行帧内或帧间预测,得到当前块的预测值。其中,该预测值为当前块中像素的像素值。
解码器对码流进行熵解码以及反量化处理得到量化系数后,需要进一步对量化系数进行反变换处理,以得到当前块的残差值。其中,该残差值用于表征当前块的预测值与原始值之间的差异。由于非零量化系数的符号可能为正或负,因此在进行反变换前,需要确定非零量化系数的正负性。
本实施例中,由于并未直接将量化系数的正负号编码至码流中,因此解码器需要基于量化系数进行残差值假设,得到假设的残差值。可选的,假设的残差值可以采用如下方式中的任意一种确定得到:
1、假设的残差值根据量化系数的假设的正负号组合确定得到。
在一种可能的实施方式中,对于非零量化系数,解码器假设该非零量化系数的符号,根据对符号假设后的量化系数进行反变换处理,得到假设的残差值。
当存在N个非零量化系数时,由于非零量化系数的符号包括正和负两种可能,因此可以得到2N种假设的正负号组合。对于每一种假设的正负号组合,解码器均可以得到对应的假设的残差值,共计得到2N种假设的残差值。
比如,当存在2个非零量化系数时,可以得到4种假设的正负号组合(分别为++。+-,-+,--)以及4种假设的残差值。
进一步的,当假设的残差值根据量化系数的假设的正负号组合确定得到时,解码器确定各种假设的正负号组合各自对应的连续性代价。
2、假设的残差值根据量化系数的假设的变换核确定得到。
不同于第一种方式中,预测不同非零量化系数的正负号后,对符号预测后的量化系数进行反变换处理,第二种方式中,解码器并不会逐一预测非零量化系数的正负号,而是采用不同的变换核对量化系数进行反变换处理。
在一种可能的实施方式中,编码器和解码器设置有若干一致的假设的变换核(或被称为候选变换核)。得到量化系数后,解码器使用不同的假设的变换核对量化系数进行反变换处理,得到不同的假设的变换核对应的假设的残差值。
当设置有M个假设的变换核时,利用不同的假设的变换核对量化系数进行反变换处理,可以得到M种假设的残差值。
进一步的,当假设的残差值根据量化系数的假设的变换核确定得到时,解码器确定各种假设的变换核各自对应的连续性代价。
需要说明的是,上述实施例中,仅以正负号预测以及变换核选择两种确定残差值的方式为例进行说明,解码器也可以采用其他的方式,根据无符号的量化系数进行残差值假设,本申请实施例并不对此构成限定。
在一些实施例中,用于确定连续性代价的邻近样本从当前块的邻近块中选取得到。其中,该邻近块可以是指定方向上与当前块相邻的已重建块,邻近样本可以是邻近块中与当前块中指定方向上的样本邻近的样本。比如,该邻近块可以是位于当前块上方以及左侧的已重建块,邻近样本可以是上方已重建块中与当前块上边缘样本邻近的样本,以及左侧已重建块中与当前块左边缘样本邻近的样本。
在一些实施例中,用于确定连续性代价的预测值可以是当前块中所有样本(即像素)的预测值,或者,当前块中部分样本的预测值。
相对应的,用于确定连续性代价的假设的残差值,可以是当前块中所有样本对应的残差值,或者,当前块中所有样本对应的残差值。
可选的,该部分样本可以是位于当前块中指定边缘的样本。
在一种可能的设计中,该部分样本可以是位于当前块中上边缘的前n行样本,以及位于左边缘的前m行样本,n和m均为正整数。相应的,用于确定连续性代价的假设的参数值包括当前块中上边缘的前n行样本对应的残差值,以及左边缘前m行样本对应的残差值。
示意性的,如图4所示,解码器基于当前块41中上边缘第一行样本411以及左边缘第一列样本412的预测值、上边缘第一行样本411以及左边缘第一列样本412对应的残差值、位于当前块41上方以及左侧的邻近样本42,确定当前块42的连续性代价。
关于连续性代价的计算方式,在一种可能的实施方式中,解码器基于当前块的预测值与假设的残差值,确定当前块的假设的重建值,进而根据假设的重建值与邻近样本之间的相关性确定连续性代价。
在一些实施例中,连续性代价越小,表明在该假设的残差值下,当前块与邻近样本之间的连续性越好(相关度越高),反之,连续性代价越大,表明在该假设的残差值下,当前块与邻近样本之间的连续性越差(相关度越低)。
综上所述,本申请实施例中,基于当前块的预测值、假设的残差值以及邻近样本确定当前块的连续性代价,由于连续性代价可以表征在假设的残差值下,当前块与邻近块之间像素的连续性,而连续性又与假设的残差值的准确性相关,因此可以基于不同假设的残差值各自对应的连续性代价预测量化系数的符号。采用本申请实施例提供的方案,编码器可以将表征量化系数符号预测准确性的二元符号编码至码流中,由于基于连续性代价进行符号预测的准确率高于错误率,因此可以达到节约码字的效果;相应的,解码器可以基于连续性代价以及码流中表征量化系数符号预测准确性的二元符号,解码出量化系数的符号,保证了解码准确性。
上述连续性代价确定方法,可以应用于基于正负号预测的解码过程或基于变换核选择的解码过程。下面通过示例性的实施例进行说明。
请参考图5,其示出了本申请一个示例性实施例提供的解码方法的流程图。该方法可以包括如下步骤:
步骤501,确定当前块的预测值。
解码过程中,解码器根据码流中包含的预测信息以及已解码块,对当前块进行帧内或帧间预测,得到当前块的预测值。
步骤502,根据量化系数的假设的正负号组合,对量化系数进行反变换处理,得到当前块的假设的残差值。
在一种可能的实施方式中,解码器确定量化系数(经过熵解码以及反量化得到)中的非零量化系数,并通过排列组合的方式假设非零量化系数的符号,从而得到若干种假设的正负号组合。
解码器基于假设的正负号组合对非零量化系数进行处理(为非零量化系数添加符号),并对处理后的量化系数进行反变换处理,得到当前块的假设的残差值。
示意性的,当前块对应的4个量化系数中包含3个非零量化系数时,8种假设的正负号组合分别为+++,++-,+-+,+--,-++,-+-,--+,---。当4个量化系数依次为1,0,5,3时,基于假设的正负号组合“+++”对量化系数处理后,得到的量化系数分别为+1,0,+5,+3,对量化系数+1,0,+5,+3进行反变换处理,得到假设的正负号组合“+++”对应的假设的残差值。基于假设的正负号组合“++-”对量化系数处理后,得到的量化系数分别为+1,0,+5,-3,对量化系数+1,0,+5,-3进行反变换处理,得到假设的正负号组合“++-”对应的假设的残差值。以此类推,共得到8种假设的正负号组合对应的8种假设的残差值。
步骤503,基于当前块的预测值、假设的残差值以及邻近样本,确定当前块在假设的正负号组合下的连续性代价。
与步骤301相似的,解码器根据当前块的预测值,假设的残差值以及邻近样本,确定当前块在不同假设的正负号组合下的连续性代价。
结合上述步骤中的示例,解码器共确定当前块在8种正负号组合下的连续性代价。
步骤504,根据最小连续性代价对应的假设的正负号组合对码流进行解码。
在一种可能的实施方式中,编码器在编码过程中,按照与解码器侧相同的方式,确定不同假设的正负号组合对应的连续性代价。编码器确定最小连续性代价对应的假设的正负号组合,并确定最小连续性代价对应的假设的正负号组合与量化系数的真实正负号组合之间的差异,并将表征差异的二元符号编码至码流中。
可选的,编码器比较最小连续性代价对应的假设的正负号组合和真实正负号组合中相同位置的符号,若符号一致(即符号预测正确),则该位置对应的二元符号为1,若符号不一致(即符号预测错误),则该位置对应的二元符号为0。
示意性的,当最小连续性代价对应的假设的正负号组合为“+++”,而真实正负号组合为“+++”时,比较结果可以表示为111;当最小连续性代价对应的假设的正负号组合为“+++”,而真实正负号组合为“++-”时,比较结果可以表示为110。
由于最小连续性代价对应的假设的正负号组合中正负号的预测准确率明显高于预测错误率,因此采用上下文预测模型对比较结果进行编码时,能够节约码字。
由于解码器与编码器采用相同的连续性代价确定方式,因此解码器与编码器确定出的最小连续性代价对应的假设的正负号组合一致。进一步的,解码器可以根据码流中的比较结果以及最小连续性代价对应的假设的正负号组合,确定量化系数对应的真实正负号组合。对真实正负号组合下的量化系数进行反变换处理,得到残差值后,解码器可以根据当前块的预测值和残差值得到重建块,进而基于重建块得到重建图像。
示意性的,当最小连续性代价对应的假设的正负号组合为“+++”,且码流中包含的比较结果为111时,解码器确定量化系数的真实正负号组合为“+++”;当最小连续性代价对应的假设的正负号组合为“+++”,且码流中包含的比较结果为110时,解码器确定量化系数的真实正负号组合为“++-”。
可见,将上述连续性代价确定方法应用于基于正负号预测的解码过程时,相较于直接对量化系数的符号进行编码,对最小连续性代价对应的正负号组合与真实正负号组合之间的比较结果进行编码能够起到节约码字的效果。且编码器和解码器采用一致的连续性代价确定方案,能够保证解码器还原出真实正负号组合,保证了解码准确性。
请参考图6,其示出了本申请另一个示例性实施例提供的解码方法的流程图。该方法可以包括如下步骤:
步骤601,确定当前块的预测值。
解码过程中,解码器根据码流中包含的预测信息以及已解码块,对当前块进行帧内或帧间预测,得到当前块的预测值。
步骤602,根据量化系数的假设的变换核,对量化系数进行反变换处理,得到当前块的假设的残差值。
在一种可能的实施方式中,经过熵解码以及反量化得到量化系数后,解码器采用不同假设的变换核对量化系数进行反变换处理,得到当前块在不同假设的变换核下的假设的残差值。
示意性的,当解码器设置有4种候选变换核时,采用不同候选变换核对量化系数进行反变换处理后,得到4种假设的残差值。
步骤603,基于当前块的预测值、假设的残差值以及邻近样本,确定当前块在假设的变换核下的连续性代价。
与步骤301相似的,解码器根据当前块的预测值,假设的残差值以及邻近样本,确定当前块在不同假设的变换核下的连续性代价。
结合上述步骤中的示例,解码器共确定当前块在4种假设的变换核下的连续性代价。
步骤604,根据连续性代价从假设的变换核中确定变换核,并基于确定出的变换核对码流进行解码。
在一种可能的实施方式中,解码器将最小连续性代价对应的假设的变换核确定为当前块的变换核,并利用确定出的变换核对量化系数进行反变换处理,得到残差值,进而根据当前块的预测值和残差值得到重建块,并基于重建块得到重建图像。需要说明的是,该方式下编码器无需在码流中编码变换核选择的相关信息。
在另一种可能的实施方式中,编码器在编码过程中,按照与解码器侧相同的方式,确定不同假设的变换核对应的连续性代价,并基于连续性代价对假设的变换核进行排序(降序或者升序)。进一步的,编码
器确定实际采用的变换核在序列中的位置,并将位置信息编码至码流中。
由于连续性代价越低,其对应的假设的变换核为实际采用的变换核的概率越高,连续性代价越高,其对应的假设的变换核为实际采用的变换核的概率越低,因此在编码实际采用的变换核在序列中的位置时,不同位置的概率不同。相应的,采用上下文预测模型将位置信息编码至码流时,能够达到节约码字的效果。
由于解码器与编码器采用相同的连续性代价确定方式,且配置的假设的变换核一致,因此解码器可以基于连续性代价对假设的变换核进行排序,并根据码流中实际采用的变换核在序列中的位置信息,确定出实际采用的变换核。
示意性的,解码器基于连续性代价的升序,确定假设的变换核的排序为变换核3、变换核1、变换核2、变换核4,当码流中实际采用的变换核在序列中的位置信息为1时,解码器确定实际采用的变换核为变换核3。若假设的变换核的排序为变换核1、变换核3、变换核4、变换核2,当码流中实际采用的变换核在序列中的位置信息为1时,解码器确定实际采用的变换核为变换核1。
可见,将上述连续性代价确定方法应用于基于变换核选择的解码过程时,相较于直接对量化系数的符号进行编码,对实际采用的变换核在变换核序列中的位置信息进行编码能够起到节约码字的效果。
关于连续性代价的具体确定方式,由于邻近样本与当前块中样本具有相关性,因此可以采用邻近样本估计对当前块中的样本,且邻近样本与当前块中样本的相关性越高,估计结果越准确。基于上述特性,解码器可以根据邻近样本对当前块的估计结果,确定当前块的连续性代价。
在一种可能的实施方式中,解码器基于邻近样本,确定当前块的估计值,并基于预测值与假设的残差值之和与估计值的差值,确定当前块的连续性代价。
其中,预测值与假设的残差值之和可以被理解为当前块的假设的重建值。假设的重建值与估计值的差值越小,表明在该假设的残差值下,当前块与邻近样本之间的相关性越高,相应的,该假设的残差值越准确;反之,假设的重建值与估计值的差值越大,表明在该假设的残差值下,当前块与邻近样本之间的相关性越低,相应的,该假设的残差值越不准确。
示意性的,对于当前块中的样本(x,y),该样本的连续性代价可以表示为:
costx,y=|(Px,y+rx,y)-P′x,y|
costx,y=|(Px,y+rx,y)-P′x,y|
其中,P′x,y表示该样本的估计值,Px,y表示该样本的预测值,rx,y表示该样本的假设的残差值。
进一步的,当前块中样本的连续性代价之和即为当前块的连续性代价。
可选的,解码器确定最小差值对应的假设的残差值,并基于该假设的残差值对当前块进行重建,得到重建块。
在一些实施例中,基于邻近样本确定当前块的估计值可以采用如下两种方式中的任一种。
1、基于当前块在预设方向上的邻近样本,确定当前块的估计值。
在一种可能的实施方式中,解码器可以利用当前块在预设方向上的邻近样本,对当前块的样本进行估计。
在一种可能的设计中,解码器可以利用当前块上方的邻近样本,确定当前块中上边缘样本的估计值;可以利用当前块左侧的邻近样本,确定当前块中左边缘样本的估计值。
可选的,对于当前块中的样本,解码器确定该样本在预设方向上的至少两个邻近样本,并根据至少两个邻近样本确定样本变化趋势,从而在至少两个邻近样本的基础上,结合样本变化趋势对该样本进行估计,得到该样本的估计值。
其中,样本变化趋势可以采用邻近样本之间的样本差值表示。
示意性的,如图7所示,对于当前块71中的上边缘样本711,解码器可以根据上边缘样本711上方邻近的两个邻近样本721,确定上边缘样本711的估计值;对于当前块71中的左边缘样本712,解码器可以根据上边缘样本712左侧邻近的两个邻近样本722,确定左边缘样本712的估计值。进一步的,当前块71的连续性代价可以表示为:
其中,w为当前块的宽度,h为当前块的高度,且当前块左上角样本的位置表示为(0,0)。R表示邻近样本,P表示当前块中样本的预测值,r表示样本的假设的残差值。
需要说明的是,本实施例中仅以预设方向为上方和左侧,且邻近样本为当前块上方邻近的两个样本以及左侧邻近的两个样本为例进行说明,该预设方向还可以根据需求被设置为其他方向,且邻近样本可以根据需求采用选取方式,本申请实施例并不对此构成限定。
2、基于当前块的邻近样本的纹理特征,确定当前块的估计值。
不同于第一种方式中,仅考虑预设方向上的连续性(比如竖直方向或者水平方向上的连续性),为了进一步提高基于邻近样本对当前块进行估计的准确性,进而提高连续性代价的计算准确性,解码器可以根据邻近样本的纹理特征,确定当前块的估计方式,进而得到当前块的估计值。
当图像内容沿着某一方向变化时,该方向上的像素之间具有较好的连续性,相应的,基于该方向上的邻近样本对当前块进行样本估计的准确性较高。因此在一些实施例中,该纹理特征可以包括纹理方向特征。
关于纹理特征的表现形式,在一种可能的实施方式中,编码器可以将邻近样本在水平方向上的水平梯度以及在竖直方向上的竖直梯度,确定为邻近样本的纹理特征,即采用梯度表征纹理特征。
其中,水平梯度用于表征水平方向上样本的变化方向以及变化强度,竖直梯度则用于表征竖直方向上样本的变化方向以及变化强度。
关于确定纹理特征的位置,在一种可能的实施方式中,对于当前块中的上边缘样本,解码器在上边缘样本的竖直方向上确定特征邻近样本,并确定该特征邻近样本的纹理特征;对于当前块中的左边缘样本,解码器在左边缘样本的水平方向上确定特征邻近样本,并确定该特征邻近样本的纹理特征。其中,特征邻近样本与上边缘样本或左边缘样本之间的间隔为m,m为自然数。
示意性的,如图8所示,对于当前块81中位于(x,0)的上边缘样本811,解码器将(x,-2)位置(与上边缘样本之间的间隔为1)的邻近样本确定为特征邻近样本821,并根据特征邻近样本821的纹理特征,确定上边缘样本811的估计值。对于当前块81中位于(0,y)的左边缘样本812,解码器将(-2,y)位置(与左边缘样本之间的间隔为1)的邻近样本确定为特征邻近样本822,并根据特征邻近样本822的纹理特征,确定左边缘样本812的估计值。
可选的,解码器可以根据特征邻近样本周围的其他样本以及梯度算子,计算该特征邻近样本对应位置的梯度。
其中,该梯度算子可以为索贝尔算子、Prewitt算子、Roberts算子、Kirsch算子等等,本申请实施例并不对采用的具体梯度算子进行限定。
以采用索贝尔算子为例,对于位于(x,y)的特征邻近样本Px,y,其对应的水平梯度gradx=Px+1,y-1+2*Px+1,y+Px+1,y+1-Px-1,y-1-2*Px-1,y-Px-1,y+1,竖直梯度grady=Px-1,y+1+2*Px,y+1+Px+1,y+1-Px-1,y-1-2*Px,y-1-Px+1,y-1。
当然,除了利用梯度算子外计算梯度外,解码器也可以直接将水平方向上相邻样本之差确定为水平梯度,将竖直方向上相邻样本之差确定为竖直梯度,本申请实施例并不对具体的梯度计算方式进行限定。
确定出邻近样本的纹理特征后,可以采用如下方式中的任意一种确定当前块的估计值。
第一种方式、基于纹理特征确定帧内预测模式,并利用邻近样本进行帧内预测确定当前块的估计值。
由于纹理特征能够体现出纹理随方向的变化情况,因此根据纹理特征确定当前块中样本对应的帧内预测模式,并复用帧内预测逻辑,基于邻近样本确定当前块的估计值。
第二种方式、确定当前块对应的纹理特征所属的纹理特征类型,并基于邻近样本和当前块对应的纹理特征类型确定当前块的估计值。
在一种可能的实施方式中,可以将纹理特征划分为至少两种纹理特征类型,并为不同纹理特征类型设置对应的估计算法,从而利用估计算法和邻近样本确定当前块的估计值。
下面采用示意性的实施例对上述两种确定当前块的估计值的方式进行详细说明。
请参考图9,其示出了本申请一个示例性实施例提供的当前块的估计值的确定方法的流程图。该方法可以包括如下步骤:
步骤901,基于当前块的邻近样本的纹理特征,确定当前块的帧内预测模式。
在一种可能的实施方式中,解码器配置有纹理特征与帧内预测模式之间的对应关系。在确定当前块中样本的估计值时,解码器根据样本对应邻近样本的纹理特征,确定样本的帧内预测模式。
需要说明的是,该帧内预测模式不同于码流中用于确定当前块的预测值的帧内预测模式。本实施例中,基于纹理特征类型确定出的帧内预测模式用于估计样本所应呈现出的状态(即像素值),且估计出的状态可以理解为样本的预测值与残差值之和。
在一些实施例中,当纹理特征包括水平梯度和竖直梯度时,由于水平梯度可以反映出水平方向上纹理的方向以及强度,竖直梯度则可以反映出竖直方向上纹理的方向以及强度,因此基于水平梯度和竖直梯度可以确定邻近样本的总体纹理方向以及总体纹理强度。进一步的,由于邻近样本与当前块之间距离较近,因此将总体纹理方向和总体纹理强度映射为帧内预测模式后,可以通过复用帧内预测逻辑,基于当前块上相邻和左相邻的邻近样本,对当前块中的样本进行估计。
在一种可能的实施方式中,解码器基于邻近样本的水平梯度和竖直梯度,确定当前块的帧内预测模式。
在一些实施例中,当以当前块为单位确定帧内预测模式时,对于当前块中的样本,解码器基于该样本
对应邻近样本的水平梯度和竖直梯度,确定样本各自对应的候选帧内预测模式,从而根据样本的候选帧内预测模式确定当前块的帧内预测模式。
可选的,本步骤包括如下子步骤:
步骤901A,基于水平梯度和竖直梯度的数值关系,确定候选帧内预测模式。
其中,水平梯度和竖直梯度的数值关系可以包括梯度比值以及符号关系。
可选的,解码器配置有梯度比值区间、梯度符号与帧内预测模式之间的对应关系,该梯度比值区间为水平梯度与竖直梯度的比值所属的区间,梯度符号包括水平梯度以及竖直梯度各自对应的梯度符号(正、负或者0)。
对于当前块中某一样本,解码器基于邻近样本的水平梯度和竖直梯度确定出梯度比值后,根据梯度比值以及梯度符号,从上述对应关系中确定该样本对应的候选帧内预测模式。
可选的,该对应关系可以配置表或者其他形式存储。
可选的,上述对应关系中可以包括所有帧内预测模式,也可以包含部分帧内预测模式。比如,可以间隔选取帧内预测模式,并为选取的帧内预测模式配置上述对应关系。相较于为所有帧内预测模式配置对应关系,为部分帧内预测模式配置对应关系时,帧内预测模式对应的梯度比值区间更大。
示意性的,如图10所示,在VVC中,当当前块中某一样本的水平梯度的梯度幅值(即梯度的绝对值)为0,且竖直梯度的梯度幅值不为0时,解码器基于对应关系确定该样本的候选帧内预测模式为模式18。
当当前块中某一样本的竖直梯度的梯度幅值为0,且水平梯度的梯度幅值不为0时,解码器基于对应关系确定该样本的候选帧内预测模式为模式50。
当当前块中某一样本的水平梯度和竖直梯度的梯度幅值均不为0,且水平梯度和竖直梯度的梯度幅值相同,且水平梯度和竖直梯度的符号相同时,解码器基于对应关系确定该样本的候选帧内预测模式为模式34。
当当前块中某一样本的水平梯度的梯度幅值为竖直梯度的梯度幅值的2倍,且水平梯度和竖直梯度的符号相同时,解码器基于对应关系确定该样本的候选帧内预测模式为模式40。
步骤901B,基于水平梯度和竖直梯度的梯度幅值,确定候选帧内预测模式对应的累计幅值。
由于当前块中不同样本对应的候选帧内预测模式可能不同,因此在确定当前块的帧内预测模式时,可以确定各种候选帧内预测模式的重要程度(可以反映候选帧内预测模式对应纹理特征的显著程度),从而将显著程度最高的候选帧内预测模式确定为当前块的帧内预测模式。
关于候选帧内预测模式的重要程度的表现形式,在一种可能的实施方式中,可以采用水平梯度和竖直梯度的梯度幅值表征候选帧内预测模式的重要程度。
在一种可能的实施方式中,确定出样本的候选帧内预测模式后,可以根据水平梯度和竖直梯度的梯度幅值,更新该候选帧内预测模式对应的累计幅值。确定出当前块中样本的候选帧内预测模式后,即可确定出各种候选帧内预测模式对应的累计幅值。
候选帧内预测模式对应的累计幅值越大,表明候选帧内预测模式的重要程度越高,相应的,当前块中该候选帧内预测模式对应纹理特征的显著程度越高。
其中,对于水平梯度,其对应的梯度幅值可以表示为abs(gradx),对于竖直梯度,其对应的梯度幅值可以表示为abs(grady)。相应的,解码器基于水平梯度和竖直梯度的梯度幅值之和amp=abs(gradx)+abs(grady),更新候选帧内预测模式对应的累计幅值。
示意性的,当前块中第一样本对应邻近样本的梯度幅值之和为amp1,且第一样本对应的候选帧内预测模式为帧内预测模式34;第二样本对应邻近样本的梯度幅值之和为amp2,且第二样本对应的候选帧内预测模式为帧内预测模式34;第三样本对应邻近样本的梯度幅值之和为amp3,且第三样本对应的候选帧内预测模式为帧内预测模式18。最终确定出帧内预测模式18对应的累计幅值为amp3,帧内预测模式34对应的累计幅值为amp1+amp2。
步骤901C,将最大累计幅值对应的候选帧内预测模式,确定为当前块的帧内预测模式。
确定出各种候选帧内预测模式的累计幅值后,编码器将最大累计幅值对应的候选帧内预测模式确定为当前块的帧内预测模式,即将邻近样本最显著纹理特征对应的帧内预测模式确定为当前块的帧内预测模式。
结合上述步骤中的示例,若amp1+amp2>amp3,编码器将帧内预测模式34确定为当前块的帧内预测模式。
在其他可能的实施方式中,除了基于候选帧内预测模式的累计幅值确定当前块的帧内预测模式外,也可以确定候选帧内预测模式的出现次数,从而将最高出现次数对应的候选帧内预测模式确定为当前块的帧内预测模式,本申请实施例并不对此进行限定。
步骤902,基于当前块的帧内预测模式和邻近样本确定当前块的估计值。
在一种可能的实施方式中,解码器通过复用帧内预测逻辑,根据当前块上方的邻近样本、左侧的邻近样本以及当前块的帧内预测模式对应的插值滤波器,确定当前块中样本的估计值。
示意性的,如图11所示,解码器确定当前块1110中上边缘样本1111以及左边缘样本1112的估计值时,首先基于上边缘样本1111上方的邻近样本1121的水平梯度和竖直梯度,确定上边缘样本1111的候选帧内预测模式,并基于左边缘样本1112左侧的邻近样本1122的水平梯度和竖直梯度,确定左边缘样本1112的候选帧内预测模式。然后,解码器基于候选帧内预测模式的累计幅值,确定当前块1110对应的帧内预测模式。最后,解码器基于当前块1110的上相邻邻近样本和左相邻邻近样本1130以及当前块的帧内预测模式,通过帧内预测方式确定上边缘样本1111以及左边缘样本1112的估计值。
本实施例中,由于该估计值的确定过程参考了邻近样本的纹理(水平竖直梯度表征),因此采用该方案确定出的估计值的准确性较高;并且解码器对当前块进行估计时复用了帧内预测逻辑,无需额外增加估计值计算逻辑,简化了估计过程的实现复杂度。
请参考图12,其示出了本申请另一个示例性实施例提供的当前块的估计值的确定方法的流程图。该方法可以包括如下步骤:
步骤1201,基于邻近样本的纹理特征,确定当前块对应的纹理特征类型。
在一种可能的实施方式中,纹理特征被划分为若干种类型,且针对不同纹理特征类型设置不同的估计值计算方式。在确定当前块中样本的估计值时,解码器确定样本对应邻近样本的纹理特征类型,从而采用该纹理特征类型对应的估计值计算方式确定该样本的估计值。
关于纹理特征类型的划分方式,在一种可能的设计中,可以根据纹理特征所表征纹理方向角度,划分出若干种纹理特征类型,即不同纹理特征类型对应不同的纹理方向角度范围。在确定邻近样本的纹理特征类型时,即确定该邻近样本的纹理特征所表征的纹理方向角度所属的纹理方向角度范围,进而将所属纹理方向角度范围对应的纹理特征类型确定为该邻近样本的纹理特征类型。
在一些实施例中,当纹理特征包含水平梯度和竖直梯度时,解码器可以根据水平梯度和竖直梯度确定纹理特征类型。
在一些实施例中,当以当前块为单位确定纹理特征类型时,对于当前块中的样本,解码器基于该样本对应邻近样本的水平梯度和竖直梯度,确定样本各自对应候选的纹理特征类型,从而根据样本对应的候选的纹理特征类型,确定当前块对应的纹理特征类型。
可选的,本步骤可以包括如下子步骤:
步骤1201A,基于水平梯度和竖直梯度的数值关系,确定候选的纹理特征类型。
其中,水平梯度和竖直梯度的数值关系可以包括梯度比值以及符号关系。
可选的,解码器配置有梯度比值区间、梯度符号与类型之间的对应关系,该梯度比值区间为水平梯度与竖直梯度的比值所属的区间,梯度符号包括水平梯度以及竖直梯度各自对应的梯度符号(正、负或者0)。
对于当前块中某一样本,解码器基于邻近样本的水平梯度和竖直梯度确定出梯度比值后,根据梯度比值以及梯度符号,从上述对应关系中确定该样本对应的候选的纹理特征类型。
可选的,该对应关系可以配置表或者其他形式存储。
在一种可能的划分方式中,如图13所示,可以将纹理特征划分为4种类型。其中,第一纹理特征类型对应的纹理方向为类竖直方向(纹理方向角度范围是与竖直方向夹角为第一夹角的角度范围),第二纹理特征类型对应的纹理方向为类水平方向(纹理方向角度范围是与水平方向夹角为第二夹角的角度范围),第三纹理特征类型对应的纹理方向为类右斜方向(纹理方向角度范围是与右斜45°方向夹角为第三夹角的角度范围),第四纹理特征类型对应的纹理方向为类左斜方向(纹理方向角度范围是与左斜45°方向夹角为第四夹角的角度范围)。相应的,梯度比值区间、梯度符号与类型之间的对应关系如表一所示。
表一
结合表一所示的对应关系,在一个示意性的例子中,在水平梯度幅值大于两倍的竖直梯度幅值的情况下,解码器确定样本的纹理特征属于纹理特征类型1;
在竖直梯度幅值大于两倍的水平梯度幅值的情况下,解码器确定样本的纹理特征属于纹理特征类型2;
在水平梯度幅值小于两倍的竖直梯度幅值,且竖直梯度幅值小于两倍的水平梯度幅值,且水平梯度与竖直梯度的梯度正负性相同的情况下,解码器确定样本的纹理特征属于纹理特征类型3;
在水平梯度幅值小于两倍的竖直梯度幅值,且竖直梯度幅值小于两倍的水平梯度幅值,且水平梯度与竖直梯度的梯度正负性不同的情况下,解码器确定样本的纹理特征属于纹理特征类型4。
需要说明的是,上述纹理特征的类型划分方式仅用于示意性说明,在其他可能的实施方式中,纹理特征还可以按照更粗的粒度进行类型划分,比如划分为2种或3种类型,或者,纹理特征还可以按照更细的粒度进行类型划分,比如划分为6种、8种、12种类型等等。类型划分方式以及数量可以根据计算量以及计算准确性需求动态设置,本申请实施例并不对具体的类型划分方式以及数量构成限定。
步骤1201B,基于水平梯度和竖直梯度的梯度幅值,确定候选的纹理特征类型对应的累计幅值。
由于当前块中不同样本对应的候选的纹理特征类型可能不同,因此在确定当前块对应的纹理特征类型时,可以确定各种候选的纹理特征类型的重要程度(可以反映候选纹理特征类型的显著程度),从而将显著程度最高的候选的纹理特征类型确定为当前块对应的纹理特征类型。
关于候选的纹理特征类型的重要程度的表现形式,在一种可能的实施方式中,可以采用水平梯度和竖直梯度的梯度幅值表征候选的纹理特征类型的重要程度。
其中,对于水平梯度,其对应的梯度幅值可以表示为abs(gradx),对于竖直梯度,其对应的梯度幅值可以表示为abs(grady)。相应的,解码器基于水平梯度和竖直梯度的梯度幅值之和amp=abs(gradx)+abs(grady),更新候选的纹理特征类型对应的累计幅值。
示意性的,当前块中第一样本对应邻近样本的梯度幅值之和为amp1,且第一样本对应纹理特征类型1;第二样本对应邻近样本的梯度幅值之和为amp2,且第二样本对应纹理特征类型2;第三样本对应邻近样本的梯度幅值之和为amp3,且第三样本对应纹理特征类型1;第四样本对应邻近样本的梯度幅值之和为amp4,且第四样本对应纹理特征类型3。最终确定出纹理特征类型1对应的累计幅值为amp1+amp3,纹理特征类型2对应的累计幅值为amp2,纹理特征类型3对应的累计幅值为amp4。
步骤1201C,将最大累计幅值对应的候选的纹理特征类型,确定为当前块对应的纹理特征类型。
确定出各种候选类型的累计幅值后,编码器将最大累计幅值对应的候选类型确定为当前块对应的纹理特征类型。
结合上述步骤中的示例,若amp1+amp3>amp2,且amp1+amp3>amp4,编码器将纹理特征类型1确定为当前块对应的纹理特征类型。
在其他可能的实施方式中,除了基于候选的纹理特征类型的累计幅值确定当前块的纹理特征类型外,也可以确定候选的纹理特征类型的出现次数,从而将最高出现次数对应的候选的纹理特征类型确定为当前块对应的纹理特征类型,本申请实施例并不对此进行限定。
步骤1202,基于当前块对应的纹理特征类型和邻近样本,确定当前块的估计值。
在一种可能的实施方式中,解码器基于当前块对应的纹理特征类型对应的估计值计算方式,结合邻近样本确定当前块中样本的估计值。
在一种可能的设计中,对于不同类型的纹理特征,在确定当前块中样本的估计值时所参考的邻近样本不同。
在一种可能的实施方式中,解码器基于纹理特征类型,确定参考邻近样本,并基于参考邻近样本,确定当前块的估计值。其中,不同纹理特征类型对应不同方位的参考邻近样本。
可选的,针对当前块中不同位置的样本,可以为不同位置的样本配置不同的参考邻近样本。比如,可以为上边缘样本和下边缘样本,配置不同的参考邻近样本。
可选的,针对特定纹理特征类型,可以仅为当前块中特定位置的样本配置参考邻近样本,并对特定位置的样本进行估计;对于特定位置以外的样本,则不配置参考邻近样本,且不对特定位置以外的样本进行估计。
结合表一所述的类型,纹理特征类型与参考邻近样本的对应关系如表二所示。
表二
结合表二,若当前块对应纹理特征类型1,对于上边缘样本(x,0),解码器基于参考邻近样本确定出的估计值可以表示为2Rx,-1-Rx,-2,左边缘样本(0,y)则不进行估计。如图14所示,对于位于(0,0)的上边缘样本,可以基于位于(0,-1)以及(0,-2)的邻近样本确定该上边缘样本的估计值;对于位于(1,0)的上边缘样本,可以基于位于(1,-1)以及(1,-2)的邻近样本确定该上边缘样本的估计值。
若当前块对应纹理特征类型2,对于左边缘样本(0,y),解码器基于参考邻近样本确定出的估计值可以表示为2R-1,y-R-2,y,上边缘样本(x,0)则不进行估计。如图14所示,对于位于(0,0)的左边缘样本,可以基于位于(-2,0)以及(-1,0)的邻近样本确定该左边缘样本的估计值;对于位于(0,1)的左边缘样本,可以基于位于(-2,1)以及(-1,1)的邻近样本确定该左边缘样本的估计值。
若当前块对应纹理特征类型3,对于上边缘样本(x,0),解码器基于参考邻近样本确定出的估计值可以表示为2Rx-1,-1-Rx-2,-2,对于左边缘样本(0,y),解码器基于参考邻近样本确定出的估计值可以表示为2R-1,y-1-R-2,y-2。如图14所示,对于位于(1,0)的上边缘样本,可以基于位于(-1,-2)以及(0,-1)的邻近样本确定该上边缘样本的估计值;对于位于(0,1)的左边缘样本,可以基于位于(-2,-1)以及(-1,0)的邻近样本确定该左边缘样本的估计值。
若当前块对应纹理特征类型4,对于上边缘样本(x,0),解码器基于参考邻近样本确定出的估计值可以表示为2Rx+1,-1-Rx+2,-2,对于左边缘样本(0,y),解码器基于参考邻近样本确定出的估计值可以表示为2R-1,y+1-R-2,y+2。如图14所示,对于位于(1,0)的上边缘样本,可以基于位于(2,-1)以及(3,-2)的邻近样本确定该上边缘样本的估计值;对于位于(0,1)的左边缘样本,可以基于位于(-1,2)以及(-2,3)的邻近样本确定该左边缘样本的估计值。
需要说明的是,上述实施例仅用于示例性说明,在采用其他类型划分方式时,当前块中样本对应的参考邻近样本可能不同于上述实施例,且基于参考邻近样本确定估计值的方式也可能不同于上述实施例。
确定出估计值后,解码器基于估计值、预测值以及假设的残差值进行连续性代价计算。
结合上述步骤中的示例,对于纹理特征类型1,上边缘样本(x,0)的连续性代价costx,0=|(-Rx,-2+2Rx,-1-Px,0)-rx,0|,左边缘样本则不计算连续性代价。
对于纹理特征类型2,左边缘样本(0,y)的连续性代价cost0,y=|(-R-2,y+2R-1,y-P0,y)-r0,y|,上边缘样本则不计算连续性代价。
对于纹理特征类型3,上边缘样本(x,0)的连续性代价costx,0=|(-Rx-2,-2+2Rx-1,-1-Px,0)-rx,0|,左边缘样本(0,y)的连续性代价cost0,y=|(-R-2,y-2+2R-1,y-1-P0,y)-r0,y|。
对于纹理特征类型4,上边缘样本(x,0)的连续性代价costx,0=|(-Rx+2,-2+2Rx+1,-1-Px,0)-rx,0|,左边缘样本(0,y)的连续性代价cost0,y=|(-R-2,y+2+2R-1,y+1-P0,y)-r0,y|。
对于当前块中需要计算连续性代价的样本,确定出样本的连续性代价后,解码器将样本的连续性代价之和确定为当前块的连续性代价。
在另一种可能的设计中,对于不同纹理特征类型,在确定当前块中样本的估计值时所参考的邻近样本相同,但计算估计值时采用的样本权重不同。
在一种可能的实施方式中,解码器基于纹理特征类型,确定样本权重组合,并基于样本权重组合和参考邻近样本,确定当前块的估计值。其中,样本权重组合中包含不同邻近样本对应的样本权重,且不同纹理特征类型对应不同的样本权重组合,且不同纹理特征类型对应相同方位的参考邻近样本。
可选的,解码器基于样本权重组合中参考邻近样本对应的样本权重,对参考邻近样本进行加权计算,得到当前块中样本的估计值。
在一个示意性的例子中,如图15所示,确定当前块1510中上边缘样本1511的估计值时参考邻近样本1520。若当前块1510对应纹理类型类型1,邻近样本1520对应的样本权重组合为(0,0,-1,0,0,0,0,2,0,0);若当前块1510对应纹理类型类型3,邻近样本1520对应的样本权重组合为(-1,0,0,0,0,0,2,0,0,0);若当前块1510对应纹理类型类型4,邻近样本1520对应的样本权重组合为(0,0,0,0,-1,0,0,0,2,0)。
本实施例中,由于该估计值的确定过程参考了邻近样本的纹理(水平竖直梯度表征),因此采用该方案确定出的估计值的准确性较高;并且,通过为不同类型的纹理特征配置不同的样本估计方法,提高了不同纹理类型下样本估计的针对性,有助于进一步提高确定出的估计值的准确性。
上述实施例中,在确定当前块的连续性代价前,可以先将当前块划分为若干个组,然后以组为单位,
确定组对应的连续性代价,最终基于至少一组的连续性代价,确定当前块的连续性代价。
在一种可能的实施方式中,对于当前块中的组,解码器基于组的预测值、假设的残差值以及邻近样本,确定组的连续性代价,并基于至少一组的连续性代价确定当前块的连续性代价。
可选的,当前块的连续性代价为至少一组的连续性代价之和。
在一些实施例中,用于确定当前块的连续性代价的组,可以是当前块中的所有组。相应的,解码器基于各个组的连续性代价之和,确定当前块的连续性代价。
在另一些实施例中,用于确定当前块的连续性代价的组,可以是当前块中指定的一组或者至少两组。相应的,解码器基于指定组的连续性代价之和(指定组以外其他组的连续性代价无需计算),确定当前块的连续性代价。
可选的,该指定组可以是按照预设标准选取的组。比如,从所有组中间隔选取的组(比如排序后序号为奇数或者偶数的组),或者,位于当前块中指定方位的组(比如位于左下边缘、左上边缘以及右上边缘的组)。本申请实施例并不对指定组的选取方式以及选取数量进行限定。
关于组的划分方式,可以采用如下任意一种。
划分方式1、当前块的上边缘样本和下边缘样本属于同一组。
在该划分方式下,当前块中用于计算连续性代价的所有样本均属于同一组。相应的,当前块中样本均采用相同的方式计算估计值。
在一种可能的实施方式中,解码器基于当前块中所有样本对应的候选帧内预测模式,确定当前块的帧内预测模式,从而根据当前块的帧内预测模式,确定当前块中样本的估计值。
在另一种可能的实施方式中,解码器基于当前块中所有样本对应纹理特征的候选类型,确定当前块对应的纹理特征类型,从而根据当前块的纹理特征类型,确定当前块中样本的估计值。
划分方式2、当前块的上边缘样本属于第一组,且当前块的左边缘样本属于第二组。
为了提高估计值计算的准确性,可以按照将当前块中的样本划分为至少两个组,并针对不同组采用各自对应的方式计算组内样本的估计值。其中,同一组中样本采用相同的方式计算估计值,而不同组之间计算估计值所采用的方式可能不同。
由于当前块中同一方位样本的相关性较高,因此可以按照样本在当前块中所处的方位进行组划分。比如,将上边缘样本划分为一组,将左边缘样本划分为另一组。
在一种可能的实施方式中,解码器基于第一组中上边缘样本对应的候选帧内预测模式,确定第一组对应的第一帧内预测模式,从而根据第一帧内预测模式,确定第一组中上边缘样本的估计值。基于第二组中左边缘样本对应的候选帧内预测模式,确定第二组对应的第二帧内预测模式,从而根据第二帧内预测模式,确定第二组中左边缘样本的估计值。
在另一种可能的实施方式中,解码器基于第一组中上边缘样本对应纹理特征的候选类型,确定第一组对应第一纹理特征类型,从而根据第一纹理特征类型,确定第一组中上边缘样本的估计值。解码器基于第二组中左边缘样本对应的纹理特征类型,确定第二组对应第二纹理特征类型,从而根据第二纹理特征类型,确定第二组中左边缘样本的估计值。
划分方式3、当前块中n个连续的边缘样本属于同一组,n为正整数,边缘样本属于当前块的上边缘样本和下边缘样本。
由于连续样本通常具有较高的相似性,因此可以将当前块中连续的n个边缘样本划分至同一组。并且,同一组中边缘样本的数量越多,计算估计值的计算量越大,但估计值的计算准确性越高;反之,同一组中边缘样本的数量越少,计算估计值的计算量越小,但估计值的计算准确性越低。
示意性的,如图16所示,当前块1610中每2个连续的边缘样本被划分至同一组1611中。
在一种可能的实施方式中,解码器基于同一组中边缘样本对应的候选帧内预测模式,确定组的帧内预测模式,从而根据组的帧内预测模式,确定该组中上边缘样本的估计值。
在另一种可能的实施方式中,解码器基于同一组中边缘样本对应纹理特征的候选类型,确定组对应的纹理特征类型,从而根据组对应的纹理特征类型,确定该组中边缘样本的估计值。
划分方式4、当前块中p个连续的上边缘样本属于同一组,当前块中q个连续的左边缘样本属于同一处理单元,p和q均为正整数。
由于不同方向上纹理的变化程度可能不同,比如某些图像中水平方向的纹理变化程度明显大于竖直方向的纹理变化程度。因此在一些实施例中,可以对上边缘样本和下边缘样本采用不同的组划分方式。
其中,上边缘样本中p个连续的样本被划分至同一组,左边缘样本中q个连续的样本被划分至同一组。其中,p和q可以相同,也可以不同。
可选的,当水平方向的纹理变化程度大于竖直方向的纹理变化程度时,可以设置p<q,当水平方向的纹理变化程度小于竖直方向的纹理变化程度时,可以设置p>q。
示意性的,如图17所示,当前块1710中,左边缘样本中每2个连续的边缘样本被划分至同一组,上边缘样本中每4个连续的边缘样本被划分至同一组。
上述组划分方式下,确定组的连续性代价的过程可以参考以当前块为单位的连续性代价确定过程,本实施例在此不作赘述。
请参考图18,其示出了本申请一个示例性实施例提供的编码器的结构框图。该编码器包括:
解码单元1810,用于基于当前块的预测值、假设的残差值以及邻近样本,确定所述当前块的连续性代价。
可选的,所述解码单元1810,用于:
基于所述邻近样本,确定所述当前块的估计值;
基于所述预测值与所述假设的残差值之和与所述估计值的差值,确定所述当前块的连续性代价。
可选的,所述解码单元1810,用于:基于所述当前块在预设方向上的所述邻近样本,确定所述当前块的所述估计值。
可选的,所述解码单元1810,用于:基于所述当前块的所述邻近样本的纹理特征,确定所述当前块的所述估计值。
可选的,所述解码单元1810,用于:基于所述当前块的所述邻近样本的所述纹理特征,确定所述当前块的帧内预测模式;
基于所述当前块的帧内预测模式和所述邻近样本确定所述当前块的所述估计值。
可选的,所述纹理特征包括水平梯度和竖直梯度;
所述解码单元1810,用于:基于所述邻近样本的所述水平梯度和所述竖直梯度,确定所述当前块的帧内预测模式。
可选的,所述解码单元1810,用于:基于所述水平梯度和所述竖直梯度的数值关系,确定候选帧内预测模式;
基于所述水平梯度和所述竖直梯度的梯度幅值,确定所述候选帧内预测模式对应的累计幅值;
将最大累计幅值对应的所述候选帧内预测模式,确定为所述当前块的帧内预测模式。
可选的,所述解码单元1810,用于:基于所述邻近样本的所述纹理特征,确定所述当前块对应的纹理特征类型;
基于所述当前块对应的纹理特征类型和所述邻近样本,确定所述当前块的所述估计值。
可选的,所述纹理特征包括水平梯度和竖直梯度;
所述解码单元1810,用于:基于所述水平梯度和所述竖直梯度的数值关系,确定候选的纹理特征类型;
基于所述水平梯度和所述竖直梯度的梯度幅值,确定所述候选的纹理特征类型对应的累计幅值;
将最大累计幅值对应的所述候选的纹理特征类型,确定为所述当前块对应的纹理特征类型。
可选的,所述解码单元1810,用于:基于所述当前块对应的纹理特征类型,确定参考邻近样本,其中,不同纹理特征类型对应不同方位的参考邻近样本;
基于所述参考邻近样本,确定所述当前块的所述估计值。
可选的,所述解码单元1810,用于:基于所述当前块对应的纹理特征类型,确定样本权重组合,所述样本权重组合中包含不同邻近样本对应的样本权重,且不同纹理特征类型对应不同的样本权重组合;
基于所述样本权重组合和参考邻近样本,确定所述当前块的所述估计值,其中,不同纹理特征类型对应相同方位的参考邻近样本。
可选的,所述解码单元1810,用于:对于当前块中的组,基于组的所述预测值、所述假设的残差值以及所述邻近样本,确定组的连续性代价;
基于至少一个组的连续性代价确定所述当前块的连续性代价。
可选的,所述当前块的上边缘样本和下边缘样本属于同一组;或,
所述当前块的上边缘样本属于第一组,且所述当前块的左边缘样本属于第二组;或,
所述当前块中n个连续的边缘样本属于同一组,n为正整数,所述边缘样本属于所述当前块的上边缘样本和下边缘样本;或,
所述当前块中p个连续的上边缘样本属于同一组,所述当前块中q个连续的左边缘样本属于同一处理单元,p和q均为正整数。
可选的,所述假设的残差值根据量化系数的假设的正负号组合确定得到,或,
所述假设的残差值根据量化系数的假设的变换核确定得到。
请参考图19,其示出了本申请另一个示例性实施例提供的编码器的结构框图。该编码器包括:
解码单元1910,用于确定当前块的预测值;
所述解码单元1910,用于根据量化系数的假设的正负号组合,对所述量化系数进行反变换处理,得到所述当前块的假设的残差值;
所述解码单元1910,用于基于所述当前块的所述预测值、所述假设的残差值以及邻近样本,确定所述当前块在所述假设的正负号组合下的连续性代价;
所述解码单元1910,用于根据最小连续性代价对应的所述假设的正负号组合对码流进行解码。
请参考图20,其示出了本申请另一个示例性实施例提供的编码器的结构框图。该编码器包括:
解码单元2010,用于确定当前块的预测值;
所述解码单元2010,用于根据量化系数的假设的变换核,对所述量化系数进行反变换处理,得到所述当前块的假设的残差值;
所述解码单元2010,用于基于所述当前块的所述预测值、所述假设的残差值以及邻近样本,确定所述当前块在所述假设的变换核下的连续性代价;
所述解码单元2010,用于根据所述连续性代价从所述假设的变换核中确定变换核,并基于确定出的变换核对码流进行解码。
需要说明的是,上述解码单元确定连续性代价的过程可以参考上述连续性代价确定方法实施例,上述解码单元实现解码的过程可以参考上述解码方法实施例,本实施例在此不作赘述。
请参考图21,其示出了本申请一个示例性实施例提供的解码器的结构方框图。该编码器可以包括一个或多个如下部件:处理器2101、存储器2102。组件通过总线系统耦合在一起。可理解,总线系统用于实现这些组件之间的连接通信。总线系统除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。
存储器2102,用于存储能够在处理器2101上运行的计算机程序;处理器2101,用于在运行所述计算机程序时,执行:
基于当前块的预测值、假设的残差值以及邻近样本,确定所述当前块的连续性代价;
或者,执行:
确定当前块的预测值;
根据量化系数的假设的正负号组合,对所述量化系数进行反变换处理,得到所述当前块的假设的残差值;
基于所述当前块的所述预测值、所述假设的残差值以及邻近样本,确定所述当前块在所述假设的正负号组合下的连续性代价;
根据最小连续性代价对应的所述假设的正负号组合对码流进行解码;
或者,执行:
确定当前块的预测值;
根据量化系数的假设的变换核,对所述量化系数进行反变换处理,得到所述当前块的假设的残差值;
基于所述当前块的所述预测值、所述假设的残差值以及邻近样本,确定所述当前块在所述假设的变换核下的连续性代价;
根据所述连续性代价从所述假设的变换核中确定变换核,并基于确定出的变换核对码流进行解码。
可以理解,本申请实施例中的存储器2102可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请描述存储器2102旨在包括但不限于这些和任意其它适合类型的存储器。
而处理器2101可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述点云解码方法的各步骤可以通过处理器2101中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器2101可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑
器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器2102,处理器2101读取存储器2102中的信息,结合其硬件完成上述方法的步骤。可以理解的是,本申请描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个ASIC、DSP、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、FPGA、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。对于软件实现,可通过执行本申请所述功能的模块(例如过程、函数等)来实现本申请所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。可选地,作为另一个实施例,处理器2101还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的连续性代价确定方法,或,解码方法。
本申请实施例还提供了一种存储码流的非易失性计算机可读存储介质,所述码流通过利用解码器的解码方法而解码,其中,所述解码方法为上述实施例所述的解码方法。
本申请实施例还提供了一种计算机程序产品,所述计算机程序产品包括计算机指令,所述计算机指令存储在计算机可读存储介质中,处理器从所述计算机可读存储介质中获取所述计算机指令,所述处理器执行所述计算机指令以实现如上述实施例所述的连续性代价确定方法,或,解码方法。
本领域技术人员应该可以意识到,在上述一个或多个示例中,本申请实施例所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。
Claims (22)
- 一种连续性代价确定方法,其特征在于,所述方法包括:基于当前块的预测值、假设的残差值以及邻近样本,确定所述当前块的连续性代价。
- 根据权利要求1所述的方法,其特征在于,所述基于当前块的预测值、假设的残差值以及邻近样本,确定所述当前块的连续性代价,包括:基于所述邻近样本,确定所述当前块的估计值;基于所述预测值与所述假设的残差值之和与所述估计值的差值,确定所述当前块的连续性代价。
- 根据权利要求2所述的方法,其特征在于,所述基于所述邻近样本,确定所述当前块的估计值,包括:基于所述当前块在预设方向上的所述邻近样本,确定所述当前块的所述估计值。
- 根据权利要求2所述的方法,其特征在于,所述基于所述邻近样本,确定所述当前块的估计值,包括:基于所述当前块的所述邻近样本的纹理特征,确定所述当前块的所述估计值。
- 根据权利要求4所述的方法,其特征在于,所述基于所述当前块的所述邻近样本的纹理特征,确定所述当前块的所述估计值,包括:基于所述当前块的所述邻近样本的所述纹理特征,确定所述当前块的帧内预测模式;基于所述当前块的帧内预测模式和所述邻近样本确定所述当前块的所述估计值。
- 根据权利要求5所述的方法,其特征在于,所述纹理特征包括水平梯度和竖直梯度;所述基于所述当前块的所述邻近样本的所述纹理特征,确定所述当前块的帧内预测模式,包括:基于所述邻近样本的所述水平梯度和所述竖直梯度,确定所述当前块的帧内预测模式。
- 根据权利要求6所述的方法,其特征在于,所述基于所述邻近样本的所述水平梯度和所述竖直梯度,确定所述当前块的帧内预测模式,包括:基于所述水平梯度和所述竖直梯度的数值关系,确定候选帧内预测模式;基于所述水平梯度和所述竖直梯度的梯度幅值,确定所述候选帧内预测模式对应的累计幅值;将最大累计幅值对应的所述候选帧内预测模式,确定为所述当前块的帧内预测模式。
- 根据权利要求4所述的方法,其特征在于,所述基于所述当前块的所述邻近样本的纹理特征,确定所述当前块的所述估计值,包括:基于所述邻近样本的所述纹理特征,确定所述当前块对应的纹理特征类型;基于所述当前块对应的纹理特征类型和所述邻近样本,确定所述当前块的所述估计值。
- 根据权利要求8所述的方法,其特征在于,所述纹理特征包括水平梯度和竖直梯度;所述基于所述当前块的所述邻近样本的所述纹理特征,确定所述当前块对应的纹理特征类型,包括:基于所述水平梯度和所述竖直梯度的数值关系,确定候选的纹理特征类型;基于所述水平梯度和所述竖直梯度的梯度幅值,确定所述候选的纹理特征类型对应的累计幅值;将最大累计幅值对应的所述候选的纹理特征类型,确定为所述当前块对应的纹理特征类型。
- 根据权利要求8所述的方法,其特征在于,所述基于所述当前块对应的纹理特征类型和所述邻近样本,确定所述当前块的所述估计值,包括:基于所述当前块对应的纹理特征类型,确定参考邻近样本,其中,不同纹理特征类型对应不同方位的参考邻近样本;基于所述参考邻近样本,确定所述当前块的所述估计值。
- 根据权利要求8所述的方法,其特征在于,所述基于所述当前块对应的纹理特征类型和所述邻近样本,确定所述当前块的所述估计值,包括:基于所述当前块对应的纹理特征类型,确定样本权重组合,所述样本权重组合中包含不同邻近样本对应的样本权重,且不同纹理特征类型对应不同的样本权重组合;基于所述样本权重组合和参考邻近样本,确定所述当前块的所述估计值,其中,不同纹理特征类型对应相同方位的参考邻近样本。
- 根据权利要求1所述的方法,其特征在于,所述基于当前块的预测值、假设的残差值以及邻近样本,确定所述当前块的连续性代价,包括:对于当前块中的组,基于组的所述预测值、所述假设的残差值以及所述邻近样本,确定组的连续性代价;基于至少一个组的连续性代价确定所述当前块的连续性代价。
- 根据权利要求12所述的方法,其特征在于,所述当前块的上边缘样本和下边缘样本属于同一组;或,所述当前块的上边缘样本属于第一组,且所述当前块的左边缘样本属于第二组;或,所述当前块中n个连续的边缘样本属于同一组,n为正整数,所述边缘样本属于所述当前块的上边缘样本和下边缘样本;或,所述当前块中p个连续的上边缘样本属于同一组,所述当前块中q个连续的左边缘样本属于同一处理单元,p和q均为正整数。
- 根据权利要求1所述的方法,其特征在于,所述假设的残差值根据量化系数的假设的正负号组合确定得到,或,所述假设的残差值根据量化系数的假设的变换核确定得到。
- 一种解码方法,其特征在于,所述方法包括:确定当前块的预测值;根据量化系数的假设的正负号组合,对所述量化系数进行反变换处理,得到所述当前块的假设的残差值;基于所述当前块的所述预测值、所述假设的残差值以及邻近样本,确定所述当前块在所述假设的正负号组合下的连续性代价;根据最小连续性代价对应的所述假设的正负号组合对码流进行解码。
- 一种解码方法,其特征在于,所述方法包括:确定当前块的预测值;根据量化系数的假设的变换核,对所述量化系数进行反变换处理,得到所述当前块的假设的残差值;基于所述当前块的所述预测值、所述假设的残差值以及邻近样本,确定所述当前块在所述假设的变换核下的连续性代价;根据所述连续性代价从所述假设的变换核中确定变换核,并基于确定出的变换核对码流进行解码。
- 一种解码器,其特征在于,所述解码器包括:解码单元,用于基于当前块的预测值、假设的残差值以及邻近样本,确定所述当前块的连续性代价。
- 一种解码器,其特征在于,所述解码器包括:解码单元,用于确定当前块的预测值;所述解码单元,用于根据量化系数的假设的正负号组合,对所述量化系数进行反变换处理,得到所述当前块的假设的残差值;所述解码单元,用于基于所述当前块的所述预测值、所述假设的残差值以及邻近样本,确定所述当前块在所述假设的正负号组合下的连续性代价;所述解码单元,用于根据最小连续性代价对应的所述假设的正负号组合对码流进行解码。
- 一种解码器,其特征在于,所述解码器包括:解码单元,用于确定当前块的预测值;所述解码单元,用于根据量化系数的假设的变换核,对所述量化系数进行反变换处理,得到所述当前块的假设的残差值;所述解码单元,用于基于所述当前块的所述预测值、所述假设的残差值以及邻近样本,确定所述当前块在所述假设的变换核下的连续性代价;所述解码单元,用于根据所述连续性代价从所述假设的变换核中确定变换核,并基于确定出的变换核对码流进行解码。
- 一种解码器,其特征在于,所述解码器包括存储器和处理器,所述存储器,用于存储在所述处理器上运行的计算机程序;所述处理器,用于在运行所述计算机程序时,执行如权利要求1至14任一所述的连续性代价确定方法,或,权利要求15所述的解码方法,或权利要求16所述的解码方法。
- 一种存储码流的非易失性计算机可读存储介质,其特征在于,所述码流通过利用解码器的解码方法而解码,其中,所述解码方法为如权利要求15或16所述的解码方法。
- 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机指令,所述计算机指令存储在计算机可读存储介质中,处理器从所述计算机可读存储介质中获取所述计算机指令,所述处理器执行所述计算机指令以实现如权利要求1至14任一所述的连续性代价确定方法,或,权利要求15所述的解码方法,或权利要求16所述的解码方法。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2024/083833 WO2025199745A1 (zh) | 2024-03-26 | 2024-03-26 | 连续性代价确定方法、解码方法、装置及存储介质 |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2024/083833 WO2025199745A1 (zh) | 2024-03-26 | 2024-03-26 | 连续性代价确定方法、解码方法、装置及存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025199745A1 true WO2025199745A1 (zh) | 2025-10-02 |
Family
ID=97219341
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/083833 Pending WO2025199745A1 (zh) | 2024-03-26 | 2024-03-26 | 连续性代价确定方法、解码方法、装置及存储介质 |
Country Status (1)
| Country | Link |
|---|---|
| WO (1) | WO2025199745A1 (zh) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2012144876A2 (ko) * | 2011-04-21 | 2012-10-26 | 한양대학교 산학협력단 | 인루프 필터링을 적용한 예측 방법을 이용한 영상 부호화/복호화 방법 및 장치 |
| CN111819852A (zh) * | 2018-03-07 | 2020-10-23 | 华为技术有限公司 | 用于变换域中残差符号预测的方法及装置 |
| CN112261409A (zh) * | 2019-07-22 | 2021-01-22 | 中兴通讯股份有限公司 | 残差编码、解码方法及装置、存储介质及电子装置 |
| CN116418979A (zh) * | 2022-01-07 | 2023-07-11 | 联发科技股份有限公司 | 视频编解码方法及相关装置 |
-
2024
- 2024-03-26 WO PCT/CN2024/083833 patent/WO2025199745A1/zh active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2012144876A2 (ko) * | 2011-04-21 | 2012-10-26 | 한양대학교 산학협력단 | 인루프 필터링을 적용한 예측 방법을 이용한 영상 부호화/복호화 방법 및 장치 |
| CN111819852A (zh) * | 2018-03-07 | 2020-10-23 | 华为技术有限公司 | 用于变换域中残差符号预测的方法及装置 |
| CN112261409A (zh) * | 2019-07-22 | 2021-01-22 | 中兴通讯股份有限公司 | 残差编码、解码方法及装置、存储介质及电子装置 |
| CN116418979A (zh) * | 2022-01-07 | 2023-07-11 | 联发科技股份有限公司 | 视频编解码方法及相关装置 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR100234316B1 (ko) | 링잉노이즈 감소를 위한 신호적응 필터링 방법 및 신호적응필터 | |
| CN115604488B (zh) | 环路滤波的方法与装置 | |
| CN117676133B (zh) | 帧内预测方法、编码器、解码器以及存储介质 | |
| CN112544081B (zh) | 环路滤波的方法与装置 | |
| TWI800752B (zh) | 解碼影像資料的方法、編碼影像資料的方法及儲存編碼影片資訊的非暫態電腦可讀取儲存媒介 | |
| CN116569546A (zh) | 帧内预测方法、编码器、解码器以及存储介质 | |
| CN108605143A (zh) | 视频编码中的非局部自适应环内滤波器的方法和装置 | |
| CN114868386B (zh) | 编码方法、解码方法、编码器、解码器以及电子设备 | |
| US20180184128A1 (en) | Non-local adaptive loop filter combining multiple denoising technologies and grouping image patches in parallel | |
| WO2022116113A1 (zh) | 一种帧内预测方法、装置及解码器和编码器 | |
| WO2023193253A1 (zh) | 解码方法、编码方法、解码器以及编码器 | |
| WO2024007116A1 (zh) | 解码方法、编码方法、解码器以及编码器 | |
| WO2022178686A1 (zh) | 编解码方法、编解码设备、编解码系统以及计算机可读存储介质 | |
| WO2020182104A1 (zh) | 进行编码和解码的方法、解码装置和编码装置 | |
| CN119013978A (zh) | 视频编码的跨分量模型调整 | |
| CN115834882A (zh) | 一种帧内预测方法、装置、电子设备及存储介质 | |
| CN116456086A (zh) | 环路滤波方法、视频编解码方法、装置、介质及电子设备 | |
| US20240333923A1 (en) | Image encoding/decoding method using neural network-based in-loop filter, device, and recording medium storing bitstream | |
| CN109565592B (zh) | 一种使用基于分割的视频编码块划分的视频编码设备和方法 | |
| WO2023193254A1 (zh) | 解码方法、编码方法、解码器以及编码器 | |
| WO2025199745A1 (zh) | 连续性代价确定方法、解码方法、装置及存储介质 | |
| JP2025512076A (ja) | デコーディング方法、エンコーディング方法、デコーダー及びエンコーダー | |
| CN113196762B (zh) | 图像分量预测方法、装置及计算机存储介质 | |
| CN118511514A (zh) | 跨分量样点自适应偏移 | |
| CN116982262A (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: 24931642 Country of ref document: EP Kind code of ref document: A1 |