Image coding method, apparatus and electronic device

CN117793358BActive Publication Date: 2026-09-22LENOVO (BEIJING) LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311865394.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2026-09-22
Estimated Expiration
2043-12-29

AI Technical Summary

Technical Problem

[0002]作为一种特殊的图像编码,屏幕内容编码采用的主流编码器的编码复杂度通常较高,无法满足共享屏幕,远程桌面等实时场景的实时编码要求

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117793358B_ABST
    Figure CN117793358B_ABST
Patent Text Reader

Abstract

The application provides an image coding method, device and electronic equipment, wherein the image coding method comprises the following steps: acquiring an image block in a to-be-processed image; determining gradient information of two directions of the image block; determining a coding strategy of the image block based on the gradient information of the two directions of the image block; determining a prediction value by using the coding strategy of the image block; and coding the image block by using the prediction value, wherein the prediction value is used to determine pixel values of each pixel in the image block after coding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image coding technology, and in particular to an image coding method, apparatus, and electronic device. 。 Background Technology

[0002] As a special type of image encoding, screen content encoding typically employs mainstream encoders with high encoding complexity, which cannot meet the real-time encoding requirements of real-time scenarios such as screen sharing and remote desktops.

[0003] Although some methods for accelerating intra-frame coding have emerged, these methods are mainly for natural videos, and some of them use deep neural networks for acceleration, resulting in high computational complexity and making them unsuitable for real-time coding scenarios. Summary of the Invention

[0004] In view of the above, this application provides an image encoding method, apparatus, and electronic device, the technical solution of which is as follows:

[0005] An image encoding method, comprising:

[0006] Extract image patches from the image to be processed;

[0007] Determine the gradient information of the image patch in two directions;

[0008] Based on the gradient information of the image block in two directions, the encoding strategy of the image block is determined;

[0009] The predicted value is determined using the encoding strategy of the image block;

[0010] The image block is encoded using the predicted value, which is used to determine the pixel value of each pixel in the image block after encoding.

[0011] In one possible implementation, the two directions include a first direction and a second direction that are perpendicular to each other.

[0012] In one possible implementation, the encoding strategy of the image patch is determined based on gradient information in two directions, including:

[0013] When the gradients in the first and second directions of the image block are both less than a first preset threshold, the encoding strategy for the image block is as follows:

[0014] The average value of multiple associated reference pixels of the image patch is used as the predicted value of the image patch.

[0015] In one possible implementation, the encoding strategy of the image patch is determined based on gradient information in two directions, including at least one of the following:

[0016] If the gradient of the image block in the first direction is less than a first preset threshold, the encoding strategy of the image block is: to use the value of the reference pixel in the first direction of the image block as the predicted value of the image block;

[0017] If the gradient in the second direction of the image block is less than a first preset threshold, the encoding strategy for the image block is to use the value of the reference pixel in the second direction of the image block as the predicted value of the image block.

[0018] In one possible implementation, the encoding strategy of the image patch is determined based on gradient information in two directions, including:

[0019] When the gradients in the first and second directions of the image block are both greater than a second preset threshold, the encoding strategy for the image block is as follows:

[0020] The image block is divided into multiple sub-image blocks using a preset division method corresponding to the minimum depth value;

[0021] Intra-frame prediction mode is determined based on minimizing coding rate distortion cost;

[0022] The sub-image blocks are processed using the intra-frame prediction mode to obtain the predicted value for each sub-image block.

[0023] In one possible implementation, the method further includes:

[0024] Obtain the gradient of the third direction of the image patch;

[0025] The predicted value of the image patch is determined based on the gradient of the third direction.

[0026] In one possible implementation, the third direction can be multiple; determining the predicted value of the image patch based on the gradient of the third direction includes:

[0027] Determine the target third direction from multiple third directions that satisfies the gradient conditions;

[0028] Determine the angle corresponding to the target third direction;

[0029] Obtain the reference pixel above the angle;

[0030] The weighted sum of the value of the upper reference pixel and the values ​​of its neighboring reference pixels is determined as the predicted value of the image patch.

