Image processing method and apparatus therefor

By selecting appropriate resolution and encoding distortion threshold in image processing, the problem that existing image encoding cannot achieve high definition and low bitrate is solved, and high definition effect of images at low bitrate is achieved.

CN119052572BActive Publication Date: 2025-11-18VIVO MOBILE COMM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410967582.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2025-11-18
Estimated Expiration
2044-07-18

AI Technical Summary

Technical Problem

Existing technologies cannot effectively achieve high-definition low-bitrate results in image processing, leading to redundant or insufficient bitrate during image encoding and failing to guarantee high-definition image quality.

Method used

By encoding image data using a first resolution, determining a first quantization parameter, and determining the encoding distortion threshold of the image data based on the first and second resolutions, selecting an appropriate resolution for encoding, and outputting bitstream information whose encoding distortion does not exceed the threshold.

Benefits of technology

It achieves high-definition image quality at a low bitrate, avoids bitrate redundancy and insufficiency, and improves the image encoding effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119052572B_ABST
    Figure CN119052572B_ABST
Patent Text Reader

Abstract

The application discloses an image processing method and device, electronic equipment and storage medium, and belongs to the technical field of streaming media. The method comprises the following steps: encoding image data by using a first resolution to obtain first code stream information and a first quantization parameter; determining a first decision quantization parameter value of the image data based on the first resolution and a second resolution, the first decision quantization parameter value being a critical value of coding distortion of the image data at the first resolution, and the second resolution being smaller than the first resolution; and processing and outputting second code stream information of the image data based on the first quantization parameter and the first decision quantization parameter value, the second code stream information being the first code stream information or code stream information obtained by encoding by using a resolution smaller than the first resolution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of streaming media technology, specifically relating to an image processing method and apparatus. Background Technology

[0002] In daily life, users can store or transmit images, such as image formats or video images, through electronic devices. To reduce the memory required for image storage or the bandwidth required for image transmission, and to ensure high-definition image quality, electronic devices can encode image data at a lower bitrate, achieving high-definition, low-bitrate images.

[0003] Typically, electronic devices can encode image data at a fixed bitrate based on the image data specifications (such as resolution or frame rate). However, because electronic devices directly encode image data using a fixed bitrate, the encoding quality cannot be guaranteed, thus current image processing methods cannot achieve high-definition, low-bitrate results. Summary of the Invention

[0004] The purpose of this application is to provide an image processing method and apparatus that can encode image data at a lower bitrate while ensuring high-definition image quality, thereby achieving a high-definition, low-bitrate effect.

[0005] In a first aspect, embodiments of this application provide an image processing method, the method comprising: encoding image data using a first resolution to obtain first bitstream information and a first quantization parameter; determining a first decision quantization parameter value for the image data based on the first resolution and a second resolution, wherein the first decision quantization parameter value is a critical value for encoding distortion of the image data at the first resolution, and the second resolution is smaller than the first resolution; processing the image data based on the first quantization parameter and the first decision quantization parameter value and outputting second bitstream information, wherein the second bitstream information is the first bitstream information, or is bitstream information obtained by encoding using a resolution smaller than the first resolution.

[0006] Secondly, embodiments of this application provide an image processing apparatus, comprising: an encoding module, a determining module, and an output module. The encoding module is used to encode image data using a first resolution to obtain first bitstream information and a first quantization parameter; the determining module is used to determine a first decision quantization parameter value for the image data based on the first resolution and a second resolution, wherein the first decision quantization parameter value is a critical value for encoding distortion of the image data at the first resolution, and the second resolution is smaller than the first resolution; the output module is used to process the image data based on the first quantization parameter obtained by the encoding module and the first decision quantization parameter value determined by the determining module, and output second bitstream information, wherein the second bitstream information is the first bitstream information, or is bitstream information obtained by encoding at a resolution smaller than the first resolution.

[0007] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, the memory storing programs or instructions executable on the processor, the programs or instructions, when executed by the processor, implementing the steps of the method described in the first aspect.

[0008] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0009] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.

[0010] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect.

[0011] In this embodiment, image data can be encoded using a first resolution to obtain first bitstream information and a first quantization parameter. Based on the first resolution and a second resolution smaller than the first resolution, a first decision quantization parameter value for the image data is determined. This first quantization parameter value is the encoding distortion threshold value of the image data at the first resolution. Then, based on the first quantization parameter and the first decision quantization parameter value, the image data can be processed to output the first bitstream information, or to output the bitstream information obtained by encoding with a resolution smaller than the first resolution. In this scheme, since the electronic device can encode the image data using a first resolution to obtain a first quantization parameter, and the electronic device can determine the first decision quantization parameter value of the image data based on the first resolution and the second resolution, the electronic device can first encode the image data using any resolution to obtain the first quantization parameter. Then, based on a resolution smaller than the arbitrary resolution, it determines the encoding distortion threshold of the image data at the current resolution. Based on this encoding distortion threshold, it determines the output bitstream information, i.e., outputs the first bitstream information, or uses a resolution smaller than the first resolution to encode the bitstream information. In other words, based on the first quantization parameter and the encoding distortion threshold, it can determine the bitstream information with an encoding distortion level not exceeding the encoding distortion threshold and using a lower resolution. Therefore, by selecting an appropriate resolution to encode the image data, redundancy and insufficiency of the bitrate are avoided, so that the image data can achieve a low bitrate while ensuring image quality during the encoding process. In this way, the high-definition low-bitrate effect of the electronic device when encoding images is guaranteed. Attached Figure Description

[0012] Figure 1 This is one of the flowcharts of the image processing method provided in the embodiments of this application;

[0013] Figure 2 This is the second flowchart of the image processing method provided in the embodiments of this application;

[0014] Figure 3 This is the third flowchart of the image processing method provided in the embodiments of this application;

[0015] Figure 4 This is the fourth flowchart of the image processing method provided in the embodiments of this application;

[0016] Figure 5 This is the fifth flowchart of the image processing method provided in the embodiments of this application;

[0017] Figure 6 This is a structural diagram of an image enhancement method provided in an embodiment of this application;

[0018] Figure 7This is the sixth flowchart of the image processing method provided in the embodiments of this application;

[0019] Figure 8 This is a structural diagram of another image enhancement method provided in the embodiments of this application;

[0020] Figure 9 This is a schematic diagram illustrating the execution process of the image processing method provided in the embodiments of this application;

