US-20260129193-A1 - INTRA-PREDICTION METHOD AND APPARATUS, AND DEVICE
Abstract
An intra prediction method includes: 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; and determining, based on the target intra prediction mode, a target prediction value corresponding to the target image block.
Inventors
- Chuan Zhou
- Zhuoyi Lv
Assignees
- VIVO MOBILE COMMUNICATION CO., LTD.
Dates
- Publication Date
- 20260507
- Application Date
- 20251230
- Priority Date
- 20230704
Claims (20)
- 1 . 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.
- 2 . 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.
- 3 . The method according to claim 1 , 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, or image entropy.
- 4 . 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.
- 5 . The method according to claim 1 , 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, or 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.
- 6 . 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.
- 7 . The method according to claim 1 , 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.
- 8 . The method according to claim 1 , 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.
- 9 . The method according to claim 1 , 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.
- 10 . An electronic device, comprising at least one hardware processor and a memory, wherein the memory stores a program or instructions capable of running on the at least one hardware processor, and when the program or instructions are executed by the at least one hardware processor, the at least one hardware processor is directed 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; 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.
- 11 . The electronic device according to claim 10 , wherein the at least one hardware processor is further directed 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 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.
- 12 . The electronic device according to claim 10 , wherein the at least one hardware processor is further directed 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, or image entropy.
- 13 . The electronic device according to claim 12 , wherein the at least one hardware processor is further directed 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.
- 14 . The electronic device according to claim 10 , wherein the at least one hardware processor is further directed 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, or image entropy; and perform filtering processing on the template samples corresponding to the target image block based on the target filter to obtain the filtered template samples.
- 15 . The electronic device according to claim 14 , wherein the at least one hardware processor is further directed 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.
- 16 . The electronic device according to claim 10 , wherein the at least one hardware processor is further directed 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.
- 17 . The electronic device according to claim 10 , wherein the at least one hardware processor is further directed 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.
- 18 . The electronic device according to claim 10 , wherein the at least one hardware processor is further directed 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.
- 19 . A non-transitory computer-readable storage medium having a program or instructions stored thereon that, when executed by at least one hardware processor, an intra prediction method is implemented, 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.
- 20 . A chip, comprising a processor and a communication interface, wherein 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 claim 1 .
Description
CROSS-REFERENCE TO RELATED APPLICATIONS This application is a bypass continuation application of International Application No. PCT/CN2024/102805, filed on Jul. 1, 2024, which claims the benefit of and priority to Chinese (CN) Patent Application No. 202310818030.2, filed on Jul. 4, 2023. The foregoing applications are incorporated by reference in their entireties herein. TECHNICAL FIELD This application relates to the technical field of encoding and decoding and, more specifically, relates to an intra prediction method and apparatus, and a device. BACKGROUND In related decoder-side intra mode derivation (DIMD) techniques, a decoder applies horizontal and vertical Sobel filters to samples within a template of width N surrounding a block to compute a gradient histogram. The decoder then maps each gradient direction to a corresponding intra angular prediction mode, accumulates gradient intensities as an amplitude of each intra angular mode, and derives an intra prediction mode by comparing amplitudes in the gradient histogram. BRIEF SUMMARY 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 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 third aspect, a non-transitory 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, an intra prediction method is implemented and includes: 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; and determining, based on the target intra prediction mode, a target prediction value corresponding to the target image block. BRIEF DESCRIPTION OF DRAWINGS FIG. 1 is a schematic flowchart of an intra prediction method according to an embodiment of this application; FIG. 2 is a first schematic diagram of filtered template samples according to an embodiment of this application; FIG. 3 is a second schematic diagram of filtered template samples according to an embodiment of this application; FIG. 4 is a schematic diagram showing a first part of samples and a second part of samples according to an embodiment of this application; FIG. 5 is a schematic diagram showing modules of an intra prediction apparatus according to an embodiment of this application; FIG. 6 is a structural block diagram of an electronic device according to an embodiment of this application; and FIG. 7 is a structural block diagram of a terminal according to an embodiment of this application. DETAILED DESCRIPTION The following describes the technical solutions in the embodiments of this application clearly with reference to the accompanying drawings in the embodiments of this application. Understandably, the described embodiments are some but not all of the embodiments of this application. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments of this application fall within the protection scope of this application. The terms “first”, “second”, and the like in this application are used to