[0031] In one possible implementation, determining the gradient information of the image patch in two directions includes:

[0032] The rate of change of each pixel in the image block relative to its adjacent pixels in the first direction is determined to obtain the gradient of each pixel in the first direction;

[0033] The gradient of the image block in the first direction is obtained by summing the gradients of each pixel in the first direction.

[0034] Determine the rate of change of each pixel in the image patch relative to its adjacent pixels in the second direction, and obtain the gradient of each pixel in the second direction;

[0035] The gradient of the second direction of each pixel in the image block is obtained by summing the gradients of the second direction of the image block.

[0036] An image encoding device, comprising:

[0037] The acquisition unit is used to acquire image patches in the image to be processed;

[0038] The first determining unit is used to determine the gradient information of the image block in two directions;

[0039] The second determining unit is used to determine the encoding strategy of the image block based on the gradient information of the image block in two directions;

[0040] The third determining unit is used to determine the predicted value using the encoding strategy of the image block;

[0041] An encoding unit is used to encode the image block using the predicted value, wherein the predicted value is used to determine the pixel value of each pixel in the image block after encoding.

[0042] An electronic device includes a memory and a processor, wherein the memory stores an executable program, and the processor executes the executable program to implement the steps of the method according to the embodiments of this application. Attached Figure Description

[0043] Figure 1 This is a flowchart of an image encoding method according to an embodiment of this application;

[0044] Figure 2 This is a functional structure diagram of the image encoding device according to an embodiment of this application;

[0045] Figure 3 This is a functional structure diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0046] Various embodiments and features of this application are described herein with reference to the accompanying drawings.

[0047] It should be understood that various modifications can be made to the embodiments described herein. Therefore, the above description should not be considered as limiting, but merely as an example of embodiments. Other modifications within the scope and spirit of this application will be apparent to those skilled in the art.

[0048] The accompanying drawings, which are included in and form part of this specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.

[0049] These and other features of this application will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.

[0050] It should also be understood that although this application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this application.

[0051] The above and other aspects, features and advantages of this application will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.

[0052] Specific embodiments of this application are described thereafter with reference to the accompanying drawings; however, it should be understood that the claimed embodiments are merely examples of this application, which can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that could obscure the application. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as the basis and representative basis for the claims to teach those skilled in the art to use this application in a variety of substantially any suitable detailed structures.

[0053] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in other embodiments,” all of which may refer to one or more of the same or different embodiments according to this application.

[0054] First, a brief introduction to the design concept of the embodiments of this application will be given.

[0055] As a special type of image, screen content images are images generated by electronic devices. They are captured from the image display units of various devices (such as computers, mobile terminals, etc.), such as computer graphic text, hybrid images combining natural images and graphic text, and computer-generated animations.

[0056] To improve the compression efficiency of screen content coding, high efficiency video coding (HEVC) and screen content coding (SCC) were developed.

[0057] In HEVC SCC encoding, a frame of screen content image is usually divided into multiple coding tree units (CTUs), and then each CTU is divided into multiple code units. The screen content is encoded using IntraBlock Copy (IBC) mode. IBC technology determines the matching target reference block in the effective search area of ​​the target code unit to be processed.

[0058] Since most mainstream encoders are designed for natural video encoding and perform well for it, they do not offer significant gains in encoding screen content.

[0059] Furthermore, intra-frame coding presents significant complexity in mainstream encoders. This complexity stems from several factors: for a single Largest Coding Unit (LCU) block, it requires N-ary tree partitioning into N sub-blocks. Rate Distortion Optimization (RDO) calculations are then performed on both the parent and sub-blocks to select the optimal partitioning method. After block partitioning, the intra-frame coding mode must be selected for each block, also calculated using RDO. HEVC offers 35 intra-frame coding modes, resulting in a massive computational burden.

[0060] However, for screen content encoding, especially in real-time scenarios such as screen sharing and remote desktops, the encoding complexity of current mainstream encoders is so high that they cannot meet the real-time requirements.