[0021] Figure 10 This is a schematic diagram of the image processing apparatus provided in the embodiments of this application;

[0022] Figure 11 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;

[0023] Figure 12 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0024] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0025] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0026] The terms "at least one," "at least one," etc., in this application refer to any one, any two, or a combination of two or more of the included objects. For example, at least one of a, b, and c can mean: "a," "b," "c," "a and b," "a and c," "b and c," and "a, b, and c," where a, b, and c can be single or multiple. Similarly, "at least two" refers to two or more, and its meaning is similar to that of "at least one."

[0027] The following explains some terms and nouns used in the embodiments of this application.

[0028] Encoding refers to the use of techniques to remove intra-frame and inter-frame redundancy in encoded frames, achieving efficient data compression. Commonly used techniques include predictive coding, transform coding, and entropy coding, represented by traditional coding methods such as H.264 / AVC, H.265 / HEVC, H.266 / VVC, and JPEG. Emerging technologies use neural networks for data compression.

[0029] Bitrate: The number of bits output per unit of time, usually measured in kbps. For the same image / video, a higher bitrate results in better encoding quality and lower compression ratio.

[0030] Quantization parameter: The quantization step size used during transform encoding, also known as QP (Quantization Parameter). It is the sole source of lossy encoding error; the larger the QP, the worse the quality and the higher the compression ratio.

[0031] Decompression distortion: This involves removing distortions introduced during encoding. Distortions typically include low-resolution blurring, blockiness, noise, rings, and other defects. Decompression distortion is a major form of encoding / decoding enhancement algorithm.

[0032] Enhancement refers to improving the quality and clarity of images / videos by processing degraded features through algorithms, and is not limited to techniques such as noise reduction, sharpening, super-resolution, and decompression distortion removal.

[0033] High-definition low bitrate: also known as narrowband high-definition, refers to achieving high-definition image quality using a lower bitrate during encoding.

[0034] The image processing method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0035] The embodiments of this application can be applied to scenarios involving image encoding. Specifically, electronic devices encode image data to store or transmit bitstream information.

[0036] Typically, to reduce the memory required for image storage or the bandwidth required for image transmission, and to ensure high-definition image quality, electronic devices need to encode image data at a fixed bitrate according to the image data specifications. However, because electronic devices use a fixed bitrate to encode image data, the bitrate may be redundant in some images, resulting in wasted resources, while the bitrate may be insufficient in others, causing the image to fail to achieve high-definition quality and failing to guarantee the overall encoding effect. Consequently, current image processing methods generally produce poor results in achieving high-definition, low-bitrate images.

[0037] This application provides an image processing method that encodes image data using a first resolution to obtain first bitstream information and a first quantization parameter. Based on the first resolution and a second resolution smaller than the first resolution, a first decision quantization parameter value for the image data is determined. This first quantization parameter value is a critical value for encoding distortion of the image data at the first resolution. Then, based on the first quantization parameter and the first decision quantization parameter value, the image data can be processed to output the first bitstream information, or to output bitstream information obtained by encoding at a resolution smaller than the first resolution. In this scheme, since the electronic device can encode the image data using a first resolution to obtain a first quantization parameter, and the electronic device can determine the first decision quantization parameter value of the image data based on the first resolution and the second resolution, the electronic device can first encode the image data using any resolution to obtain the first quantization parameter. Then, based on a resolution smaller than the arbitrary resolution, it determines the encoding distortion threshold of the image data at the current resolution. Based on this encoding distortion threshold, it determines the output bitstream information, i.e., outputs the first bitstream information, or uses a resolution smaller than the first resolution to encode the bitstream information. In other words, based on the first quantization parameter and the encoding distortion threshold, it can determine the bitstream information with an encoding distortion level not exceeding the encoding distortion threshold and using a lower resolution. Therefore, by selecting an appropriate resolution to encode the image data, redundancy and insufficiency of the bitrate are avoided, so that the image data can achieve a low bitrate while ensuring image quality during the encoding process. In this way, the high-definition low-bitrate effect of the electronic device when encoding images is guaranteed.

[0038] The image processing method provided in this application can be executed by an image processing device, an electronic device, or a functional module within an electronic device. The following description uses an electronic device as an example to illustrate the technical solution provided in this application.

[0039] Figure 1 A flowchart of an image processing method provided in an embodiment of this application is shown, such as... Figure 1 As shown, the image processing method provided in this application embodiment may include the following steps 201 to 203.

[0040] Step 201: The electronic device encodes the image data using a first resolution to obtain the first bitstream information and the first quantization parameter.

[0041] Optionally, in this embodiment, the first resolution can be any resolution from a preset resolution set, or it can be a user-defined resolution. The preset resolution set includes at least two resolutions that are pre-defined and usable for image data encoding.

[0042] In this embodiment of the application, the electronic device can start encoding the image data using any resolution (e.g., the maximum resolution in a preset set of resolutions) to determine whether to re-encode the image data using other suitable resolutions based on the obtained quantization parameters, thereby storing or transmitting the bitstream information obtained by encoding with a suitable resolution.

[0043] In this embodiment of the application, the image data is a matrix composed of pixels of an image or video frame.

[0044] Optionally, in the embodiments of this application, the aforementioned image data can be unprocessed (e.g., compressed) raw image data or raw video frame data, or it can be processed image data or video frame data. Wherein, when the image data is a frame of image data from a video, the bitstream information of each frame of image data in the video can be obtained by selecting an appropriate resolution encoding using the scheme of this application.

[0045] Optionally, in the embodiments of this application, the above-mentioned image data can be in the form of two-dimensional image data or three-dimensional image data, etc.

[0046] In this embodiment, encoding is the process of encoding and outputting bitstream information by calling an encoding tool under a given bitrate and resolution. Encoding removes intra-frame and inter-frame redundancy from the encoded frame to achieve efficient data compression.

[0047] Optionally, in the embodiments of this application, the above-mentioned encoding tools may include, but are not limited to, at least one of the following: commonly used encoding methods such as predictive coding, transform coding and entropy coding (Versatile Video Coding, H.266 / VVC), High Efficiency Video Coding, H.265 / HEVC, Advanced Video Coding, H.264 / AVC, Joint Photographic Experts Group (JPEG), etc., or neural network-based encoding methods.

