EP-4742662-A1 - INTRA-PREDICTION METHOD AND APPARATUS, AND DEVICE
Abstract
The present application relates to the technical field of encoding and decoding, and discloses an intra-prediction method and apparatus, and a device. The method in embodiments of the present application comprises: performing filtering processing on template pixels corresponding to a target image block to obtain filtered template pixels, wherein the template pixels comprise at least some reconstructed pixels within an adjacent pixel region of the target image block; on the basis of the filtered template pixels, acquiring at least one intra-prediction mode and the amplitude of the at least one intra-prediction mode; on the basis of the amplitude of the at least one intra-prediction mode, determining a target intra-prediction mode among the at least one intra-prediction mode; and on the basis of the target intra-prediction mode, determining a target prediction value corresponding to the target image block.
Inventors
- ZHOU, CHUAN
- LV, Zhuoyi
Assignees
- Vivo Mobile Communication Co., Ltd.
Dates
- Publication Date
- 20260513
- Application Date
- 20240701
Claims (20)
- An intra prediction method, comprising: performing filtering processing on template samples corresponding to a target image block to obtain filtered template samples, wherein the template samples comprise at least part of reconstructed samples in a neighboring sample region of the target image block; obtaining, based on the filtered template samples, at least one intra prediction mode and an amplitude of the at least one intra prediction mode; determining, based on the amplitude of the at least one intra prediction mode, a target intra prediction mode from the at least one intra prediction mode; and determining, based on the target intra prediction mode, a target prediction value corresponding to the target image block.
- The method according to claim 1, wherein the obtaining, based on the filtered template samples, at least one intra prediction mode and an amplitude of the at least one intra prediction mode comprises: obtaining, based on the filtered template samples, a template sample histogram, wherein the template sample histogram is used to indicate a correspondence between an identifier of at least one intra prediction mode and an amplitude of the intra prediction mode; and obtaining, based on the template sample histogram, the at least one intra prediction mode and the amplitude of the at least one intra prediction mode.
- The method according to claim 1 or 2, wherein the performing filtering processing on template samples corresponding to a target image block to obtain filtered template samples comprises: when a filtering identifier corresponding to the target image block is a first filtering identifier, performing filtering processing on the template samples corresponding to the target image block to obtain the filtered template samples, wherein the first filtering identifier is used to indicate to perform filtering processing on the template samples corresponding to the target image block; or when a value of a first target parameter of the template samples is less than or equal to a preset threshold, performing filtering processing on the template samples corresponding to the target image block to obtain the filtered template samples; wherein the first target parameter comprises at least one of noise intensity, image energy, and image entropy.
- The method according to claim 3, wherein the method further comprises: when the value of the first target parameter of the template samples is less than or equal to the preset threshold, determining that the filtering identifier corresponding to the target image block is the first filtering identifier.
- The method according to any one of claims 1 to 4, wherein the performing filtering processing on template samples corresponding to a target image block to obtain filtered template samples comprises: determining a target filter based on a target filtering strength identifier corresponding to the target image block, wherein the target filter corresponds to the target filtering strength identifier, or determining a target filter based on a value of a second target parameter of the template samples, wherein the second target parameter comprises at least one of noise intensity, image energy, and image entropy; and performing filtering processing on the template samples corresponding to the target image block based on the target filter to obtain the filtered template samples.
- The method according to claim 5, wherein the method further comprises: determining, based on the second target parameter of the template samples, the target filtering strength identifier corresponding to the target image block, wherein different noise intensities correspond to different target filtering strength identifiers.
- The method according to any one of claims 1 to 6, wherein the performing filtering processing on template samples corresponding to a target image block to obtain filtered template samples comprises: when a template position identifier of the template samples is a first position identifier, performing filtering processing on a first part of samples in the template samples to obtain the filtered template samples; or when the template position identifier of the template samples is a second position identifier, performing filtering processing on a second part of samples in the template samples to obtain the filtered template samples; or when the template position identifier of the template samples is a third position identifier, performing filtering processing on a first part of samples and a second part of samples in the template samples to obtain the filtered template samples; or performing filtering on a part of samples with a smaller noise intensity among a first part of samples and a second part of samples to obtain the filtered template samples; wherein the first part of samples comprises samples in a first direction of the target image block in the template samples, and the second part of samples comprises samples in a second direction of the target image block in the template samples.
- The method according to any one of claims 1 to 7, wherein the determining, based on the amplitude of the at least one intra prediction mode, a target intra prediction mode from the at least one intra prediction mode comprises: selecting M intra prediction modes with the largest amplitude from at least two intra prediction modes as the target intra prediction modes, wherein M is a positive integer.
- The method according to any one of claims 1 to 8, wherein the determining, based on the target intra prediction mode, a target prediction value corresponding to the target image block comprises: when the target intra prediction mode comprises at least two prediction modes, obtaining a prediction value obtained by predicting the target image block based on each of the prediction modes; and obtaining the target prediction value of the target image block based on the at least two prediction values.
- An intra prediction apparatus, comprising: a processing module configured to perform filtering processing on template samples corresponding to a target image block to obtain filtered template samples, wherein the template samples comprise at least part of reconstructed samples in a neighboring sample region of the target image block; a first obtaining module configured to obtain, based on the filtered template samples, at least one intra prediction mode and an amplitude of the at least one intra prediction mode; a first determining module configured to determine, based on the amplitude of the at least one intra prediction mode, a target intra prediction mode from the at least one intra prediction mode; and a second determining module configured to determine, based on the target intra prediction mode, a target prediction value corresponding to the target image block.
- The apparatus according to claim 10, wherein the first obtaining module comprises: a first obtaining sub-module configured to obtain, based on the filtered template samples, a template sample histogram, wherein the template sample histogram is used to indicate a correspondence between an identifier of at least one intra prediction mode and an amplitude of the intra prediction mode; and a second obtaining sub-module configured to obtain, based on the template sample histogram, the at least one intra prediction mode and the amplitude of the at least one intra prediction mode.
- The apparatus according to claim 10 or 11, wherein the processing module is configured to: when a filtering identifier corresponding to the target image block is a first filtering identifier, perform filtering processing on the template samples corresponding to the target image block to obtain the filtered template samples, wherein the first filtering identifier is used to indicate to perform filtering processing on the template samples corresponding to the target image block; or when a value of a first target parameter of the template samples is less than or equal to a preset threshold, perform filtering processing on the template samples corresponding to the target image block to obtain the filtered template samples; wherein the first target parameter comprises at least one of noise intensity, image energy, and image entropy.
- The apparatus according to claim 12, wherein the apparatus further comprises: a third determining module configured to, when the value of the first target parameter of the template samples is less than or equal to the preset threshold, determine that the filtering identifier corresponding to the target image block is the first filtering identifier.
- The apparatus according to any one of claims 10 to 13, wherein the processing module comprises: a first determining sub-module configured to determine a target filter based on a target filtering strength identifier corresponding to the target image block, wherein the target filter corresponds to the target filtering strength identifier, or determine a target filter based on a value of a second target parameter of the template samples, wherein the second target parameter comprises at least one of noise intensity, image energy, and image entropy; and a third obtaining sub-module configured to perform filtering processing on the template samples corresponding to the target image block based on the target filter to obtain the filtered template samples.
- The apparatus according to claim 14, wherein the apparatus further comprises: a fourth determining module configured to determine, based on the second target parameter of the template samples, the target filtering strength identifier corresponding to the target image block, wherein different noise intensities correspond to different target filtering strength identifiers.
- The apparatus according to any one of claims 10 to 15, wherein the processing module is configured to: when a template position identifier of the template samples is a first position identifier, perform filtering processing on a first part of samples in the template samples to obtain the filtered template samples; or when the template position identifier of the template samples is a second position identifier, perform filtering processing on a second part of samples in the template samples to obtain the filtered template samples; or when the template position identifier of the template samples is a third position identifier, perform filtering processing on a first part of samples and a second part of samples in the template samples to obtain the filtered template samples; or perform filtering on a part of samples with a smaller noise intensity among a first part of samples and a second part of samples to obtain the filtered template samples; wherein the first part of samples comprises samples in a first direction of the target image block in the template samples, and the second part of samples comprises samples in a second direction of the target image block in the template samples.
- The apparatus according to any one of claims 10 to 16, wherein the first determining module is configured to: select M intra prediction modes with the largest amplitude from at least two intra prediction modes as the target intra prediction modes, wherein M is a positive integer.
- The apparatus according to any one of claims 10 to 17, wherein the second determining module is configured to: when the target intra prediction mode comprises at least two prediction modes, obtain a prediction value obtained by predicting the target image block based on each of the prediction modes; and obtain the target prediction value of the target image block based on the at least two prediction values.
- An electronic device, comprising a processor and a memory, wherein the memory stores a program or instructions capable of running on the processor, and when the program or instructions are executed by the processor, the steps of the intra prediction method according to any one of claims 1 to 9 are implemented.
- A readable storage medium, wherein the readable storage medium stores a program or instructions, and when the program or instructions are executed by a processor, the steps of the intra prediction method according to any one of claims 1 to 9 are implemented.
Description
CROSS-REFERENCE TO RELATED APPLICATIONS This application claims priority to Chinese Patent Application No. 202310818030.2, filed with the China National Intellectual Property Administration on July 4, 2023, which is incorporated herein by reference in its entirety. TECHNICAL FIELD This application pertains to the technical field of encoding and decoding, and specifically relates to an intra prediction method and apparatus, and a device. BACKGROUND In the related decoder-side intra mode derivation (DIMD) technology, a decoder applies horizontal and vertical Sobel filters to samples in a template with a width of N around a block to perform gradient histogram calculation, then converts a gradient direction into an intra angular prediction mode, accumulates gradient intensities as an amplitude of a corresponding intra angular mode, and derives an intra prediction mode by comparing amplitudes in a gradient histogram. Due to the diversity of image textures in real video scenes, the amplitudes in the histogram calculated based on the above method tend to be relatively dispersed, making it difficult to obtain a dominant texture direction in the histogram. This results in low prediction accuracy of the prediction mode determined based on the histogram. SUMMARY Embodiments of this application provide an intra prediction method and apparatus, and a device, so as to solve the prior-art problem that a prediction mode determined based on a histogram has a low prediction accuracy. According to a first aspect, an intra prediction method is provided, including: performing filtering processing on template samples corresponding to a target image block to obtain filtered template samples, where the template samples include at least part of reconstructed samples in a neighboring sample region of the target image block;obtaining, based on the filtered template samples, at least one intra prediction mode and an amplitude of the at least one intra prediction mode;determining, based on the amplitude of the at least one intra prediction mode, a target intra prediction mode from the at least one intra prediction mode; anddetermining, based on the target intra prediction mode, a target prediction value corresponding to the target image block. According to a second aspect, an intra prediction apparatus is provided, including: a processing module configured to perform filtering processing on template samples corresponding to a target image block to obtain filtered template samples, where the template samples include at least part of reconstructed samples in a neighboring sample region of the target image block;a first obtaining module configured to obtain, based on the filtered template samples, at least one intra prediction mode and an amplitude of the at least one intra prediction mode;a first determining module configured to determine, based on the amplitude of the at least one intra prediction mode, a target intra prediction mode from the at least one intra prediction mode; anda second determining module configured to determine, based on the target intra prediction mode, a target prediction value corresponding to the target image block. According to a third aspect, an electronic device is provided. The electronic device includes a processor and a memory, where the memory stores a program or instructions capable of running on the processor, and when the program or instructions are executed by the processor, the steps of the method according to the first aspect are implemented. According to a fourth aspect, an electronic device is provided, including a processor and a communication interface, where the processor is configured to: perform filtering processing on template samples corresponding to a target image block to obtain filtered template samples, where the template samples include at least part of reconstructed samples in a neighboring sample region of the target image block; obtain, based on the filtered template samples, at least one intra prediction mode and an amplitude of the at least one intra prediction mode; determine, based on the amplitude of the at least one intra prediction mode, a target intra prediction mode from the at least one intra prediction mode; and determine, based on the target intra prediction mode, a target prediction value corresponding to the target image block. According to a fifth aspect, a readable storage medium is provided, where the readable storage medium stores a program or instructions, and when the program or instructions are executed by a processor, the steps of the method according to the first aspect are implemented. According to a sixth aspect, a chip is provided. The chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to run a program or instructions to implement the method according to the first aspect. According to a seventh aspect, a computer program/program product is provided, where th