[0061] Current methods for intra-frame acceleration of screen content only consider the overall complexity of the current encoding LCU, without taking into account the complexity of the LCU in the horizontal and vertical directions. However, in real-time screen content scenarios, horizontal and vertical bars (window edges) frequently appear. These graphics have almost zero complexity in one direction, making them ideal for skipping block partitioning and directly using H / V mode for intra-frame encoding. This can accelerate real-time intra-frame encoding with low computational complexity. Furthermore, for text scenes where intra-frame encoding complexity is particularly high, directly partitioning the current LCU to the lowest depth for encoding instead of encoding other depths can also significantly accelerate intra-frame encoding.

[0062] To address the technical problem that existing image encoding methods cannot meet real-time encoding requirements and are unsuitable for real-time encoding scenarios, this application provides an image encoding method for frequently occurring regular graphics in screen content, such as solid color (blurred) background blocks, scroll bars, window edges, and text. This method calculates two gradients of an image block to determine which category of the aforementioned regular graphics it belongs to, and directly encodes the image block according to a pre-determined encoding strategy. This eliminates the need for complex RDO calculations to select the encoding mode, effectively reducing computational load and making it suitable for real-time encoding scenarios.

[0063] After introducing the application scenarios and design concepts of the embodiments of this application, the technical solutions provided by the embodiments of this application will be described below.

[0064] In this embodiment of the application, the executing entity can be an electronic device used for image encoding. The electronic device can be a server or a terminal device.

[0065] like Figure 1 As shown, this application provides an image encoding method, including:

[0066] Step 101: Obtain image patches from the image to be processed;

[0067] For example, the image to be processed can be divided into multiple maximum coding unit blocks of 64×64, and the maximum coding unit blocks can be used as image blocks.

[0068] Step 102: Determine the gradient information of the image patch in two directions;

[0069] Step 103: Determine the encoding strategy of the image block based on the gradient information in two directions of the image block;

[0070] The coding strategy is intra-frame predictive coding, which uses the already encoded pixels of the current image to predict the current pixel, and then uses the difference between the predicted value and the actual value of the current pixel as the input of the subsequent coding module.

[0071] Step 104: Determine the predicted value using the encoding strategy of the image block;

[0072] Step 105: Encode the image block using the predicted value, which is used to determine the pixel value of each pixel in the image block after encoding.

[0073] This application determines the corresponding coding strategy by using the gradient information of image blocks, which can effectively reduce computational complexity, accelerate real-time intra-frame coding, and is suitable for scenarios with high requirements for real-time coding performance.

[0074] Furthermore, the two directions include a first direction and a second direction that are perpendicular to each other.

[0075] For example, the first direction is the row direction and the second direction is the column direction; or, the first direction is the column direction and the second direction is the row direction.

[0076] In some embodiments, the encoding strategy of the image patch is determined based on gradient information in two directions, including:

[0077] When the gradients in the first and second directions of the image block are both less than a first preset threshold, the encoding strategy for the image block is as follows:

[0078] The average value of multiple associated reference pixels of the image patch is used as the predicted value of the image patch.

[0079] For example, when the gradients in the first and second directions of the image block are both less than a first preset threshold, the image block is likely to be a solid color block or a blurry block. The encoding strategy is to not further divide the image block and directly select DC (direct current) prediction as the intra-frame coding mode; thereby skipping all other RDO operations that select coding modes, thus reducing the amount of computation.

[0080] In some embodiments, the encoding strategy of the image patch is determined based on gradient information in two directions, including at least one of the following:

[0081] If the gradient of the image block in the first direction is less than a first preset threshold, the encoding strategy of the image block is: to use the value of the reference pixel in the first direction of the image block as the predicted value of the image block;

[0082] If the gradient in the second direction of the image block is less than a first preset threshold, the encoding strategy for the image block is to use the value of the reference pixel in the second direction of the image block as the predicted value of the image block.

[0083] For example, if the gradient of the first direction of the image block is less than the first preset threshold, or the gradient of the second direction of the image block is less than the first preset threshold, then the image block is likely to be a scene such as a scroll bar or window edge. The encoding strategy is to not divide the image block, and directly select H prediction or V prediction, that is, copy the reference pixel on the left or top of the current image block as the prediction value of the image block, thereby skipping all other RDO operations with selected encoding modes, thereby reducing the amount of computation.