[0048] It should be noted that the bitrate mentioned above refers to the number of bits output per unit time. For the same image, a higher bitrate results in better encoding quality and a lower compression ratio. With a fixed bitrate, resolution and image quality (e.g., sharpness) are inversely proportional; higher resolution results in a less sharp image, and lower resolution results in a sharper image. With a fixed resolution, bitrate and sharpness are directly proportional; higher bitrate results in a sharper image, and lower bitrate results in a less sharp image. In this embodiment, the electronic device selects a suitable resolution to achieve a low bitrate while maintaining good image quality during image data encoding, thus achieving a high-definition, low-bitrate effect.

[0049] In this embodiment, the first bitstream information is the bitstream information corresponding to the image data at the first resolution, also known as encoded data. It is typically a series of binary sequences or other forms of data. This data can effectively reduce the size of the image file, facilitating storage and transmission. Optionally, the encoded data of the image can be a compressed image file, such as files in formats like Joint Image Experts Group, Portable Network Graphics (PNG), or Graphics Interchange Format (GIF); it can also be descriptive data of the image, such as vector graphics data.

[0050] In this embodiment, the first quantization parameter is the quantization parameter corresponding to the image data at the first resolution, also known as the quantization step size (QP) used in transform coding. Since the encoding uses lossy compression, compression distortion, also known as lossy errors, occurs during image encoding, such as blurring, blocking, noise, and ringing. The quantization parameter is the sole source of these lossy errors. A larger quantization parameter in image encoding results in more severe compression distortion, poorer image quality, and a higher image compression ratio; conversely, a smaller quantization parameter results in less compression distortion, better image quality, and a lower image compression ratio. This embodiment selects a suitable resolution for encoding by judging the quantization parameter, enabling the image data to achieve a low bitrate while maintaining good image quality during encoding.

[0051] Step 202: The electronic device determines the first decision quantization parameter value of the image data based on the first resolution and the second resolution.

[0052] In this embodiment, the first decision quantization parameter is the encoding distortion threshold of the image data at the first resolution, and the second resolution is smaller than the first resolution.

[0053] Optionally, in this embodiment of the application, the second resolution may be a resolution in a preset set of resolutions, or it may be the resolution after the electronic device reduces the first resolution to a preset ratio (e.g., to 90% of the first resolution).

[0054] In this embodiment of the application, when the second resolution is a resolution in a preset resolution set, the second resolution can be any resolution in the preset resolution set that is smaller than the first resolution.

[0055] In this embodiment, the electronic device can utilize a resolution decision algorithm to process the current frame (i.e., the aforementioned image data) to obtain the decision QP value (i.e., the encoding distortion threshold) of the frame at the current resolution (i.e., the first resolution) and the second resolution. This QP value is used to determine whether the lossy error generated by encoding the image data at the first resolution is within the allowable limit. This embodiment can make decisions sequentially from the maximum preset resolution down to the next highest resolution. Based on the quantization parameters and decision QP value corresponding to each resolution, a suitable and larger resolution for the frame is selected. This breaks the fixed-resolution encoding method with a given bitrate, effectively removing bitrate redundancy and achieving a higher image quality.

[0056] Optionally, in the embodiments of this application, the resolution decision algorithm may include, but is not limited to, at least one of the following: machine learning support vector regression algorithm, neural network regression algorithm, etc.

[0057] Step 203: The electronic device processes the image data based on the first quantization parameter and the first decision quantization parameter value and outputs the second bitstream information.

[0058] In this embodiment of the application, the second bitstream information is the first bitstream information, or it is bitstream information obtained by encoding with a resolution smaller than the first resolution.

[0059] In this embodiment of the application, the electronic device can compare the magnitude relationship between the first quantization parameter and the first decision quantization parameter to determine whether to output the first bitstream information or to encode the image data at a resolution smaller than the first resolution and output the corresponding bitstream information.

[0060] In this embodiment of the application, when the first quantization parameter is less than or equal to the first decision quantization parameter value, it is considered that the encoding distortion using the first resolution encoding is small and within an acceptable range, that is, the lossy error generated by encoding the image data is within the allowable limit. Alternatively, when the first quantization parameter is greater than the first decision quantization parameter value, it is considered that the encoding distortion using the first resolution encoding is large and outside the acceptable range, that is, the lossy error generated by encoding the image data is outside the allowable limit.

[0061] Optionally, in the embodiments of this application, combined with Figure 1 ,like Figure 2 As shown, step 203 above can be specifically implemented through step 301 below.

[0062] Step 301: When the first quantization parameter is less than or equal to the value of the first decision quantization parameter, the electronic device outputs the first bitstream information.

[0063] Thus, when the first quantization parameter is less than or equal to the first decision quantization parameter value, the electronic device determines that the lossy error generated by the electronic device encoding the image data at the first resolution is within the allowable limit, thereby triggering the output of the bitstream information obtained by encoding at the first resolution. As a result, the electronic device outputs bitstream information where the lossy error generated by encoding is within the allowable limit, reducing the lossy error of encoding and improving the image quality.

[0064] Optionally, in the embodiments of this application, combined with Figure 1 ,like Figure 3 As shown, step 203 can be implemented through steps 401 to 403 as described below.

[0065] Step 401: When the first quantization parameter is greater than the first decision quantization parameter value, the electronic device encodes the image data using the second resolution to obtain the third bitstream information and the second quantization parameter.

[0066] Step 402: The electronic device determines the second decision quantization parameter value of the image data based on the second resolution and the third resolution.

[0067] In this embodiment, the second decision quantization parameter is the encoding distortion threshold of the image data at the second resolution, and the third resolution is smaller than the second resolution.

[0068] Optionally, in this embodiment of the application, the second resolution may be a resolution in a preset set of resolutions, or it may be the resolution after the electronic device reduces the first resolution to a preset ratio (e.g., to 90% of the first resolution).

[0069] In this embodiment of the application, when the second resolution is a resolution in a preset resolution set, the second resolution can be any resolution in the preset resolution set that is smaller than the first resolution.

[0070] Optionally, in this embodiment, the third resolution can be a resolution from a preset set of resolutions, or it can be the resolution after the electronic device reduces the second resolution to a preset ratio (e.g., to 90% of the second resolution).

[0071] In this embodiment of the application, when the third resolution is a resolution in a preset resolution set, the third resolution can be any resolution in the preset resolution set that is smaller than the second resolution.

[0072] Step 403: When the second quantization parameter is less than or equal to the value of the second decision quantization parameter, the electronic device outputs the third bitstream information.

[0073] It should be noted that the implementation methods of steps 401 to 403 are similar to those of steps 201 to 203 described above, and can be found in the description of the above embodiments, which will not be repeated here.

[0074] It is understood that, in this embodiment of the application, when the first quantization parameter is greater than the first decision quantization parameter value, the electronic device can encode the image data using the i-th resolution to obtain the i-th quantization parameter; then, the electronic device can determine the i-th decision quantization parameter value of the image data based on the i-th resolution and the (i+1)-th resolution, where the i-th decision quantization parameter value is the encoding distortion threshold value of the image data at the i-th resolution, and the (i+1)-th resolution is less than the i-th resolution; when the N-th quantization parameter is less than or equal to the N-th decision quantization parameter value, the bitstream information obtained by encoding the image data using the N-th resolution is output. Here, i and N are positive integers.

[0075] It should be noted that the electronic device can start from any resolution. For example, it can start with the maximum resolution in the preset resolution set. That is, when i=1, the first resolution is the maximum resolution in the preset resolution set. When the electronic device encodes image data using a resolution lower than the preset minimum resolution, it can directly output the bitstream information obtained using that resolution. The preset minimum resolution is the minimum resolution in the preset resolution set.

[0076] In this embodiment, when the second quantization parameter is greater than the second decision quantization parameter value, the electronic device can encode the image data using a third resolution to obtain fourth bitstream information and a fourth quantization parameter. Then, based on the third and fourth resolutions, the electronic device can determine the third decision quantization parameter value for the image data. The fourth resolution is less than the third resolution, and if the fourth quantization parameter is less than or equal to the third decision quantization parameter value, the electronic device outputs the fourth bitstream information. Similarly, if the electronic device determines that the lossy error generated by encoding the image data using the current resolution exceeds the allowable limit, the electronic device can select a resolution smaller than the current resolution, compress the image data to that resolution, and repeat the above steps until the electronic device determines that the lossy error generated by encoding the image data is within the allowable limit at a given resolution, then outputs the bitstream information encoded using that resolution.

[0077] For example, an electronic device encodes image data using resolution 'a', obtaining quantization parameter a1 and bitstream information a2. The electronic device determines a resolution 'b' smaller than resolution 'a', and based on resolution 'a' and resolution 'b', determines a decision quantization parameter value 'a3' for the image data. If quantization parameter a1 is greater than decision quantization parameter value a3, it is considered that the condition for outputting bitstream information a2 is not met (i.e., the lossy error generated by encoding is outside the allowable limit). Therefore, the electronic device continues to encode the image data using resolution 'b', obtaining quantization parameter b1 and bitstream information b2. The electronic device determines a resolution 'c' smaller than resolution 'b', and based on resolution 'b' and resolution 'c', determines a decision quantization parameter value 'b3' for the image data. If quantization parameter b1 is greater than decision quantization parameter value b3, it is considered that the condition for outputting bitstream information b2 is not met. Therefore, the electronic device continues to encode the image data using resolution 'c', obtaining quantization parameter c1 and bitstream information c2. The electronic device determines a resolution 'd' smaller than resolution 'c', and based on resolution 'c' and resolution 'd', determines a decision quantization parameter value 'c3' for the image data. If the quantization parameter c1 is greater than the decision quantization parameter c3, then the condition for outputting bitstream information c2 is not met. Therefore, the electronic device continues to encode the image data using resolution d and determines whether resolution d satisfies the condition for outputting bitstream information. This process is repeated until the quantization parameter x1 obtained by encoding the image data using resolution x is less than or equal to the decision quantization parameter x3, at which point the electronic device can output bitstream information x2.

[0078] Optionally, in this embodiment of the application, the electronic device outputs the third bitstream information by transmitting the third bitstream information over a network, or by storing the third bitstream information in a local file.

[0079] Thus, if the lossy error of the bitstream information corresponding to the first resolution exceeds the allowable limit, the electronic device can determine whether the next lower resolution meets the above conditions for outputting bitstream information. If the conditions are met, the electronic device can output the bitstream information corresponding to that resolution. In this way, the lossy error generated by the encoding is within the allowable limit, reducing the lossy error of the encoding and improving the image quality.

[0080] This application provides an image processing method. Since an electronic device can encode image data using a first resolution to obtain a first quantization parameter, and the electronic device can determine a first decision quantization parameter value for the image data based on the first and second resolutions, the electronic device can first encode the image data using any resolution to obtain the first quantization parameter. Then, based on a resolution smaller than the arbitrary resolution, it determines the encoding distortion threshold of the image data at the current resolution. Based on this encoding distortion threshold, it determines the output bitstream information, i.e., outputs the first bitstream information, or uses a resolution smaller than the first resolution to encode the bitstream information. In other words, based on the first quantization parameter and the encoding distortion threshold, it can determine bitstream information whose encoding distortion does not exceed the encoding distortion threshold and whose encoding uses a lower resolution. Therefore, by selecting a suitable resolution to encode the image data, redundancy and insufficiency of the bitrate are avoided, so that the image data achieves a low bitrate while maintaining image quality during the encoding process. This ensures a high-definition, low-bitrate effect when the electronic device encodes images.

[0081] Optionally, in the embodiments of this application, combined with Figure 1 ,like Figure 4 As shown, after step 203 above, the image processing method provided in this application embodiment further includes the following steps 501 and 502.

[0082] Step 501: The electronic device decodes the second bitstream information to obtain the pixel value matrix and the third quantization parameter corresponding to the image data.

[0083] In this embodiment of the application, decoding is the process of converting the bitstream information obtained by encoding image data into the original form of image data.

[0084] In this embodiment, the pixel value matrix is ​​a way of representing an image. It is a two-dimensional array, where each element represents the value of a pixel at a corresponding position in the image. For grayscale images, the value of each pixel is usually between 0 and 255, representing the grayscale value of that pixel; while for color images, each pixel is usually composed of three values ​​(red, green, and blue), each value also ranging from 0 to 255, representing the color intensity of that pixel in the red, green, and blue channels.

[0085] In this embodiment, the quantization parameter can be directly obtained from the bitstream information, reflecting the degree of encoding distortion and being the sole source of encoding lossy error.