[0084] In some embodiments, the encoding strategy of the image patch is determined based on gradient information in two directions, including:

[0085] When the gradients in the first and second directions of the image block are both greater than a second preset threshold, the encoding strategy for the image block is as follows:

[0086] The image block is divided into multiple sub-image blocks using a preset division method corresponding to the minimum depth value;

[0087] Intra-frame prediction mode is determined based on minimizing coding rate distortion cost;

[0088] The sub-image blocks are processed using the intra-frame prediction mode to obtain the predicted value for each sub-image block.

[0089] For example, when the gradient of the first direction and the gradient of the second direction of the image block are both greater than the second preset threshold, it indicates that the gradient change of the image block is very drastic, and the image block is likely to be text. In this case, the image block is directly defined as the minimum depth, without performing RDO selection for other depths.

[0090] In some embodiments, the method further includes:

[0091] Obtain the gradient of the third direction of the image patch;

[0092] The predicted value of the image patch is determined based on the gradient of the third direction.

[0093] For example, the third direction is any direction that is neither the first direction nor the second direction, and is determined by the shape of the image block.

[0094] Specifically, there are multiple third-party directions; determining the predicted value of the image patch based on the gradient of the third-party direction includes:

[0095] Determine the target third direction from multiple third directions that satisfies the gradient conditions;

[0096] Determine the angle corresponding to the target third direction;

[0097] Obtain the reference pixel above the angle;

[0098] The weighted sum of the value of the upper reference pixel and the values ​​of its neighboring reference pixels is determined as the predicted value of the image patch.

[0099] As one possible implementation, the third direction corresponding to the maximum or minimum value of multiple third-direction gradients can be used as the target third direction.

[0100] It should be noted that for image blocks that do not meet the above conditions, existing intra-frame predictive coding methods can be used for encoding.

[0101] In some embodiments, determining the gradient information of the image patch in two directions includes:

[0102] The rate of change of each pixel in the image block relative to its adjacent pixels in the first direction is determined to obtain the gradient of each pixel in the first direction;

[0103] The gradient of the image block in the first direction is obtained by summing the gradients of each pixel in the first direction.

[0104] Determine the rate of change of each pixel in the image patch relative to its adjacent pixels in the second direction, and obtain the gradient of each pixel in the second direction;

[0105] The gradient of the second direction of each pixel in the image block is obtained by summing the gradients of the second direction of the image block.

[0106] In the above steps, determining the rate of change of each pixel of the image block relative to its adjacent pixels in the row direction includes:

[0107] Determine the rate of change of the brightness of each pixel in the image block with the brightness of the pixel to the left of the pixel, and / or the rate of change of the brightness of each pixel in the image block with the brightness of the pixel to the right of the pixel.

[0108] In the above steps, determining the rate of change of each pixel of the image block relative to its adjacent pixels in the column direction includes:

[0109] Determine the rate of change of the brightness of each pixel in the image block with the brightness of the pixel above the pixel, and / or the rate of change of the brightness of each pixel in the image block with the brightness of the pixel below the pixel.

[0110] Based on the same inventive concept, embodiments of this application provide an image encoding device, such as... Figure 2 As shown, the image encoding device 200 includes:

[0111] Acquisition unit 201 is used to acquire image blocks in the image to be processed;

[0112] The first determining unit 202 is used to determine the gradient information of the image block in two directions;

[0113] The second determining unit 203 is used to determine the encoding strategy of the image block based on the gradient information of the image block in two directions;

[0114] The third determining unit 204 is used to determine the predicted value using the encoding strategy of the image block;

[0115] The encoding unit 205 is used to encode the image block using the predicted value, wherein the predicted value is used to determine the pixel value of each pixel in the image block after encoding.

[0116] In some embodiments, the two directions include a first direction and a second direction that are perpendicular to each other.

[0117] In some embodiments, the second determining unit is specifically used for:

[0118] When the gradients in the first and second directions of the image block are both less than a first preset threshold, the encoding strategy for the image block is as follows:

[0119] The average value of multiple associated reference pixels of the image patch is used as the predicted value of the image patch.

[0120] In some embodiments, the second determining unit is specifically used for:

[0121] If the gradient of the image block in the first direction is less than a first preset threshold, the encoding strategy for the image block is: to use the value of the reference pixel in the first direction of the image block as the predicted value of the image block; or,

[0122] If the gradient in the second direction of the image block is less than a first preset threshold, the encoding strategy for the image block is to use the value of the reference pixel in the second direction of the image block as the predicted value of the image block.

[0123] In some embodiments, the second determining unit is specifically used for:

[0124] When the gradients in the first and second directions of the image block are both greater than a second preset threshold, the encoding strategy for the image block is as follows:

[0125] The image block is divided into multiple sub-image blocks using a preset division method corresponding to the minimum depth value;

[0126] Intra-frame prediction mode is determined based on minimizing coding rate distortion cost;

[0127] The sub-image blocks are processed using the intra-frame prediction mode to obtain the predicted value for each sub-image block.

[0128] In some embodiments, the method further includes:

[0129] Obtain the gradient of the third direction of the image patch;

[0130] The predicted value of the image patch is determined based on the gradient of the third direction.

[0131] In one possible implementation, the third direction can be multiple; determining the predicted value of the image patch based on the gradient of the third direction includes:

[0132] Determine the target third direction from multiple third directions that satisfies the gradient conditions;

[0133] Determine the angle corresponding to the target third direction;

[0134] Obtain the reference pixel above the angle;

[0135] The weighted sum of the value of the upper reference pixel and the values ​​of its neighboring reference pixels is determined as the predicted value of the image patch.

[0136] In some embodiments, the first determining unit is specifically used for:

[0137] The rate of change of each pixel in the image block relative to its adjacent pixels in the first direction is determined to obtain the gradient of each pixel in the first direction;

[0138] The gradient of the image block in the first direction is obtained by summing the gradients of each pixel in the first direction.

[0139] Determine the rate of change of each pixel in the image patch relative to its adjacent pixels in the second direction, and obtain the gradient of each pixel in the second direction;

[0140] The gradient of the second direction of each pixel in the image block is obtained by summing the gradients of the second direction of the image block.

[0141] Based on the same inventive concept, embodiments of this application also provide an electronic device, such as... Figure 3 As shown, it includes: a memory and a processor, wherein the memory stores an executable program, and the processor executes the executable program to implement the steps of the image encoding method described above.

[0142] The aforementioned processor can be a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The aforementioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0143] Since the electronic device described in this application embodiment is an electronic device equipped with a memory for implementing the information processing method disclosed in this application embodiment, those skilled in the art can understand the structure and variations of the electronic device described in this application embodiment based on the information processing method described in this application embodiment, and therefore will not be described again here.

[0144] This application also provides a computer-readable storage medium storing a computer program thereon, which, when run by a processor, implements the steps of the image encoding method provided in any of the above embodiments.

[0145] The storage medium in this embodiment may be included in an electronic device; or it may exist independently and not be assembled into an electronic device. The storage medium carries one or more computer programs, which, when executed, implement the steps of the image encoding method provided according to the embodiments of this application.

[0146] It should be understood that the various solutions in this embodiment have the same technical effects as those in the above method embodiments, and will not be repeated here.

[0147] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. Optionally, specific examples in this embodiment can refer to the examples described in any embodiment of this application, which will not be repeated here. Obviously, those skilled in the art should understand that the various modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular hardware and software combination.

[0148] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0149] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.

[0150] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. Multitasking and parallel processing may be advantageous in certain environments. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this application. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0151] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

[0152] The above embodiments are merely exemplary embodiments of this application and are not intended to limit this application. The scope of protection of this application is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to this application within its substance and scope of protection, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of this application.

Claims