[0086] Optionally, in the embodiments of this application, the third quantization parameter can be a single value at the frame QP level (which can be called a frame quantization parameter), or it can be a matrix at the QP graph level (which can be called a quantization parameter matrix).

[0087] It should be noted that the frame quantization parameter mentioned above is a fixed value, applicable to the entire frame. The quantization parameter matrix, however, allows setting different quantization parameters for different regions within the same frame. In this way, while maintaining the overall bitrate, higher image quality can be assigned to important areas of the image (such as faces and text), while the quality of less important areas such as the background can be appropriately reduced to decrease the bitrate. The quantization parameter matrix can be a two-dimensional array, where each element represents the quantization parameter value at a corresponding location in the image.

[0088] Step 502: The electronic device performs image quality enhancement processing on the pixel value matrix based on the third quantization parameter and outputs the image frame corresponding to the pixel value matrix.

[0089] In this embodiment of the application, the above-mentioned image quality enhancement processing is to process the degraded features in the image data through enhancement algorithms, remove artifacts, improve the quality and clarity of the image, and obtain a higher definition effect.

[0090] Optionally, in the embodiments of this application, the above-mentioned image quality enhancement may include, but is not limited to, at least one of the following: noise reduction, sharpening, super-resolution, and decompression distortion removal.

[0091] Optionally, in the embodiments of this application, the above-mentioned enhancement algorithm may include, but is not limited to, at least one of the following: convolutional neural network, recurrent neural network, and transformer network.

[0092] Optionally, in this embodiment of the application, when the image frame corresponding to the pixel value matrix is ​​a single image frame, the electronic device can display the single image frame in image format. Alternatively, when the image frame corresponding to the pixel value matrix is ​​a video frame image, the electronic device can play the video frame image through a playback module.

[0093] Optionally, in the embodiments of this application, combined with Figure 4 ,like Figure 5 As shown, step 502 can be implemented through steps 601 and 602 as described below.

[0094] Step 601: The electronic device converts the third quantization parameter into an intensity coefficient and uses the intensity coefficient to adjust the intensity parameter in the preset enhancement network.

[0095] Optionally, in this embodiment of the application, the electronic device can convert the third quantization parameter into an intensity coefficient between 0 and 1, for example, by using a piecewise linearization method, thereby adjusting the intensity of the preset enhancement network (i.e., the enhancement algorithm described above).

[0096] Step 602: The electronic device performs image quality enhancement processing on the pixel value matrix based on the preset enhancement network after adjusting the intensity parameters, and outputs the image frame corresponding to the pixel value matrix.

[0097] In this embodiment, the electronic device can input the pixel value matrix into a preset enhancement network after adjusting the intensity parameters to enhance the pixel value matrix, obtain an enhanced image frame, calculate the difference between the enhanced image frame and the pixel value matrix, calculate the product of the difference and the intensity coefficient, and then use the sum of the pixel value matrix and the product as the image frame corresponding to the pixel value matrix, thus obtaining the enhanced high-definition image frame.

[0098] For example, such as Figure 6 The diagram illustrates the structure of an image enhancement method. An electronic device can input a pixel value matrix into a preset enhancement network (e.g., an AI neural network) for enhancement processing to obtain an enhanced image frame. Then, based on the QP value (i.e., the third quantization parameter), it is converted into a 0-1 intensity coefficient QP_coff, and the intensity of the preset enhancement network (e.g., an AI neural network) is adjusted to output an enhanced high-definition image frame.

[0099] For example, the decoded frame (pixel value matrix) is represented as input_img, the AI ​​neural network output is temp_img, and the enhanced high-definition image frame is represented as enhance_img. The above intensity adjustment method is: enhance_img = input_img + (temp_img - input_img) * QP_coff.

[0100] In this way, the intensity of the enhancement algorithm can be adjusted according to QP to achieve adaptive adjustment. Better enhancement effect can be obtained through intensity control. Furthermore, this method is decoupled from neural network training and can be used as a general tool to be inserted into other algorithms. Therefore, it can not only adaptively adjust the enhancement effect of neural network enhancement algorithm, but also when the preset enhancement network is other enhancement algorithm, thereby improving the image clarity.

[0101] Optionally, in the embodiments of this application, combined with Figure 4 ,like Figure 7 As shown, step 502 can be implemented through steps 701 and 702 as described below.

[0102] Step 701: The electronic device extracts features from the pixel value matrix based on the third quantization parameter to obtain the feature information of the pixel value matrix.

[0103] In this embodiment, the aforementioned feature information refers to attributes, variables, or indicators used to describe or characterize image data. Electronic devices can use the third quantization parameter as prior information to extract features from the pixel value matrix through network alignment, providing more clues to help the algorithm solve compression distortion problems, restore image details, and thus improve image clarity.

[0104] It should be noted that the feature extraction described above refers to the process of extracting meaningful information from an image. In machine learning and deep learning, feature extraction is typically performed using trained models that automatically learn features representing important attributes in the data. The quality of feature extraction directly impacts the accuracy of subsequent image processing tasks, such as object detection, scene understanding, and behavior analysis.

[0105] The network alignment described above refers to aligning image data from different sources or at different times into a common feature space during feature extraction. Alignment ensures the compatibility and consistency of these data at the feature level, which is crucial for image recognition, classification, and analysis. In deep learning, network alignment also involves the alignment of feature maps, which helps capture the intrinsic structure and appearance characteristics of images.

[0106] Step 702: The electronic device performs image quality enhancement processing on the pixel value matrix based on the feature information and outputs the image frame corresponding to the pixel value matrix.

[0107] For example, such as Figure 8 The diagram illustrates another image enhancement method. An electronic device can input a pixel value matrix into a preset enhancement network (e.g., an AI neural network) for enhancement processing to obtain an enhanced image frame. Then, based on the QP value (i.e., the third quantization parameter), features of the pixel value matrix are extracted to obtain its feature information. Based on this extracted feature information, targeted enhancement processing is performed on the pixel value matrix to output an enhanced high-definition image frame.

[0108] In this way, electronic devices can use the third quantization parameter as prior information to extract features from the pixel value matrix. This allows the electronic devices to perform targeted enhancement processing on the pixel value matrix based on the extracted feature information, providing more clues to help the algorithm better remove artifacts, thereby better repairing image details, improving image clarity, and achieving higher-definition image quality.

[0109] Optionally, in the embodiments of this application, the image processing method provided in the embodiments of this application further includes the following step 801.

[0110] Step 801: The electronic device adjusts the decision quantization parameter values ​​of the image data based on the capability information.

[0111] In this embodiment of the application, the aforementioned capability information characterizes the image quality enhancement capability of the decoded image frame.

[0112] Optionally, in this embodiment, the electronic device can increase the decision quantization parameter value (e.g., the first decision quantization parameter value or the second decision quantization parameter value mentioned above) by a certain value, or it can set a new decision quantization parameter value. The specific value is determined by the capabilities of the augmented network, and this embodiment does not impose any specific limitations.

[0113] In this embodiment of the application, the electronic device can combine the enhanced algorithm capabilities of the decoding end during the encoding process, appropriately increase the numerical threshold of the decision quantization parameter value of the resolution decision algorithm to switch the image to a low resolution, further raise the threshold for reducing resolution, and thus reduce the bit rate required for high resolution.

[0114] Thus, when the enhancement algorithm at the decoding end is powerful enough, it can solve severe compression distortion problems and compensate for insufficient bitrate when electronic devices encode image data at high resolution. This allows the electronic device to consider the enhancement algorithm's capabilities during encoding, appropriately increasing the critical value of the quantization parameter for switching to lower resolution in the resolution decision algorithm, further raising the threshold for reducing resolution. This allows the electronic device to encode at high resolution without changing the bitrate, improving image clarity. In other words, by further strengthening the combination of encoding and enhancement, the bitrate required for high resolution is reduced, better achieving high-definition with low bitrate. Specifically, from a bitrate perspective, encoding a higher resolution at the same bitrate effectively reduces the bitrate for high resolution; from an image quality perspective, encoding a higher resolution preserves more image details, compensating for the insufficient recovery of realistic high-definition pixels by the enhancement network, resulting in higher-definition image quality.

[0115] Optionally, in this embodiment, the user can adjust the decision quantization parameter value of the image data. The electronic device includes an adjustment intensity selection module and an adjustment QP module. The user adjustment intensity selection module allows the user to choose whether to adjust the QP value. If the user believes that the current playback effect meets their requirements, no adjustment is made; otherwise, adjustment is made. The adjustment QP module adjusts the specific QP value. If the user believes that the current enhancement effect is too strong, such as the image quality being too smooth, the QP is reduced to weaken the enhancement effect; conversely, if the current enhancement effect is too weak, such as the image quality having obvious artifacts, the QP is increased to strengthen the enhancement effect.

[0116] In this way, users can adjust the intensity coefficient to trigger the electronic device to adjust the QP value, control the degree of distortion, and enhance the effect of the adjustment, thereby obtaining a high-definition visual effect that better meets their personal needs.

[0117] Figure 9This is a schematic diagram illustrating the execution process of the image processing method provided in the embodiments of this application. For example... Figure 9 As shown, the image processing method provided in this application embodiment may include the following steps 10 to 18.

[0118] Step 10: The electronic device acquires the input image data.

[0119] Step 11: The electronic device encodes the image data using the current resolution to obtain the bitstream information and quantization parameters.

[0120] Step 12: The electronic device obtains the decision quantization parameter values ​​corresponding to the image data based on the current resolution and the next lower resolution.

[0121] It is understandable that electronic devices can choose any resolution smaller than the current resolution as the next lower resolution, for example, by selecting from a set of preset resolutions, or by reducing the current resolution to a preset ratio.

[0122] Step 13: The electronic device determines whether the quantization parameter is greater than the decision quantization parameter value.

[0123] If the quantization parameter value is greater than the decision quantization parameter value, then proceed to step 14 below.

[0124] Step 14: The electronic device reduces the resolution of the image data to the next lower resolution.

[0125] After performing step 14 above, execution continues from step 11 above. At this point, the current resolution in steps 11 and 12 is the resolution smaller than the first resolution selected in step 14.

[0126] If the quantization parameter value is less than or equal to the decision quantization parameter value, then proceed to step 15 below.

[0127] Step 15: The electronic device transmits or stores the bitstream information encoded at the current resolution.

[0128] Step 16: The electronic device decodes the bitstream information to obtain a pixel value matrix.

[0129] Step 17: The electronic device enhances the pixel value matrix to obtain the enhanced image frame.

[0130] Step 18: The electronic device plays the image frame.

[0131] It should be noted that steps 10 to 15 above are the encoding process, i.e. the execution steps of the encoding end, and steps 16 to 18 above are the decoding process, i.e. the execution steps of the decoding end.

[0132] In this embodiment, a suitable resolution is selected at the encoding end using a resolution decision algorithm to retain more original information, reduce coding rate redundancy, and thus lower the bitrate. At the decoding end, the image distortion is obtained based on the quantization parameter QP, which guides the enhancement network to perform enhancement, achieving higher-definition image quality. Through effective strategies at both the encoding and decoding ends, high-definition low-bitrate is better achieved.

[0133] Each of the above-described method embodiments, or various possible implementations of each method embodiment, can be executed individually or in combination of any two or more. The specific implementation can be determined according to actual usage requirements, and this application does not impose any restrictions on this.

[0134] The image processing method provided in this application can be executed by an image processing device. This application uses an image processing device executing the image processing method as an example to illustrate the image processing device provided in this application.

[0135] Figure 10 A schematic diagram of a possible structure of the image processing apparatus involved in some embodiments of this application is shown. For example... Figure 10 As shown, the image processing device 70 may include an encoding module 71, a determination module 72, and an output module 73.

[0136] The encoding module 71 is used to encode the image data using a first resolution to obtain first bitstream information and first quantization parameters.

[0137] The determination module 72 is used to determine a first decision quantization parameter value of the image data based on a first resolution and a second resolution. The first decision quantization parameter value is the encoding distortion threshold value of the image data at the first resolution, and the second resolution is smaller than the first resolution.

[0138] The output module 73 is used to process the image data and output second bitstream information based on the first quantization parameter obtained by the encoding module 71 and the first decision quantization parameter value determined by the determination module 72. The second bitstream information is either the first bitstream information or bitstream information obtained by encoding with a resolution smaller than the first resolution.

[0139] In one possible implementation, the output module 72 is specifically used to output the first bitstream information when the first quantization parameter is less than or equal to the value of the first decision quantization parameter.