1. An image encoding method, comprising: Extract image patches from the image to be processed; Determine the gradient information of the image patch in two directions; The two directions include a first direction and a second direction that are perpendicular to each other; Based on the gradient information of the image block in two directions, the encoding strategy of the image block is determined; wherein, when the gradient of the first direction and the gradient of the second direction of the image block are both greater than a second preset threshold, the encoding strategy of the image block is as follows: the image block is divided into multiple sub-image blocks by using the division method corresponding to the preset maximum division depth, the maximum division depth is directly used without rate-distortion optimization selection of other depths, and the intra-frame prediction mode is determined by minimizing the coding rate-distortion cost. Determining the predicted value using the encoding strategy of the image block includes: processing the sub-image block using the intra-frame prediction mode to obtain the predicted value of each sub-image block; The image block is encoded using the predicted value, which is used to determine the pixel value of each pixel in the image block after encoding.

2. The image encoding method according to claim 1, wherein the encoding strategy of the image block is determined based on the gradient information of the image block in two directions, comprising: When the gradients in the first and second directions of the image block are both less than a first preset threshold, the encoding strategy for the image block is as follows: The average value of multiple associated reference pixels of the image patch is used as the predicted value of the image patch.

3. The image encoding method according to claim 1, wherein the encoding strategy of the image block is determined based on the gradient information in two directions of the image block, including at least one of the following: If the gradient of the image block in the first direction is less than a first preset threshold, the encoding strategy of the image block is: to use the value of the reference pixel in the first direction of the image block as the predicted value of the image block; If the gradient in the second direction of the image block is less than a first preset threshold, the encoding strategy for the image block is to use the value of the reference pixel in the second direction of the image block as the predicted value of the image block.

4. The image encoding method according to claim 1, further comprising: Obtain the gradient of the third direction of the image patch; The predicted value of the image patch is determined based on the gradient of the third direction.

5. The image encoding method according to claim 4, wherein the third direction is multiple; determining the predicted value of the image patch based on the gradient of the third direction includes: From multiple third-directions, determine the target third-direction whose gradient satisfies the following conditions: the third-direction gradient is either the maximum or minimum value. Determine the angle corresponding to the target third direction; Obtain the reference pixel above the angle; The weighted sum of the value of the upper reference pixel and the values ​​of its neighboring reference pixels is determined as the predicted value of the image patch.

6. The image encoding method according to claim 1, determining the gradient information of the image block in two directions, includes: The rate of change of each pixel in the image block relative to its adjacent pixels in the first direction is determined to obtain the gradient of each pixel in the first direction; The gradient of the image block in the first direction is obtained by summing the gradients of each pixel in the first direction. Determine the rate of change of each pixel in the image patch relative to its adjacent pixels in the second direction, and obtain the gradient of each pixel in the second direction; The gradient of the second direction of each pixel in the image block is obtained by summing the gradients of the second direction of the image block.

7. An image encoding apparatus, comprising: The acquisition unit is used to acquire image patches in the image to be processed; The first determining unit is used to determine the gradient information of the image block in two directions; The two directions include a first direction and a second direction that are perpendicular to each other; The second determining unit is used to determine the encoding strategy of the image block based on the gradient information in two directions of the image block; wherein, when the gradient in the first direction and the gradient in the second direction of the image block are both greater than a second preset threshold, the encoding strategy of the image block is as follows: the image block is divided into multiple sub-image blocks by using the division method corresponding to the preset maximum division depth, the maximum division depth is directly used without rate-distortion optimization selection of other depths, and the intra-frame prediction mode is determined based on minimizing the coding rate-distortion cost. The third determining unit is used to determine the predicted value using the encoding strategy of the image block, including: processing the sub-image block using the intra-frame prediction mode to obtain the predicted value of each sub-image block; An encoding unit is used to encode the image block using the predicted value, wherein the predicted value is used to determine the pixel value of each pixel in the image block after encoding.

8. An electronic device, comprising: A memory and a processor, wherein the memory stores an executable program, and the processor executes the executable program to implement the steps of the method as claimed in any one of claims 1 to 6.

Citation Information

Patent Citations

  • HEVC intra-frame prediction quick mode selection method based on texture analysis

    CN103517069A

  • Selecting prediction mode for CU in scc

    CN116567206A