[0140] In one possible implementation, the output module 71 is specifically used to: encode the image data using a second resolution when the first quantization parameter is greater than the value of the first decision quantization parameter, to obtain third bitstream information and a second quantization parameter; determine the value of the second decision quantization parameter of the image data based on the second resolution and the third resolution, wherein the value of the second decision quantization parameter is the encoding distortion threshold value of the image data at the second resolution, and the third resolution is less than the second resolution; specifically, output the third bitstream information when the second quantization parameter is less than or equal to the value of the second decision quantization parameter.

[0141] In one possible implementation, the image processing apparatus 70 provided in this application embodiment further includes a decoding module and a processing module. The decoding module is used to decode the second bitstream information after the output module outputs the second bitstream information to obtain a pixel value matrix and a third quantization parameter corresponding to the image data. The processing module is used to perform image quality enhancement processing on the pixel value matrix based on the third quantization parameter obtained by the decoding module, and output the image frame corresponding to the pixel value matrix.

[0142] In one possible implementation, the processing module is specifically used to: convert the third quantization parameter into an intensity coefficient, and use the intensity coefficient to adjust the intensity parameter in the preset enhancement network; and, based on the preset enhancement network after adjusting the intensity parameter, perform image quality enhancement processing on the pixel value matrix and output the image frame corresponding to the pixel value matrix.

[0143] In one possible implementation, the processing module is specifically used to: extract features from the pixel value matrix based on a third quantization parameter to obtain feature information of the pixel value matrix; and, based on the feature information, perform image quality enhancement processing on the pixel value matrix to output the image frame corresponding to the pixel value matrix.

[0144] In one possible implementation, the image processing apparatus 70 provided in this application embodiment further includes an adjustment module. This adjustment module is used to adjust the decision quantization parameter values ​​of the image data based on capability information, which characterizes the image quality enhancement capability of the decoded image frame.

[0145] This application provides an image processing apparatus. Since the image processing apparatus can encode image data using a first resolution to obtain a first quantization parameter, and can determine a first decision quantization parameter value for the image data based on the first and second resolutions, the image processing apparatus can first encode the image data using any resolution to obtain the first quantization parameter. Then, based on a resolution smaller than the arbitrary resolution, it determines the encoding distortion threshold of the image data at the current resolution. Based on this encoding distortion threshold, it determines the output bitstream information, i.e., outputs the first bitstream information, or uses a resolution smaller than the first resolution to encode the bitstream information. In other words, based on the first quantization parameter and the encoding distortion threshold, it can determine bitstream information whose encoding distortion does not exceed the encoding distortion threshold and whose encoding uses a lower resolution. Therefore, by selecting a suitable resolution to encode the image data, redundancy and insufficiency of the bitrate are avoided, so that the image data achieves a low bitrate while maintaining image quality during the encoding process. Thus, the image processing apparatus ensures a high-definition, low-bitrate effect when encoding images.

[0146] The image processing device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.

[0147] The image processing device in this application embodiment can be a device with an operating system. The operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system.

[0148] The image processing apparatus provided in this application embodiment can implement the various processes implemented in the above method embodiments, and will not be described again here to avoid repetition.

[0149] Optionally, such as Figure 11 As shown, this application embodiment also provides an electronic device 1000, including a processor 1001 and a memory 1002. The memory 1002 stores a program or instructions that can run on the processor 1001. When the program or instructions are executed by the processor 1001, they implement the various steps of the above-described image processing method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0150] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0151] Figure 12 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.

[0152] The electronic device 100 includes, but is not limited to, components such as: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, and processor 110.

[0153] Those skilled in the art will understand that the electronic device 100 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 110 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 12 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0154] The processor 110 is used to encode image data using a first resolution to obtain first bitstream information and first quantization parameters.

[0155] The processor 110 is further configured to determine a first decision quantization parameter value of image data based on a first resolution and a second resolution, wherein the first decision quantization parameter value is a coding distortion threshold value of the image data at the first resolution and the second resolution is smaller than the first resolution.

[0156] The processor 110 is further configured to process image data based on the first quantization parameter and the first decision quantization parameter value and output second bitstream information, wherein the second bitstream information is the first bitstream information or bitstream information obtained by encoding with a resolution smaller than the first resolution.

[0157] This application provides an electronic device. Since the electronic device can encode image data using a first resolution to obtain a first quantization parameter, and can determine a first decision quantization parameter value for the image data based on the first and second resolutions, the electronic device can first encode the image data using any resolution to obtain the first quantization parameter. Then, based on a resolution smaller than the arbitrary resolution, it determines the encoding distortion threshold of the image data at the current resolution. Based on this encoding distortion threshold, it determines the output bitstream information, i.e., outputs the first bitstream information, or uses a resolution smaller than the first resolution to encode the bitstream information. In other words, based on the first quantization parameter and the encoding distortion threshold, it can determine bitstream information whose encoding distortion does not exceed the encoding distortion threshold and whose encoding uses a lower resolution. Therefore, by selecting a suitable resolution to encode the image data, redundancy and insufficiency of the bitrate are avoided, so that the image data achieves a low bitrate while maintaining image quality during the encoding process. Thus, the electronic device ensures a high-definition, low-bitrate effect when encoding images.

[0158] Optionally, the processor 110 is specifically used to output the first bitstream information when the first quantization parameter is less than or equal to the value of the first decision quantization parameter.

[0159] Optionally, the processor 110 is specifically configured to: encode the image data using a second resolution when the first quantization parameter is greater than the first decision quantization parameter value, to obtain third bitstream information and a second quantization parameter; determine the second decision quantization parameter value of the image data based on the second resolution and the third resolution, wherein the second decision quantization parameter value is the encoding distortion threshold value of the image data at the second resolution, and the third resolution is less than the second resolution; specifically, output the third bitstream information when the second quantization parameter is less than or equal to the second decision quantization parameter value.

[0160] Optionally, the processor 110 is further configured to: after outputting the second bitstream information, decode the second bitstream information to obtain the pixel value matrix and the third quantization parameter corresponding to the image data; perform image quality enhancement processing on the pixel value matrix based on the third quantization parameter, and output the image frame corresponding to the pixel value matrix.

[0161] Optionally, the processor 110 is specifically configured to: convert the third quantization parameter into an intensity coefficient, and use the intensity coefficient to adjust the intensity parameter in the preset enhancement network; and, based on the preset enhancement network after adjusting the intensity parameter, perform image quality enhancement processing on the pixel value matrix and output the image frame corresponding to the pixel value matrix.

[0162] Optionally, the processor 110 is specifically used to: extract features from the pixel value matrix based on the third quantization parameter to obtain feature information of the pixel value matrix; and to perform image quality enhancement processing on the pixel value matrix based on the feature information, and output the image frame corresponding to the pixel value matrix.

[0163] Optionally, the processor 110 is further configured to adjust the decision quantization parameter values ​​of the image data based on capability information, whereby the capability information characterizes the image quality enhancement capability of the decoded image frame. The electronic device provided in this application embodiment can implement all the processes implemented in the above method embodiments and achieve the same technical effects; therefore, to avoid repetition, it will not be described again here. For the specific beneficial effects of the various implementation methods in this embodiment, please refer to the beneficial effects of the corresponding implementation methods in the above method embodiments; to avoid repetition, it will not be described again here.

[0164] It should be understood that, in this embodiment, the input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick, which will not be described in detail here.

[0165] The memory 109 can be used to store software programs and various data. The memory 109 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 109 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 109 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.

[0166] Processor 110 may include one or more processing units; optionally, processor 110 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 110.

[0167] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described image processing method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.

[0168] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0169] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described image processing method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0170] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0171] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the above-described image processing method embodiments, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0172] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0173] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0174] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. An image processing method, characterized in that, include: The image data is encoded using a first resolution to obtain first bitstream information and first quantization parameters; Based on the first resolution and the second resolution, a first decision quantization parameter value for the image data is determined. The first decision quantization parameter value is the encoding distortion threshold value of the image data at the first resolution, and the second resolution is smaller than the first resolution. Based on the first quantization parameter and the first decision quantization parameter value, the image data is processed and a second bitstream information is output. The second bitstream information is the first bitstream information, or it is bitstream information obtained by encoding with a resolution smaller than the first resolution.

2. The method according to claim 1, characterized in that, The step of processing the image data and outputting second bitstream information based on the first quantization parameter and the first decision quantization parameter value includes: If the first quantization parameter is greater than the first decision quantization parameter value, the image data is encoded using the second resolution to obtain the third bitstream information and the second quantization parameter. Based on the second resolution and the third resolution, a second decision quantization parameter value for the image data is determined. The second decision quantization parameter value is the encoding distortion threshold value of the image data at the second resolution, and the third resolution is smaller than the second resolution. If the second quantization parameter is less than or equal to the value of the second decision quantization parameter, the third bitstream information is output.

3. The method according to any one of claims 1 to 2, characterized in that, After outputting the second bitstream information, the method further includes: The second bitstream information is decoded to obtain the pixel value matrix and the third quantization parameter corresponding to the image data; Based on the third quantization parameter, image quality enhancement processing is performed on the pixel value matrix, and the image frame corresponding to the pixel value matrix is ​​output.

4. The method according to claim 3, characterized in that, The step of performing image quality enhancement processing on the pixel value matrix based on the third quantization parameter and outputting the image frame corresponding to the pixel value matrix includes: The third quantization parameter is converted into an intensity coefficient, and the intensity coefficient is used to adjust the intensity parameters in the preset enhancement network; Based on the preset enhancement network with adjusted intensity parameters, the pixel value matrix is ​​subjected to image quality enhancement processing, and the image frame corresponding to the pixel value matrix is ​​output.

5. The method according to claim 3, characterized in that, The step of performing image quality enhancement processing on the pixel value matrix based on the third quantization parameter and outputting the image frame corresponding to the pixel value matrix includes: Based on the third quantization parameter, feature extraction is performed on the pixel value matrix to obtain the feature information of the pixel value matrix; Based on the feature information, image quality enhancement processing is performed on the pixel value matrix, and the image frame corresponding to the pixel value matrix is ​​output.

6. An image processing apparatus, characterized in that, include: Encoding module, determination module, and output module; The encoding module is used to encode the image data using a first resolution to obtain first bitstream information and first quantization parameters; The determining module is used to determine a first decision quantization parameter value of the image data based on the first resolution and the second resolution. The first decision quantization parameter value is the encoding distortion threshold value of the image data at the first resolution, and the second resolution is smaller than the first resolution. The output module is used to process the image data and output second bitstream information based on the first quantization parameter obtained by the encoding module and the first decision quantization parameter value determined by the determining module. The second bitstream information is the first bitstream information, or it is bitstream information obtained by encoding with a resolution smaller than the first resolution.

7. The apparatus according to claim 6, characterized in that, The output module is specifically used for: If the first quantization parameter is greater than the first decision quantization parameter value, the image data is encoded using the second resolution to obtain the third bitstream information and the second quantization parameter. Based on the second resolution and the third resolution, a second decision quantization parameter value for the image data is determined. The second decision quantization parameter value is the encoding distortion threshold value of the image data at the second resolution, and the third resolution is smaller than the second resolution. If the second quantization parameter is less than or equal to the value of the second decision quantization parameter, the third bitstream information is output.

8. The apparatus according to any one of claims 6 to 7, characterized in that, The device further includes: a decoding module and a processing module; The decoding module is used to decode the second bitstream information after the output module outputs the second bitstream information to obtain the pixel value matrix and the third quantization parameter corresponding to the image data. The processing module is used to perform image quality enhancement processing on the pixel value matrix based on the third quantization parameter obtained by the decoding module, and output the image frame corresponding to the pixel value matrix.

9. The apparatus according to claim 8, characterized in that, The processing module is specifically used for: The third quantization parameter is converted into an intensity coefficient, and the intensity coefficient is used to adjust the intensity parameter in the preset enhancement network; and, based on the preset enhancement network after adjusting the intensity parameter, the pixel value matrix is ​​subjected to image quality enhancement processing, and the image frame corresponding to the pixel value matrix is ​​output.

10. The apparatus according to claim 8, characterized in that, The processing module is specifically used for: Based on the third quantization parameter, feature extraction is performed on the pixel value matrix to obtain the feature information of the pixel value matrix; and based on the feature information, image quality enhancement processing is performed on the pixel value matrix to output the image frame corresponding to the pixel value matrix.

Citation Information

Patent Citations

  • Real-time video encoder rate control using dynamic resolution switching

    CN107040781A

  • Video encoding method and device, storage medium and equipment

    CN108391127A