Image quality improvement method and device, computer readable storage medium, computer device
By performing image quality detection and filtering, the problem of unstable bitrate caused by image quality improvement was solved, and image quality and smoothness were improved without affecting the bitrate.
Patent Information
- Application Number
- CN202210101720.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-27
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2042-01-27
AI Technical Summary
Existing technologies that reduce quantization parameters to improve image quality result in an increase in the size of the encoded bitstream, disrupting bitrate stability. Furthermore, frequent reduction of quantization parameters can lead to bitrate control failure, affecting image quality and smoothness.
By performing image quality detection, filtering is applied based on the detection results to reduce unnecessary byte usage, and the filtered image is then encoded to improve image quality without affecting bitrate stability.
Without affecting bitrate stability, improve image quality to ensure smooth playback and meet the transmission requirements of the preset bitrate, avoiding sacrificing frame rate for image quality improvement.
Smart Images

Figure CN116567291B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a picture quality improving method, a picture quality improving device, a computer readable storage medium, and a computer device. BACKGROUND
[0002] Some scene contents have complex scenes and low picture quality. Although the picture quality can be improved by reducing the quantization parameter, the size of the code stream after encoding the current frame image is increased, which destroys the code rate stability. In addition, if multiple complex pictures are encountered continuously, the encoding code rate will be greatly higher than the preset code rate, which causes the code rate control to fail. Even if the image is encoded at a high code rate, the picture quality observed by the human eye is still poor. SUMMARY
[0003] The embodiments of the present application provide a picture quality improving method, a picture quality improving device, a computer readable storage medium, and a computer device, which can improve the picture quality of a low-quality image without affecting the code rate stability.
[0004] In one aspect, a picture quality improving method is provided, which includes: obtaining an image parameter value; performing picture quality detection on a to-be-processed image according to the image parameter value to obtain a picture quality detection result corresponding to the to-be-processed image; filtering the to-be-processed image according to the picture quality detection result; encoding the to-be-processed image filtered to obtain an encoded code stream according to the picture quality detection result; and outputting the encoded code stream.
[0005] In another aspect, a picture quality improving device is provided, which includes: a first obtaining unit configured to obtain an image parameter value; a picture quality detection unit configured to perform picture quality detection on a to-be-processed image according to the image parameter value to obtain a picture quality detection result; a first filtering unit configured to filter the to-be-processed image according to the picture quality detection result; an encoding unit configured to encode the to-be-processed image filtered to obtain an encoded code stream according to the picture quality detection result; and a first output unit configured to output the encoded code stream.
[0006] In another aspect, a computer readable storage medium is provided, which stores a computer program adapted to be loaded by a processor to perform the steps in the picture quality improving method according to any one of the above embodiments.
[0007] In another aspect, a computer device is provided, which includes a processor and a memory, and the memory stores a computer program. The processor is configured to execute the steps in the picture quality improving method according to any one of the above embodiments by invoking the computer program stored in the memory.
[0008] The embodiment of the present application detects the quality of the image to be processed, filters the image to be processed according to the quality detection result related to the distortion degree, and encodes the filtered image to be processed, so as to improve the quality of the image to be processed. BRIEF DESCRIPTION OF DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0010] Figures 1 to 7 The application scenario provided by the embodiment of the present application is shown in the figure.
[0011] Figure 8 The structure diagram of the quality improvement system provided by the embodiment of the present application is shown in the figure.
[0012] Figure 9 The flowchart of the quality improvement method provided by the embodiment of the present application is shown in the figure.
[0013] Figure 10 The flowchart of the quality improvement method provided by the embodiment of the present application is shown in the figure.
[0014] Figure 11 The flowchart of the quality improvement method provided by the embodiment of the present application is shown in the figure.
[0015] Figure 12 The flowchart of the quality improvement method provided by the embodiment of the present application is shown in the figure.
[0016] Figure 13 The flowchart of the quality improvement method provided by the embodiment of the present application is shown in the figure.
[0017] Figure 14 The flowchart of the quality improvement method provided by the embodiment of the present application is shown in the figure.
[0018] Figure 15 The flowchart of the quality improvement method provided by the embodiment of the present application is shown in the figure.
[0019] Figure 16 The flowchart of the quality improvement method provided by the embodiment of the present application is shown in the figure.
[0020] Figure 17 The flowchart of the quality improvement method provided by the embodiment of the present application is shown in the figure.
[0021] Figure 18 The structure diagram of the quality improvement device provided by the embodiment of the present application is shown in the figure.
[0022] Figure 19 A schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0024] This application provides an image quality enhancement method, apparatus, computer device, and storage medium. Specifically, the image quality enhancement method of this application can be executed by a computer device, which can be a terminal or a server. The terminal can be a smartphone, tablet, laptop, desktop computer, smart TV, smart speaker, wearable smart device, smart vehicle terminal, etc. The terminal can also include a client, which can be a video client, browser client, or instant messaging client, etc. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0025] The embodiments of this application can be applied to various scenarios such as games, game basic technologies, and data processing.
[0026] For example, when this method is run on a terminal, the terminal device stores a game application and uses it to render virtual scenes in the game. The terminal device is used to interact with the user through a graphical user interface (GUI), such as by downloading, installing, and running the game application. The way the terminal device provides the GUI to the user can be varied; for example, it can be rendered and displayed on the terminal device's screen, or it can present the GUI through holographic projection. For instance, the terminal device can include a touchscreen display and a processor. The touchscreen display is used to present the GUI and receive user commands applied to the GUI, which includes game visuals. The processor is used to run the game, generate the GUI, respond to commands, and control the display of the GUI on the touchscreen display.
[0027] For example, when this method runs on a server, it can be cloud gaming. Cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the main body running the game application and the main body displaying the game screen are separated. The storage and execution of the method are completed on the cloud gaming server. The display of the game screen is completed on the cloud gaming client. The cloud gaming client is mainly used for receiving and sending game data and displaying the game screen. For example, the cloud gaming client can be a display device with data transmission capabilities close to the user, such as a mobile terminal, television, computer, PDA, personal digital assistant, etc., but the terminal device for processing game data is the cloud gaming server in the cloud. When playing the game, the user operates the cloud gaming client to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses the game screen and other data, returns it to the cloud gaming client through the network, and finally, the cloud gaming client decodes and outputs the game screen.
[0028] For example, when this method runs on a server, it can be used for cloud live streaming. Cloud live streaming refers to a live streaming method based on cloud computing. In the cloud live streaming operating mode, the main body running the live streaming application and the main body presenting the live stream are separate. The storage and execution of this method are completed on the cloud live streaming server. The presentation of the live stream is completed on the cloud live streaming client. The cloud live streaming client is mainly used for receiving and sending live streaming data and presenting the live stream. For example, the cloud live streaming client can be a display device with data transmission capabilities close to the user, such as a mobile terminal, television, computer, PDA, personal digital assistant, etc. However, the computer device that processes the live streaming data is the cloud live streaming server in the cloud. During live streaming, the user operates the cloud live streaming client to send operation commands to the cloud live streaming server. The cloud live streaming server runs the live streaming program according to the operation commands, encodes and compresses the live stream data, and returns it to the cloud live streaming client through the network. Finally, the cloud live streaming client decodes and outputs the live stream.
[0029] First, some of the nouns or terms that appear in the description of the embodiments of this application are explained as follows:
[0030] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.
[0031] Cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Based on the cloud computing business model, cloud technology encompasses network technology, information technology, integration technology, management platform technology, and application technology. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will require robust system support, which can only be achieved through cloud computing.
[0032] Cloud gaming, also known as gaming on demand, is an online gaming technology based on cloud computing. It enables thin clients with relatively limited graphics processing and data processing capabilities to run high-quality games. In cloud gaming, the game does not reside on the player's terminal but runs on a cloud server. The cloud server renders the game scene as a video and audio stream, which is then transmitted to the player's terminal via the network. The player's terminal does not need powerful graphics processing and data processing capabilities; it only needs basic streaming media playback capabilities and the ability to receive player input commands and send them to the cloud server.
[0033] A blockchain system can be a distributed system formed by clients and multiple nodes (any form of computing device connected to the network, such as servers and user terminals) connected through network communication. The nodes form a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP). In a distributed system, any machine, such as a server or terminal, can join and become a node. A node includes a hardware layer, a middleware layer, an operating system layer, and an application layer.
[0034] Video encoding: The method of converting a file in an original video format into a file in another video format through compression technology. The converted data can be called a bitstream.
[0035] Video decoding: The reverse process of video encoding.
[0036] A cloud server is a server that runs games in the cloud and has functions such as video enhancement (pre-encoding processing) and video encoding.
[0037] Smart terminals refer to a class of devices that possess rich human-computer interaction methods, internet access capabilities, typically run various operating systems, and have strong processing capabilities. Smart terminals include smartphones, living room TVs, tablets, in-vehicle terminals, and handheld game consoles, among others.
[0038] To enable better collaboration and joint optimization between cloud servers and smart terminals, video encoding configurations and computational tasks such as video image processing and video content analysis can be rationally allocated based on the hardware capabilities and real-time performance of the smart terminal during cloud gaming. This further enhances the cloud gaming visual experience within limited cloud server resources.
[0039] Video encoding collaboration: Based on the encoding and decoding capabilities of the smart terminal, and in combination with the game type and user network type, select the optimal encoding and decoding configuration and strategy.
[0040] Video rendering collaboration: Based on the graphics processing capabilities of smart terminals, video rendering tasks are rationally divided to enable effective collaboration between cloud servers and smart terminals, thereby improving video quality. This includes collaboration in rendering regions, rendering tasks, and video analysis and processing.
[0041] Terminal status coordination: Based on the real-time performance of the smart terminal, dynamically adjust the coding coordination tasks and rendering coordination strategies of the cloud server and the smart terminal to ensure the best user experience in real time.
[0042] The cloud server and smart terminal collaborative architecture mainly includes: cloud server, end-to-cloud collaboration strategy, end-to-cloud collaboration protocol, smart terminal collaboration interface, and software and hardware collaboration module.
[0043] A cloud server is a server that runs games in the cloud and has functions such as video enhancement (pre-encoding processing) and video encoding.
[0044] The edge-cloud collaboration strategy includes: video encoding collaboration strategy, video rendering collaboration strategy, and terminal status collaboration strategy. Based on the device capabilities reported by the smart terminal, and considering the game type and user network environment, the cloud server formulates the optimal video encoding and rendering collaboration strategy. Simultaneously, through terminal status collaboration, the cloud server obtains real-time information on the smart terminal's performance and dynamically adjusts the edge-cloud collaboration strategy accordingly.
[0045] The edge-cloud collaboration protocol refers to a unified protocol for data interaction between cloud servers and smart terminals.
[0046] The smart terminal collaboration interface refers to the interface between the smart terminal software and hardware modules. Through this interface, it is possible to effectively interact with the smart terminal, configure video encoding and rendering parameters, and obtain the real-time operating performance of the hardware.
[0047] The rendering capabilities of smart terminals are categorized into three types: ① lacking video and image processing capabilities, ② possessing partial video and image processing capabilities, and ③ possessing full video and image processing capabilities. Specifically, the definitions of terminal rendering capabilities are shown in Table 1, and the definitions of video processing algorithm types are shown in Table 2.
[0048] Table 1. Definition of Terminal Rendering Capabilities
[0049]
[0050] Table 2 Definition of Video Processing Algorithm Types
[0051]
[0052] Among them, the rendering capability of a smart terminal means that when the device does not have video image processing capabilities, it only has basic video playback functions and does not have video image processing capabilities implemented by hardware.
[0053] Among these, the rendering capability of a smart terminal refers to a device that, in addition to basic video playback functions, possesses specific video image processing capabilities implemented in hardware. However, due to limited device performance, it can only complete a portion of the video image processing functions. This includes two scenarios: ① At a given video frame rate, only local area video image processing can be completed, not full-image processing. ② At a given video frame rate, only a portion of the entire video image processing task can be completed, not the entire process.
[0054] Among them, the intelligent terminal rendering capability means that when the device has full video image processing capabilities, in addition to basic video playback functions, it also has specific video image processing capabilities implemented by hardware, and can complete video image processing of all areas and all processes at a given video frame rate.
[0055] The cloud server determines the set of rendering functions to be enabled based on the game type, and then determines the optimal rendering collaboration mode for the current device based on the device type and rendering capabilities reported by the smart terminal. Specific rendering collaboration strategies include: rendering region collaboration, rendering task collaboration, and video analysis collaboration.
[0056] Rendering region collaboration refers to dividing the rendering regions of cloud servers and smart terminals according to the computing power of the terminals for specific video enhancement tasks. Cloud server rendering is completed before video encoding (video preprocessing), while smart terminal rendering is completed after video decoding (video postprocessing).
[0057] For smart terminal devices that lack video image processing capabilities, video image enhancement is performed on a cloud server; the process is as follows: Figure 1The flowchart shown illustrates the process of a cloud server performing video image enhancement. Video content is generated and captured in the cloud (cloud server), and video image enhancement processing is performed on all areas in the cloud. Then, video image encoding is performed to obtain a video image stream. The cloud then transmits the video image stream to the terminal (smart terminal) via the network. The terminal decodes the video image stream and then displays the video image.
[0058] For smart terminal devices with some video image processing capabilities, video image enhancement can be performed on a cloud server for some areas and on the smart terminal for others. See the process below. Figure 2 The flowchart shown illustrates the collaborative rendering process between the cloud server and the smart terminal by region. Video content is generated and captured in the cloud (cloud server), and region a undergoes video image enhancement processing in the cloud, followed by video image encoding to obtain a video image stream. The cloud then transmits the video image stream to the terminal (smart terminal) via the network. The terminal decodes the video image stream, enhances region b within the decoded video image, and then displays the video image.
[0059] For smart terminal devices with full video image processing capabilities, video image enhancement can be entirely performed on the smart terminal itself; the process is as follows: Figure 3 The flowchart shown illustrates the process of a smart terminal completing video image enhancement. Video content is generated and captured in the cloud (cloud server), and then the video image is encoded to obtain a video image stream. The cloud then transmits the video image stream to the terminal (smart terminal) via the network. The terminal decodes the video image stream, performs video image enhancement processing on all areas of the terminal, and then displays the video image.
[0060] Collaborative rendering is geared towards specific video enhancement tasks, which can be divided into different independent subtasks, each corresponding to a different video image enhancement algorithm. For example... Figure 4 The video enhancement task A shown consists of three independent cascaded subtasks: the rendering task coordination will, based on the terminal's computing power, allow part of the video image enhancement task to be completed on the cloud server, and another part to be completed on the smart terminal. The video enhancement task completed on the cloud server is completed before video encoding (video preprocessing), and the video enhancement task completed on the smart terminal is completed after video decoding (video postprocessing).
[0061] Video analytics collaboration refers to the coordinated operation of two tasks: video content analysis and video image enhancement. The cloud server determines whether the video content analysis task should be performed on the cloud server or the smart terminal based on the terminal's computing power. The video content analysis results are used to guide video image enhancement and video encoding for the current or subsequent video frames.
[0062] For smart terminal devices that lack video content analysis capabilities, video content analysis is performed on a cloud server. The video analysis results are used to guide video image enhancement, cloud video image encoding, and smart terminal video image enhancement in the cloud. See the process below. Figure 5 The flowchart shown illustrates the process of a cloud server performing video content analysis. Video content is generated and captured in the cloud (cloud server), and video image analysis is performed in the cloud. Based on the video analysis results, cloud-based video image enhancement and encoding are performed. The encoded video image stream is then transmitted over the network from the cloud to the terminal (smart terminal). The terminal decodes the video image stream, performs video image enhancement processing based on the video analysis results, and then displays the video image.
[0063] For smart terminal devices equipped with video content analysis capabilities, the video content analysis task is completed on the smart terminal, and the video analysis results are used to guide video image enhancement, cloud-based video image encoding, and smart terminal video image enhancement. See the workflow below. Figure 6 The flowchart shown illustrates the collaborative rendering process between the cloud server and the smart terminal using an algorithm. The video image is analyzed on the terminal, and the analysis results are sent to the cloud.
[0064] Video content is generated and captured in the cloud (cloud server), and video images are encoded to obtain the video image stream of the current video frame. The video image stream of the current video frame is transmitted from the cloud to the terminal (smart terminal) via the network. The terminal decodes the video image stream of the current video frame, analyzes the decoded current video frame, and sends the video analysis results back to the cloud. The cloud then uses the video analysis results to enhance and encode the video images of subsequent video frames, and the terminal uses the video analysis results to enhance the video images of the current video frame and / or subsequent video frames. Finally, the terminal displays the video images.
[0065] The data structure requirements for video rendering collaborative optimization are shown in Table 3:
[0066] Table 3 Data Structure Requirements for Smart Terminal Rendering Capabilities
[0067]
[0068] Based on the rendering capabilities of the smart terminal and the game type, the cloud server determines the optimal rendering collaboration mode for the current device and returns the rendering algorithm, rendering area, and image recognition tasks required by the smart terminal.
[0069] like Figure 7 The diagram shown illustrates the collaborative optimization connection process for video rendering:
[0070] 1. The cloud server initiates a rendering capability request to the smart terminal through the START client. The request protocol fields include the protocol version number, video frame rate, and rendering algorithm type query. For example, the enumerated rendering algorithm types can be found in Table 2.
[0071] Similarly, cloud servers can also send video content analysis requests to smart terminals through the START client.
[0072] 2. When a smart terminal receives a request to obtain capability information, it returns a status flag (0 for success, and a specific error code for failure), the supported protocol version number, and the terminal device capability information.
[0073] 3. After receiving the terminal rendering capability information, the cloud server determines the optimal rendering collaboration configuration for the current terminal device and sends the collaboration task to the smart terminal.
[0074] 4. After receiving the rendering collaboration task, the smart terminal performs video rendering / analysis tasks.
[0075] Among them, the START client is a cloud gaming client that is installed on a smart terminal.
[0076] The following is an example of a video rendering collaborative optimization connection protocol:
[0077] 1. Video rendering capability request:
[0078] {
[0079] "render_ability": {
[0080] "version": "1.0",
[0081] resolution: "8",
[0082] "framerate": "8",
[0083] "type": "1,2"
[0084] }
[0085] }
[0086] 2. Video analytics capability request:
[0087] {
[0088] "analysis_ability": {
[0089] "version": "1.0",
[0090] "resolutuin": "8",
[0091] "framerate": "8",
[0092] "type": "1001"
[0093] }
[0094] }
[0095] 3. Video rendering capability response:
[0096] {
[0097] "render_ability": {
[0098] "state": "0",
[0099] "version": "1.0",
[0100] "renders": "2"
[0101] },
[0102] "render1": {
[0103] "type": "1",
[0104] "performances": "1",
[0105] "performance1": "8,8,10"
[0106] },
[0107] "render2": {
[0108] "type": "2",
[0109] "performances": "1",
[0110] "performance1": "8,8,5"
[0111] }
[0112] }
[0113] 4. Video rendering capability response (only partial rendering capability is supported):
[0114] {
[0115] "render_ability": {
[0116] "state": "0",
[0117] "version": "1.0",
[0118] "renders": "1"
[0119] },
[0120] "render1": {
[0121] "type": "2",
[0122] "performances": "1",
[0123] "performance1": "8,8,5"
[0124] }
[0125] }
[0126] 5. Video rendering capability response (rendering capability not supported):
[0127] {
[0128] "render_ability": {
[0129] "state": "0",
[0130] "version": "1.0",
[0131] "renders": "0"
[0132] }
[0133] }
[0134] 6. Video rendering capability response (protocol request failed):
[0135] {
[0136] "render_ability": {
[0137] "state": "-1",
[0138] "version": "0.9"
[0139] }
[0140] }
[0141] 7. Video analytics capabilities response:
[0142] {
[0143] "analysis_ability": {
[0144] "state": "0",
[0145] "version": "1.0",
[0146] "analyses": "1"
[0147] },
[0148] "analysis1": {
[0149] "type": "1001",
[0150] "performances": "1",
[0151] "performance1": "8,8,10"
[0152] }
[0153] }
[0154] 8. Video rendering / analysis task assignment (Example 1: Regional video sharpening enhancement):
[0155] {
[0156] "render_task": {
[0157] "version": "1.0",
[0158] "renders": "1"
[0159] },
[0160] "render1": {
[0161] "type": "1",
[0162] "name": "unsharp masking",
[0163] "scale": "100",
[0164] "regions": "2",
[0165] "region1": "0,0,33,33",
[0166] "region2": "67,67,100,100"
[0167] },
[0168] "render1_args": {
[0169] "threshold": "0",
[0170] "amount": "50",
[0171] "radius": "5"
[0172] }
[0173] }
[0174] 9. Video rendering / analysis task assignment (Example 2: Regional video sharpening enhancement + full-image HDR):
[0175] {
[0176] "render_task": {
[0177] "version": "1.0",
[0178] "renders": "2"
[0179] },
[0180] "render1": {
[0181] "type": "1",
[0182] "name": "unsharp masking",
[0183] "scale": "100",
[0184] "regions": "2",
[0185] "region1": "0,0,33,33",
[0186] "region2": "67,67,100,100"
[0187] },
[0188] "render1_args": {
[0189] "threshold": "0",
[0190] "amount": "50",
[0191] "radius": "5"
[0192] },
[0193] "render2": {
[0194] "type": "2",
[0195] "name": "hdr",
[0196] "scale": "100",
[0197] "regions": "1",
[0198] "region1": "0,0,100,100"
[0199] }
[0200] }
[0201] 10. Video rendering / analysis task distribution (Example 3: Full-image HDR + video complexity analysis):
[0202] {
[0203] "render_task": {
[0204] "version": "1.0",
[0205] "renders": "1"
[0206] },
[0207] "render1": {
[0208] "type": "2",
[0209] "name": "hdr",
[0210] "scale": "100",
[0211] "regions": "1",
[0212] "region1": "0,0,100,100"
[0213] },
[0214] "analysis_task": {
[0215] "version": "1.0",
[0216] "analyses": "1"
[0217] },
[0218] "analysis1": {
[0219] "type": "1002",
[0220] "name": "xxx",
[0221] "scale": "100",
[0222] "regions": "1",
[0223] "region1": "33,33,67,67"
[0224] }
[0225] }
[0226] Current HDR devices require HDR video resources to achieve optimal performance. However, in cloud gaming scenarios, not all games have HDR rendering capabilities; SDR rendering is commonly used, preventing HDR devices from fully utilizing their features. For example, ... Figure 15 The flowchart shown illustrates the rendering process of SDR video acquisition, encoding, and decoding. In a cloud gaming scenario, the cloud acquires SDR video and encodes it to obtain an SDR video stream. The cloud then transmits the SDR video stream to the terminal via the network. The terminal decodes the SDR video stream and then renders the SDR image to output the SDR video.
[0227] Real-time audio interactive products such as cloud gaming, cloud live streaming, cloud conferencing, and video calls often require real-time encoding and transmission of images. Taking cloud gaming as an example, the game runs in the cloud, and the cloud server encodes and transmits the game's real-time images to the player's terminal. The game scene rendering, game image processing, and other calculations are all completed on the cloud server, allowing players to enjoy high-quality game visuals without needing powerful graphics processing capabilities on their terminals.
[0228] In the image encoding and transmission stage, if the image is complex, the quantization parameter is often reduced to improve image quality in order to clearly reproduce the intricate scene details. However, while reducing the quantization parameter can improve image quality, it increases the bitrate size of the encoded frame, disrupting bitrate stability. If complex scenes appear consecutively, frequently reducing the quantization parameter to improve image quality may cause the bitrate of these frames to exceed the preset bitrate allocated by the encoder, leading to bitrate control failure. This could result in sacrificing frame rate to ensure image quality, causing stuttering and unplayable scenes in cloud gaming; or sacrificing image quality to ensure frame rate, resulting in degraded image quality.
[0229] This application proposes an image quality enhancement method. The method involves performing image quality detection, filtering the image based on the detection results to reduce unnecessary byte usage in low-quality images, and then encoding the filtered image. The saved bytes are used to improve image quality during encoding, resulting in an enhanced image quality after encoding. Since this image quality enhancement method does not affect the quantization parameter settings, it does not adversely affect the stability of the bitrate, meeting the transmission requirements of the preset bitrate. It does not sacrifice frame rate for image quality enhancement, ensuring smooth playback during transmission and interaction.
[0230] The method provided in this application can be applied to real-time audio interactive products such as cloud gaming, cloud live streaming, cloud conferencing, and video calls to improve the image quality of low-quality scenes after encoding.
[0231] Please see Figure 8 , Figure 8This is a schematic diagram of a system for displaying information in a game, as provided in an embodiment of this application. The system may include at least one terminal 1000, at least one server 2000, at least one database 3000, and a network 4000. The user-held terminal 1000 can connect to servers of different games via the network 4000. The terminal 1000 is any device with computing hardware capable of supporting and executing software products corresponding to the game. Additionally, the terminal 1000 has one or more multi-touch screens for sensing and obtaining input from touch or swipe operations performed by the user at multiple points on one or more touch displays. Furthermore, when the system includes multiple terminals 1000, multiple servers 2000, and multiple networks 4000, different terminals 1000 can be interconnected via different networks 4000 and different servers 2000. The network 4000 can be a wireless network or a wired network, such as a wireless local area network (WLAN), local area network (LAN), cellular network, 2G network, 3G network, 4G network, 5G network, etc. Furthermore, different terminals 1000 can connect to other terminals or servers using their own Bluetooth networks or hotspot networks. For example, multiple users can connect online through different terminals 1000 and synchronize with each other via appropriate networks to support multiplayer games. Additionally, the system can include multiple databases 3000, which are coupled to different servers 2000. Information related to the game environment can be continuously stored in the databases 3000 as different users engage in multiplayer games online.
[0232] In this embodiment of the application, when performing image quality enhancement processing, the server 2000 can specifically be used to: obtain image parameter values, including encoding count values, distortion variable values, and the capacity of the distortion array; perform image quality detection on the image to be processed according to the image parameter values to obtain the image quality detection result corresponding to the image to be processed; filter the image to be processed according to the image quality detection result; encode the filtered image to be processed according to the image quality detection result to obtain an encoded bitstream; and output the image to be processed according to the encoded bitstream.
[0233] In this embodiment of the application, in a cloud gaming scenario, the game screen is generated on server 2000, which is capable of encoding and transmitting the game images. Different players can connect their terminals 1000 to server 2000 via network 4000 to receive and display the corresponding game images on their terminals 1000.
[0234] In other embodiments of this application, the image quality enhancement method can also be executed by the terminal 1000. For example, if the terminal 1000 has a downloaded game client, the game can be run directly on the terminal 1000, the game screen is generated by the terminal 1000, and the terminal 1000 enhances the image quality of the game screen using the image quality enhancement method of this application.
[0235] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the priority of the embodiments.
[0236] This application provides a method for improving image quality, which can be executed by a terminal or a server, or by both a terminal and a server. This application uses the example of the image quality improvement method being executed by a server to illustrate the method.
[0237] Please see Figures 9 to 17 , Figures 9 to 17 These are schematic flowcharts illustrating the image quality enhancement method provided in the embodiments of this application. The method includes:
[0238] Step 210: Obtain image parameter values.
[0239] Optionally, the image parameter values include the encoding count value, the distortion variable value, and the capacity of the distortion array.
[0240] Optionally, the images processed by the image quality enhancement method will eventually be encoded. The encoding count value is used to count the number of images processed. The step size of the encoding count value is 1, meaning that after each frame of image is processed by the image quality enhancement method, the encoding count value increases by 1 after the encoding of that frame is completed. Optionally, in some embodiments, the step size of the encoding count value can also be 2, 3, 4, or higher values, which are not listed here. Taking a step size of 2 as an example, it means that after the image quality enhancement processing of one frame of image is completed, the encoding count value increases by 2. Therefore, the adjacent next frame of image will not undergo the image quality detection process in step 220 and the filtering process in step 230, and will be directly encoded. Similarly, when the step size of the encoding count value is n, it means that after the processing of one frame of image, the adjacent next n-1 frames of image will be directly encoded. For multiple consecutive static images or images with small changes in motion, since the human eye can easily capture the details of such images, a smaller counter step size can be set to ensure that the human eye perceives high image quality for these multiple consecutive images. For images with large, continuous motion changes across multiple frames, the human eye struggles to capture the details. Therefore, a larger counter step size can be set to allow for a certain degree of image blur, thereby improving image processing efficiency.
[0241] Optionally, the distortion variable value is represented by the Sum of Absolute Transformed Difference (SATD). SATD is a common metric used in video coding to represent coding distortion. The SATD value is obtained by performing a Hadamard transform on the residual matrix of the predicted and true values, and then summing all the coefficients of the transformed matrix. Optionally, embodiments of this application use the SATD value as a distortion variable to measure the degree of image distortion.
[0242] Optionally, the distortion array is an array containing multiple variables, the total number of variables being the capacity of the distortion array. Each variable is used to measure the degree of distortion of a frame of image, and the distortion array can measure the degree of distortion of multiple frames of image based on the multiple variables it contains. Optionally, embodiments of this application use the SATD value as a variable in the distortion array to measure the degree of image distortion.
[0243] Optionally, when using the image enhancement method to process an image for the first time, the encoding count value, the distortion variable value, and the values of each variable in the distortion array are set to 0, that is, the image parameter values are initialized.
[0244] Optionally, image enhancement methods can be implemented using a trained image enhancement model. The image enhancement model is an artificial intelligence (AI) model. Artificial intelligence is the theory, methods, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. Artificial intelligence studies the design principles and implementation methods of various intelligent machines, enabling them to have perception, reasoning, and decision-making functions. When using a trained image enhancement model to implement the image enhancement method, the image parameter values can be initial settings, i.e., setting the encoding count, distortion variable value, and distortion array capacity to 0; or, the image parameter values can be the image parameter values obtained during the training of the image enhancement model, and the trained image enhancement model directly applies the image parameter values obtained during training to process the input image.
[0245] Step 220: Perform image quality detection on the image to be processed based on the image parameter values to obtain the image quality detection result corresponding to the image to be processed.
[0246] Step 230: Filter the image to be processed based on the image quality detection results.
[0247] Optionally, image quality detection is used to determine whether the image to be processed is a low-quality image. If the image itself has high quality, it can be directly encoded and transmitted without the need for image quality enhancement methods. Factors that may lead to low image quality include: high image noise, complex scenes in the image making it difficult to clearly reproduce the various details in the complex image with the available bytes at the preset bitrate, etc. These low-quality images can all be filtered in step 230 to improve their image quality.
[0248] Optionally, the image quality detection result includes a first detection result and a second detection result. The first detection result indicates that the current frame image is a low-quality image, or that the current frame image requires filtering. The second detection result indicates that the current frame image does not require filtering.
[0249] The human eye is less sensitive to high-frequency components in an image and more sensitive to low-frequency components. The abundance of high-frequency components in an image is one reason why the human eye perceives low image quality. Optionally, the image quality detection result in step 220 can reflect whether there are high-frequency components in the image to be processed that need to be filtered out. Step 230 filters the image to be processed, removing high-frequency components so that the bytes originally occupied by high-frequency components are allocated to low-frequency components at a preset bitrate, concentrating the bitrate on the low-frequency components that the human eye is sensitive to. In this way, the image quality perceived by the human eye can be improved without increasing the bitrate. Furthermore, since the process of improving image quality does not affect the setting of quantization parameters, it will not adversely affect the stability of the bitrate, meeting the transmission requirements of the preset bitrate. The frame rate is not sacrificed for image quality improvement, ensuring smooth playback during transmission and interaction of the image after quality enhancement.
[0250] Optional, such as Figure 10 As shown, step 220 can be implemented through steps 310 to 340, specifically as follows:
[0251] Step 310: Determine whether the encoded count value is greater than or equal to the capacity.
[0252] Step 320: If the encoded count value is greater than or equal to the capacity, select the largest variable value from the variables in the distortion array.
[0253] Step 330: Determine whether the value of the distorted variable is greater than the product of the preset weight and the maximum variable value.
[0254] Step 340: If the value of the distorted variable is greater than the product of the preset weight and the maximum variable value, output the first detection result.
[0255] Optionally, the first detection result indicates that the current frame image is a low-quality image, or that the current frame image is an image that needs to be filtered.
[0256] Optionally, as an example, let the encoding count be i, the capacity be n, the distortion variable be S0, the preset weight be q, and the distortion array be U, U={S1, ...,Sj}, where S1, ...,Sj are variables in the distortion array U, and j>1.
[0257] Step 310 is used to determine whether the encoded count value i is greater than or equal to the capacity n. If i < n, steps 320 to 340 will not be executed, meaning the first detection result will not be output. Instead, the variables in the distortion array will be updated using the SATD value of the current frame image, and the acquisition of the next frame image will continue until i ≥ n, at which point step 320 will be executed. In this case, the variables in the distortion array U are updated at least n times. If different variables are updated sequentially each time, then when i ≥ n, each variable in the distortion array U will be updated sequentially, so that the distortion array U can reflect the degree of distortion corresponding to the in-th to i-1-th frames.
[0258] For example, in one embodiment, after initializing the parameters, i=0 and n=3, i.e., the distortion array U={S1, S2, S3}, where S1, S2, and S3 are all 0. When i=0, the 0th frame image is input. Since 0<3, S1 is set to the SATD value corresponding to the 0th frame image, and the encoding count i is increased by 1. When i=1, the 1st frame image is input. Since 1<3, S2 is set to the SATD value corresponding to the 1st frame image, and the encoding count i is increased by 1. When i=2, the 2nd frame image is input. Since 2<3, S3 is set to the SATD value corresponding to the 2nd frame image, and the encoding count i is increased by 1. When i=3, the variables S1, S2, and S3 of the capacity n correspond to the SATD values of the 0th, 1st, and 2nd frames image, respectively. At this time, the distortion array U can reflect the distortion degree of the 0th to 2nd frames image. When i=3, the third frame image is input. Since 3=3, the execution condition of step 320 is met. Under this condition, the maximum variable value is selected from the distortion array U.
[0259] Let the maximum variable value be Smax. In step 330, the product of the distortion variable value S0 and the maximum variable value Smax and the preset weight q, Smax*q, is determined. Combined with step 340, if S0 > Smax*q, the first detection result is output. Combined with step 230, if the image quality detection result is the first detection result, the image to be processed in the current frame is filtered to improve the image quality.
[0260] The maximum variable value Smax is the largest variable selected from the variables in the distortion array U. The distortion array U reflects the degree of distortion of the images from frame in to frame i-1. Therefore, the maximum variable value Smax reflects the maximum distortion of the images from frame in to frame i-1.
[0261] In one embodiment, the distortion variable value S0 reflects the distortion level of the (i-1)th frame (previous frame). First, the distortion variable S0 is set equal to the SATD value of the (i-1)th frame image. Then, the encoding count value is updated from i-1 to i, and the process proceeds to step 310. In this case, step 330 determines the relationship between the distortion variable value S0 and the product Smax*q of the maximum variable value Smax and the preset weight q. That is, the distortion level of the (i-1)th frame image is measured based on the maximum distortion from frame in to frame i-1. If S0 > Smax*q, the distortion level of the (i-1)th frame image is considered to have reached the standard for being identified as a low-quality image (or an image requiring filtering). In this case, the first detection result is output.
[0262] In another embodiment, the distortion variable value S0 reflects the distortion level of the i-th frame (current frame) image. This involves updating the encoded count value from i-1 to i, obtaining the SATD value of the i-th frame image, updating the distortion variable S0 to this SATD value, and then proceeding to step 310. In this case, step 330 determines the relationship between the distortion variable value S0 and the product Smax*q of the maximum variable value Smax and the preset weight q. That is, the distortion level of the i-th frame image is measured based on the maximum distortion from frame in to frame i-1. If S0 > Smax*q, the distortion level of the i-th frame image is considered to have reached the standard for being identified as a low-quality image, and in this case, the first detection result is output.
[0263] The larger the value of capacity n, the larger the sample size for image quality detection, and the easier it is to find low-quality images in a series of high-quality images; the smaller the value of capacity n, the better the timeliness of image quality detection and the higher the processing efficiency.
[0264] In this design, the preset weight q is greater than 1. Therefore, even if the distortion level reflected by the maximum variable value Smax does not meet the standard for being classified as a low-quality image, the product of the maximum variable value Smax and the preset weight q, Smax*q, may still meet the standard for being classified as a low-quality image. Thus, even if the image corresponding to the maximum variable value Smax is not a low-quality image, it can still be classified as a low-quality image based on the value of Smax*q. A larger preset weight q makes it easier to classify the image as low-quality; a smaller preset weight q makes it more difficult to classify the image as low-quality. The value of q can be appropriately adjusted according to the application scenario to make the first detection result more accurate.
[0265] Optional, such as Figure 10 As shown, step 220 can also be implemented through steps 310 to 360, of which steps 310 to 340 have been described above and will not be repeated here. Steps 350 to 360 are specifically as follows:
[0266] Step 350: If the encoded count value is less than the capacity, output the second detection result.
[0267] Optionally, the second detection result indicates that the current frame image is an image that has not undergone filtering.
[0268] Step 360: Output the second detection result if the value of the distorted variable is less than or equal to the product of the preset weight and the maximum variable value.
[0269] Optionally, as an example, let the encoding count be i, the capacity be n, the distortion variable be S0, the preset weight be q, and the distortion array be U, U={S1, ...,Sj}, where S1, ...,Sj are variables in the distortion array U, and j>1.
[0270] If the encoded count value i is less than the capacity n, i.e. i < n, it is considered that the samples in the distortion array are insufficient to evaluate the distortion level of the image to be processed in that frame, and therefore no filtering processing is performed on the image to be processed in that frame.
[0271] If the distortion variable value S0 is less than or equal to the product of the preset weight q and the maximum variable value Smax, i.e., S0≤Smax*q, then the distortion level of the image to be processed in that frame does not meet the standard for being identified as a low-quality image, and therefore no filtering processing is performed on that image.
[0272] To better illustrate step 220 of the image quality enhancement method provided in this embodiment, please refer to... Figures 9 to 11 The process of step 220 of the image quality enhancement method provided in this application embodiment can be summarized as follows:
[0273] Step 310: Determine whether the encoded count value is greater than or equal to the capacity. If yes, proceed to step 320; otherwise, proceed to step 350.
[0274] Step 320: If the encoded count value is greater than or equal to the capacity, select the largest variable value from the variables in the distortion array.
[0275] Step 330: Determine whether the value of the distorted variable is greater than the product of the preset weight and the maximum variable value. If yes, proceed to step 340; otherwise, proceed to step 360.
[0276] Step 340: If the value of the distorted variable is greater than the product of the preset weight and the maximum variable value, output the first detection result.
[0277] Step 350: If the encoded count value is less than the capacity, output the second detection result.
[0278] Step 360: Output the second detection result if the value of the distorted variable is less than or equal to the product of the preset weight and the maximum variable value.
[0279] Optional, such as Figure 10 As shown, the image quality enhancement method further includes: step 230, filtering the image to be processed based on the image quality detection results to improve the image quality. Optionally, such as... Figure 12 As shown, step 230 can be implemented through steps 510 to 520, specifically as follows:
[0280] Step 510: Obtain the gradient values of multiple pixels in the image to be processed.
[0281] Optionally, the gradient value is used to determine whether a pixel belongs to the high-frequency part (high-frequency component) or the low-frequency part (low-frequency component).
[0282] Step 520: If the gradient value is greater than a preset gradient threshold, filter the pixel corresponding to the gradient value.
[0283] Optionally, depending on different filtering settings, filtering the pixel corresponding to the gradient value may include filtering a single pixel corresponding to the gradient value, or filtering the pixel corresponding to the gradient value and the pixels surrounding that pixel.
[0284] Optional, such as Figure 13 As shown, step 510 can be implemented through steps 610 to 620, specifically as follows:
[0285] Step 610: Obtain the width value, height value, first variable value, and second variable value of the image to be processed. The first variable value represents the coordinate position of multiple pixels along the height direction, and the second variable value represents the coordinate position of multiple pixels along the width direction. When the values of the first variable value and the second variable value are determined, a pixel with a coordinate position can be determined according to the coordinates along the height direction and the width direction corresponding to the first variable value and the second variable value.
[0286] Step 620: If the value of the first variable is less than the difference between the height value and the preset value, and the value of the second variable is less than the difference between the width value and the preset value, obtain the gradient value of the pixel corresponding to the first variable and the second variable.
[0287] Optionally, as an example, let the width of the image to be processed be w, the height be h, the first variable be Y, the second variable be X, and the preset value be m. Both height and width are in pixels; for example, a height value h=1 indicates a height of 1 pixel. Based on the values of the first variable Y and the second variable X, the position of a pixel p(X, Y) in the image to be processed can be determined. Pixel p(X, Y) has a corresponding pixel value d(X, Y), and the gradient value corresponding to pixel p(X, Y) is set as G(X, Y). For example, when Y=1 and X=1, pixel p(1,1) can be determined, and the gradient value corresponding to pixel p(1,1) is G(1,1); for example, when Y=y and X=x, pixel p(x,y) can be determined, and the gradient value corresponding to pixel p(x,y) is G(x,y).
[0288] In one embodiment, if the preset value m=1, then when Y < h-1 and X < w-1, the gradient value G(X, Y) corresponding to pixel p(X, Y) is obtained. That is, the coordinate position Y of the pixel p(X, Y) whose gradient value is obtained does not exceed h-1 along the height direction, and the coordinate position X along the width direction does not exceed w-1. If the initial value of the first variable Y is 1 and the initial value of the second variable X is 1, then among the multiple pixels p(X, Y) whose gradient values are obtained, Y=[1, h-2] and X=[1, w-2], that is, when Y=[h-1, h] or X=[w-1, w], the gradient value G(X, Y) of pixel p(X, Y) is not obtained. In other embodiments, the preset value m can be 0 or other positive integers. For example, if m=0, then when Y < h and X is less than w, the gradient value G(X, Y) corresponding to pixel p(X, Y) is obtained. In other embodiments, the initial value of the first variable Y can also be any other integer greater than 1, and the initial value of the second variable X can also be any other integer greater than 1; there are no restrictions here.
[0289] Optionally, in one embodiment, let Y=y, X=x, and the gradient value G(x,y) corresponding to pixel p(x,y) is the sum of the absolute value of the horizontal gradient value Gw(x,y) of pixel p(x,y) and the absolute value of the vertical gradient value Gh(x,y) of pixel p(x,y), that is: G(x,y) = |Gw(x,y)| + |Gh(x,y)|. The horizontal gradient value Gw(x,y) and the vertical gradient value Gh(x,y) of pixel p(x,y) are obtained by the following formulas:
[0290] Gw(x,y)=d(x+1,y-1)+2*d(x+1,y)+d(x+1,y+1)-d(x-1,y-1)-2*d(x-1,y)-d(x-1,y+1);
[0291] Gh(x,y)=d(x+1,y-1)+2*d(x+1,y)+d(x+1,y+1)-d(x-1,y-1)-2*d(x-1,y)-d(x-1,y+1).
[0292] Optionally, in one embodiment, the gradient value G(x,y) corresponding to pixel p(x,y) can be calculated using a convolutional neural network, where G(x,y) = |Gw(x,y)| + |Gh(x,y)|. Here, Gw(x,y) and Gh(x,y) are respectively set as the horizontal convolutional kernel Gcw and the vertical convolutional kernel Gch.
[0293] ; .
[0294] Optional, such as Figure 13 As shown, step 510 can also be implemented through steps 610 to 630. Steps 610 to 620 have been described above and will not be repeated here. Step 630 specifically involves:
[0295] Step 630: If the value of the first variable is greater than or equal to the difference between the height value and the preset value, the filtering ends.
[0296] Optionally, as an example, let the width of the image to be processed be w, the height be h, the first variable be Y, the second variable be X, and the preset value be m. Then, the pixel point p(X, Y) whose gradient value is obtained will end if the coordinate Y along the height direction does not exceed hm; otherwise, the filtering ends. For example, if the preset value m=1, then the filtering ends when Y≥h-1, that is, when Y=[h-1, h].
[0297] Optional, such as Figure 13 As shown, step 510 can also be implemented through steps 610 to 650. Steps 610 to 630 have been described above and will not be repeated here. Steps 640 to 650 are as follows:
[0298] Step 640: If the second variable value is greater than or equal to the difference between the width value and the preset value, the first variable value is increased by a preset second step to obtain the increased first variable value, and the second variable value is reset to obtain the reset second variable value.
[0299] Step 650: If the increased value of the first variable is less than the difference between the height value and the preset value, and the reset value of the second variable is less than the difference between the width value and the preset value, obtain the gradient value of the pixel corresponding to the increased value of the first variable and the reset value of the second variable.
[0300] Optionally, as an example, let the width of the image to be processed be w, the height be h, the first variable be Y, the second variable be X, and the preset value be m. Assume the current value of the second variable X is x, the value of the first variable Y is y, and the preset second step size is 1. If x ≥ wm, the value of the first variable Y is increased by 1, i.e., the increased value of the first variable Y is y+1. Assuming the initial value of the second variable X is 1, the reset value of the second variable X is 1. That is, when X = x and x ≥ wm, setting Y = y+1 and X = 1 is equivalent to completing the gradient value detection of one row of pixels in the horizontal direction, and starting gradient value detection from the first pixel of the next row.
[0301] Step 650 is equivalent to replacing the first variable value in step 620 with the increased first variable value, and the second variable value with the reset second variable value. That is, when Y=y+1 and X=1, if y+1<hm and 1<wm, then the gradient value corresponding to the pixel point p(1,y+1) corresponding to the current first variable value X and second variable value Y is obtained.
[0302] If the increased value of the first variable Y is greater than or equal to the difference between the width value and the preset value, the filtering ends according to step 630. That is, if Y ≥ hm, the filtering ends according to step 630.
[0303] Optional, such as Figure 12 As shown, step 230 can also be implemented through steps 510 to 530, which have already been described above and will not be repeated here. Step 530 specifically involves:
[0304] Step 530: If the gradient value is less than or equal to the preset gradient threshold, or after filtering, increase the second variable value by the preset third step size to obtain the increased second variable value.
[0305] Optionally, as an example, let the first variable be X, the second variable be Y, the gradient value corresponding to pixel p(X,Y) be G(X,Y), and the preset gradient threshold be Gt. Assume the current value of the first variable X is x, the value of the second variable Y is y, the corresponding pixel is p(x,y), and the preset third step size is 1. If the gradient value G(x,y) corresponding to pixel p(x,y) is greater than the preset gradient threshold Gt, i.e., G(x,y) > Gt, then according to step 520, the pixel p(x,y) is filtered, and after filtering, according to step 530, the value of the first variable X is increased by 1 to obtain the increased first variable value X, where the increased first variable value X = x + 1. If the gradient value G(x,y) corresponding to pixel p(x,y) is less than or equal to the preset gradient threshold Gt, i.e., G(x,y) ≤ Gt, the condition for filtering pixel p(x,y) in step 520 is not met. Therefore, pixel p(x,y) is not filtered. Instead, the value of the second variable X is increased by 1 according to step 530 to obtain the increased second variable value X = x + 1. The second variable value X is increased by the preset third step size. The purpose is to perform gradient value detection on the next pixel in the same row.
[0306] Optional, such as Figure 13 As shown, step 510 can also be implemented through steps 610 to 660. Steps 610 to 650 have been described above and will not be repeated here. Step 660 specifically involves:
[0307] Step 660: If the value of the first variable is less than the difference between the height value and the preset value, and the value of the increased second variable is less than the difference between the width value and the preset value, obtain the gradient value of the pixel corresponding to the first variable and the value of the increased second variable.
[0308] Step 660 is equivalent to replacing the second variable value in step 620 with the increased second variable value. Optionally, as an example, let the width of the image to be processed be w, the height be h, the first variable be Y, the second variable be X, and the preset value be m. Assume the current value of the second variable X is x, the value of the first variable Y is y, and the preset third step size is 1. After obtaining the increased second variable X according to step 530, the next pixel point p(x+1, y) is obtained, and step 660 is executed, which is equivalent to executing step 620 when the second variable value X = x+1. Since the value of the first variable Y has not changed, it is only necessary to determine whether the increased second variable value x+1 is less than the difference between the width value and the preset value to determine whether to obtain the gradient value corresponding to the pixel point p(x+1, y). According to step 660 or step 620, the gradient value corresponding to the pixel point p(x+1, y) is obtained when x+1 < wm.
[0309] Optional, such as Figure 14 As shown, the gradient threshold includes a first threshold and a second threshold. Step 520 can be implemented through steps 710 to 740, specifically as follows:
[0310] Step 710: Determine whether the gradient value is greater than the first threshold.
[0311] Step 720: If the gradient value is greater than the first threshold, perform median filtering on the pixel corresponding to the gradient value.
[0312] Step 730: Determine whether the gradient value is greater than the second threshold.
[0313] Step 740: If the filtered gradient value is greater than the second threshold, perform mean filtering on the pixel corresponding to the gradient value.
[0314] Steps 710 to 740 provide two filtering methods: median filtering and mean filtering to remove high-frequency components from the image to be processed. In other embodiments, other low-pass filtering methods, such as Gaussian filtering, may also be used, and this is not limited here. In the embodiments of this application, step 520 may use only one low-pass filtering method or a combination of multiple low-pass filtering methods, and this is not limited here. This embodiment uses a combination of median filtering and mean filtering as an example for explanation.
[0315] Optionally, let the gradient value of pixel p(x, y) be G(x, y), the first threshold be Gt1, the second threshold be Gt2, and the filtering gradient value be Gl(x, y). Step 710 determines whether the gradient value G(x, y) is greater than the first threshold Gt1. If yes, then proceed to step 720; if no, then according to step 530, increase the second variable value X by a preset third step size, for example, the increased second variable value X = x + 1, and then re-execute step 620 or step 660 to determine whether to obtain the gradient value of pixel p(x + 1, y).
[0316] Given G(x, y) > Gt1, obtain the pixel values of pixel p(x, y) and its eight neighboring pixels: p(x+1, y), p(x-1, y), p(x, y+1), p(x+1, y+1), p(x-1, y+1), p(x, y-1), p(x+1, y-1), and p(x-1, y-1). Sort the pixel values according to their size to find the fifth largest pixel value Pm. Set the pixel value of pixel p(x, y) to Pm to complete the median filtering. Thus, the median filtering uses the median Pm of the nine pixel values in a 3×3 matrix centered at pixel p(x, y) as the pixel value of pixel p(x, y). In other embodiments, the median Pm can also be the median of multiple pixel values in a 4×4 matrix, 5×5 matrix, or other matrix centered at pixel point p(x,y); or it can be the median of pixel values of any number of pixels selected according to a preset rule, including pixel point p(x,y), for example, the preset rule is: pixel point p(x,y) is located in a 2×2 matrix at the lower left corner.
[0317] Similarly, in step 730, it is determined whether the gradient value G(x, y) is greater than the second threshold Gt2. If yes, step 740 is executed; otherwise, the second variable value X is increased by a preset third step size according to step 530, for example, the increased second variable value X = x + 1, and then step 620 or step 660 is executed again to determine whether the gradient value of pixel p(x + 1, y) is obtained.
[0318] Let the mean be Pv, and let pixel p(X,Y) have a corresponding pixel value d(X,Y). When G(x,y)>Gt2, the mean Pv is calculated based on the pixel values of pixel p(x,y) and its 8 neighboring pixels: p(x+1,y), p(x-1,y), p(x,y+1), p(x+1,y+1), p(x-1,y+1), p(x,y-1), p(x+1,y-1), and p(x-1,y-1). Pv=d(x-1,y-1)+2*d(x,y-1)+d(x+1,y-1)+2*d(x-1,y)+8*d(x,y)+2*d(x+1,y)+d(x-1,y+1)+2*d(x,y+1)+d(x+1,y+1). Let the pixel value d(x,y) of pixel point p(x,y) = Pv / 20 to complete the mean filtering. In other embodiments, the mean Pv can also be calculated based on multiple pixel values of a 4×4 matrix, a 5×5 matrix, or other matrices centered at pixel point p(x,y). Alternatively, the mean Pv can be calculated based on any number of pixels, including pixel point p(x,y), selected according to a preset rule. For example, the preset rule is: pixel point p(x,y) is located in a 2×2 matrix at the lower left corner.
[0319] Optionally, in one embodiment, step 720 performs median filtering on the pixel to obtain the filtered gradient value of the pixel. In step 730, it is determined whether the filtered gradient value is greater than a second threshold. If so, mean filtering is performed on the pixel. For example, let the filtered gradient value of pixel p(x, y) be Gl(x, y), and the second threshold be Gt2. If Gl(x, y) ≤ Gt2, step 530 is executed to increase the second variable value X by a preset third step size, for example, the increased second variable value X = x + 1, and then step 620 or step 660 is executed again to determine whether the gradient value of pixel p(x + 1, y) is obtained; if Gl(x, y) > Gt2, mean filtering is performed on the pixel p(x, y) after median filtering, and step 530 is executed after filtering.
[0320] To better illustrate step 230 of the image quality enhancement method provided in this embodiment, please refer to... Figures 9 to 8 In one embodiment, the process of step 230 can be summarized as follows:
[0321] Step 610: Obtain the width value, height value, first variable value, and second variable value of the image to be processed. The first variable value represents the coordinate position of the pixel along the height direction, and the second variable value represents the coordinate position of the pixel along the width direction.
[0322] Step 620: If the value of the first variable is less than the difference between the height value and the preset value, and the value of the second variable is less than the difference between the width value and the preset value, obtain the gradient value of the pixel corresponding to the first variable and the second variable.
[0323] Step 630: If the value of the first variable is greater than or equal to the difference between the height value and the preset value, the filtering ends.
[0324] Step 640: If the second variable value is greater than or equal to the difference between the width value and the preset value, the first variable value is increased by a preset second step to obtain the increased first variable value, and the second variable value is reset to obtain the reset second variable value.
[0325] Step 650: If the increased value of the first variable is less than the difference between the height value and the preset value, and the reset value of the second variable is less than the difference between the width value and the preset value, obtain the gradient value of the pixel corresponding to the increased value of the first variable and the reset value of the second variable.
[0326] Step 530: If the gradient value is less than or equal to the preset gradient threshold, or after filtering, increase the second variable value by the preset third step size to obtain the increased second variable value.
[0327] Step 660: If the value of the first variable is less than the difference between the height value and the preset value, and the value of the second variable after the increase is less than the difference between the width value and the preset value, obtain the gradient value of the pixel corresponding to the first variable and the value of the second variable after the increase.
[0328] Step 710: Determine if the gradient value is greater than the first threshold. If yes, proceed to step 720; otherwise, proceed to step 530.
[0329] Step 720: If the gradient value is greater than the first threshold, perform median filtering on the pixel corresponding to the gradient value.
[0330] Step 730: Determine if the gradient value is greater than the second threshold. If yes, proceed to step 720; otherwise, proceed to step 530.
[0331] Step 740: If the filtered gradient value is greater than the second threshold, perform mean filtering on the pixels corresponding to the gradient value. After performing mean filtering, proceed to step 530.
[0332] Optional, such as Figure 9 As shown, the image quality enhancement method provided in this application embodiment further includes:
[0333] Step 240: Encode the filtered image to be processed based on the image quality detection results to obtain the encoded bitstream.
[0334] Step 250: Output the encoded bitstream.
[0335] Optionally, after outputting the encoded bitstream, step 251 is also included, which outputs the image to be processed based on the encoded bitstream.
[0336] Because high-frequency components are filtered out during the filtering process, the bytes occupied by high-frequency components can be allocated to low-frequency components during encoding. This concentrates the bitrate in the low-frequency components that are sensitive to the human eye, thereby improving the image quality of the filtered image. After encoding, the encoded bitstream of the image to be processed is obtained. Since the bitrate is not increased during encoding, the image frame output from the encoded bitstream meets the transmission requirements of the preset bitrate. The frame rate is not sacrificed for image quality improvement, ensuring smooth playback during transmission and interaction.
[0337] Optional, such as Figure 9 As shown, the image quality enhancement method provided in this application embodiment may further include:
[0338] Step 260: Update the image parameter values to obtain the updated image parameter values.
[0339] Step 270: Obtain a new image to be processed.
[0340] Step 280: Perform image quality detection on the new image to be processed based on the updated image parameter values to obtain the image quality detection result corresponding to the new image to be processed.
[0341] In this step, 280 is equivalent to replacing the image to be processed in step 220 with a new image to be processed, and replacing the image parameter values in step 220 with updated image parameter values. That is, executing step 280 after executing step 270 is equivalent to executing step 220 based on the new image to be processed and the updated image parameter values after executing step 270.
[0342] Optional, such as Figure 16 As shown, step 260 can be implemented through steps 910 to 930, specifically as follows:
[0343] Step 910: Obtain the encoding distortion value of the image to be processed.
[0344] Step 920: Update the variables in the distortion array and the values of the distortion variables based on the encoded distortion values.
[0345] Step 930: Increase the code count value according to the preset first step length.
[0346] Optionally, as an example, let the encoding count be i, the capacity be n, the distortion variable be S0, the encoding distortion value be Sc, and the distortion array be U, U={S1, ...,Sj}, where S1, ...,Sj are variables in the distortion array U, and j>1. The encoding distortion value Sc can be obtained by detecting the SATD value of the encoded image after step 240; or it can be obtained together with the encoded bitstream in step 240.
[0347] Optionally, when the encoding count value is i, the encoding distortion value Sc is set to ci. The value of the i%n-th variable in the distortion array U can be updated to ci, and the value of the distortion variable S0 can also be updated to ci. After the update is completed, the encoding count value i is increased by the preset first step length. Here, % represents the modulo operation.
[0348] For example, let n=3, i=0, the preset first step length be 1, and the distortion array U={S1, S2, S3}, where S1, S2, and S3 are the 0th, 1st, and 2nd variables in the distortion array U, respectively. The encoded distortion value of the 0th frame is Sc=c0, 0%3=0, so let S1=c0 and S0=c0, then increment the encoding count by 1. When i=1, the encoded distortion value of the 1st frame is Sc=c1, 1%3=1, so let S2=c1 and S0=c1, then increment the encoding count by 1. When i=2, the encoded distortion value of the 2nd frame is Sc=c2, 2%3=2, so let S3=c2 and S0=c2, at which point the distortion array U={c0, c1, c2}, then increment the encoding count by 1. When i=3, the encoded distortion value Sc of the 3rd frame image is c3, and 3%3=0. Therefore, let S1=c3 and let S0=c3. At this time, the distortion array U={c3, c1, c2}, and then let the encoding count value increase by 1. Thus, before each acquisition of the i-th frame image to be processed, the value of the distortion variable S0 is updated to the encoded distortion value Sc corresponding to the (i-1)-th frame image to be processed. The variables contained in the distortion array U include the encoded distortion values Sc corresponding to the in-th to (i-1)-th frames image to be processed. This allows step 220 or step 280 to perform image quality detection on the i-th frame image to be processed based on the encoded distortion values Sc corresponding to the in-th to (i-1)-th frames image to be processed, that is, to perform image quality detection on the current frame image to be processed based on the SATD values of multiple historical frames image to be processed adjacent to the current frame image to be processed. Combining steps 330 and 340, the first detection result is output based on the maximum SATD value of multiple historical images to be processed that are adjacent to the current frame to be processed. The reference value of the first detection result (the product of the preset weight and the maximum variable value) is dynamically changing so as to detect low-quality images in multiple frames to be processed with uneven image quality distribution.
[0349] To better illustrate the image quality enhancement method provided in the embodiments of this application, please refer to... Figure 9 , Figure 10 , Figure 16 and Figure 17 In one embodiment, the image quality enhancement method can be summarized into the following steps:
[0350] Step 210: Obtain image parameter values, including encoding count values, distortion variable values, and the capacity of the distortion array.
[0351] Step 220: Perform image quality detection on the image to be processed based on the image parameter values to obtain the image quality detection result corresponding to the image to be processed.
[0352] Step 230: Filter the image to be processed based on the image quality detection results.
[0353] Step 240: Encode the filtered image to be processed based on the image quality detection results to obtain the encoded bitstream.
[0354] Step 250: Output the encoded bitstream.
[0355] Step 910: Obtain the encoding distortion value of the image to be processed.
[0356] Step 920: Update the variables in the distortion array and the values of the distortion variables based on the encoded distortion values.
[0357] Step 930: Increase the code count value according to the preset first step length.
[0358] Step 270: Obtain a new image to be processed.
[0359] Step 280: Perform image quality detection on the new image to be processed based on the updated image parameter values to obtain the image quality detection result corresponding to the new image to be processed.
[0360] All of the above technical solutions can be combined in any way to form optional embodiments of this application, and will not be described in detail here.
[0361] To facilitate better implementation of the image quality enhancement method of this application embodiment, this application embodiment also provides an image quality enhancement device. Please refer to... Figure 18 , Figure 18 This is a schematic diagram of the image quality enhancement device provided in an embodiment of this application. The image quality enhancement device 1100 may include:
[0362] The first acquisition unit 1101 is used to acquire image parameter values, which include encoding count values, distortion variable values, and the capacity of the distortion array.
[0363] The image quality detection unit 1102 is used to perform image quality detection on the image to be processed based on image parameter values to obtain image quality detection results.
[0364] Optionally, the image quality detection unit 1102 can be used to: determine whether the encoding count value is greater than or equal to the capacity; if the encoding count value is greater than or equal to the capacity, select the maximum variable value from the variables in the distortion array; determine whether the distortion variable value is greater than the product of a preset weight and the maximum variable value; if the distortion variable value is greater than the product of a preset weight and the maximum variable value, output a first detection result; if the encoding count value is less than the capacity, output a second detection result; if the distortion variable value is less than or equal to the product of a preset weight and the maximum variable value, output a second detection result.
[0365] The first filtering unit 1103 is used to filter the image to be processed based on the image quality detection results.
[0366] Optionally, the first filtering unit 1103 can be used to: obtain the gradient values of multiple pixels in the image to be processed; filter the pixels corresponding to the gradient values when the gradient values are greater than a preset gradient threshold; and increase the second variable value by a preset third step size to obtain the increased second variable value when the gradient values are less than or equal to the preset gradient threshold, or after filtering.
[0367] The encoding unit 1104 is used to encode the filtered image to be processed according to the image quality detection result to obtain the encoded bitstream.
[0368] The first output unit 1105 is used to output the image to be processed according to the encoded bitstream.
[0369] Optionally, the image enhancement device 1100 may also include:
[0370] The update unit 1106 is used to update the image parameter values to obtain the updated image parameter values.
[0371] Optionally, the update unit 1106 can be used to: obtain the encoding distortion value of the image to be processed; update the variables of the distortion array and the distortion variable value according to the encoding distortion value; and increase the encoding count value by a preset first step length.
[0372] Optionally, the first acquisition unit 1101 can also be used to: acquire a new image to be processed.
[0373] Optionally, the image quality detection unit 1102 can also be used to: perform image quality detection on the new image to be processed based on the updated image parameter values, so as to obtain the image quality detection result corresponding to the new image to be processed.
[0374] Each unit in the aforementioned image quality enhancement device can be implemented entirely or partially through software, hardware, or a combination thereof. These units can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each unit.
[0375] The image quality enhancement device 1100 can be integrated into a terminal or server that has storage and a processor and thus computing power, or the image quality enhancement device 1100 can be the terminal or server.
[0376] Optionally, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0377] Figure 19 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device may be... Figure 8 The terminal or server shown. For example... Figure 19 As shown, the computer device 1200 may include a processor 1201, a memory 1202, a touch display screen 1203, and a communication bus. The processor 1201, memory 1202, and touch display screen 1203 communicate with each other via the communication bus. The touch display screen 1203 is used for data communication between the device 700 and external devices. The memory 1202 can be used to store software programs and modules, and the processor 1201 executes the software programs and modules stored in the memory 1202, such as the software programs for corresponding operations in the aforementioned method embodiments.
[0378] Optionally, the processor 1201 may call software programs and modules stored in the memory 1202 to perform the following operations: obtain image parameter values, including encoding count values, distortion variable values, and the capacity of the distortion array; perform image quality detection on the image to be processed according to the image parameter values to obtain the image quality detection result corresponding to the image to be processed; filter the image to be processed according to the image quality detection result; encode the filtered image to obtain an encoded bitstream according to the image quality detection result; and output the image to be processed according to the encoded bitstream.
[0379] like Figure 19 As shown, Figure 19 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device may be... Figure 8The terminal shown is a computer device 1200. This computer device 1200 includes a processor 1201 with one or more processing cores, a memory 1202 with one or more computer-readable storage media, and a computer program stored on the memory 1202 and executable on the processor. The processor 1201 is electrically connected to the memory 1202. Those skilled in the art will understand that the computer device structure shown in the figures does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0380] The processor 1201 is the control center of the computer device 1200. It connects various parts of the computer device 1200 through various interfaces and lines. It executes various functions of the computer device 1200 and processes data by running or loading software programs and / or modules stored in the memory 1202 and calling data stored in the memory 1202.
[0381] In this embodiment, the processor 1201 in the computer device 1200 loads the instructions corresponding to the processes of one or more applications into the memory 1202 according to the following steps, and the processor 1201 runs the applications stored in the memory 1202 to realize various functions:
[0382] A user interface is displayed on the touch screen, the user interface including multiple interface elements; in response to a first touch operation on the user interface, a target interface element currently touched on the user interface and the category to which the target interface element belongs are determined; based on the category to which the target interface element belongs and a preset correspondence between interface elements and vibration signals, a target vibration signal corresponding to the target interface element is determined; the target device is controlled to vibrate according to the target vibration signal, and a target vibration effect is output, wherein the target vibration effect is used to indicate the category to which the target interface element belongs and / or the function of the target interface element.
[0383] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0384] Optional, such as Figure 19 As shown, the computer device 1200 also includes: a touch screen display 1203, a radio frequency circuit 1204, an audio circuit 1205, an input unit 1206, and a power supply 1207. The processor 1201 is electrically connected to the touch screen display 1203, the radio frequency circuit 1204, the audio circuit 1205, the input unit 1206, and the power supply 1207. Those skilled in the art will understand that... Figure 19The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0385] The touch display screen 1203 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The touch display screen 1203 may include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the computer device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Optionally, the display panel can be configured using a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar technologies. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program according to the operation commands. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch location and the signal generated by the touch operation, transmitting the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 1201. It can also receive and execute commands from the processor 1201. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 1201 to determine the type of touch event. Subsequently, the processor 1201 provides corresponding visual output on the display panel based on the type of touch event. In this embodiment, the touch panel and the display panel can be integrated into the touch display screen 1203 to achieve input and output functions. However, in some embodiments, the touch panel and the touch display screen 1203 can be implemented as two independent components to achieve input and output functions. That is, the touch display screen 1203 can also be used as part of the input unit 1206 to achieve input functions.
[0386] The radio frequency circuit 1204 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other computer devices, and to transmit and receive signals with network devices or other computer devices.
[0387] Audio circuit 1205 can be used to provide an audio interface between a user and a computer device via a speaker and a microphone. Audio circuit 1205 can convert received audio data into electrical signals and transmit them to the speaker, where the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuit 1205, converted back into audio data, and then processed by processor 1201 before being transmitted via radio frequency circuit 1204 to, for example, another computer device, or output to memory 1202 for further processing. Audio circuit 1205 may also include an earphone jack to provide communication between peripheral headphones and the computer device.
[0388] The input unit 1206 can be used to receive input digital, character, or biometric information (such as fingerprints, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
[0389] Power supply 1207 is used to supply power to various components of computer device 1200. Optionally, power supply 1207 can be logically connected to processor 1201 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 1207 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0390] although Figure 19 As not shown in the diagram, the computer device 1200 may also include a camera, sensor, wireless fidelity module, Bluetooth module, etc., which will not be described in detail here.
[0391] This application also provides a computer-readable storage medium for storing a computer program. This computer-readable storage medium can be applied to a computer device, and the computer program causes the computer device to execute the corresponding processes in the image quality enhancement method described in the embodiments of this application; for the sake of brevity, these will not be elaborated further here.
[0392] This application also provides a computer program that includes computer instructions stored in a computer-readable storage medium. The processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the corresponding process in the image quality enhancement method described in the embodiments of this application. For the sake of brevity, further details are omitted here.
[0393] It should be understood that the processor in the embodiments of this application may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0394] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can 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. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0395] It should be understood that the above-described memory is exemplary and not a limiting description. For example, the memory in the embodiments of this application may also be static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DR RAM), etc. That is to say, the memory in the embodiments of this application is intended to include, but is not limited to, these and any other suitable types of memory.
[0396] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0397] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0398] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0399] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0400] In addition, the functional units in the embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0401] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer or a server) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0402] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for improving image quality, characterized in that, include: Obtain image parameter values; The image quality of the image to be processed is detected based on the image parameter values to obtain the image quality detection result corresponding to the image to be processed. The image to be processed is filtered based on the image quality detection results; The filtered image to be processed is encoded according to the image quality detection results to obtain an encoded bitstream; and Output the encoded bitstream; The image parameter values include the encoding count value, the distortion variable value, and the capacity of the distortion array; the image quality detection result includes the first detection result. The step of performing image quality detection on the image to be processed based on the image parameter values to obtain the image quality detection result corresponding to the image to be processed includes: Determine whether the encoded count value is greater than or equal to the capacity; If the encoded count value is greater than or equal to the capacity, the largest variable value is selected from the variables in the distortion array; Determine whether the value of the distorted variable is greater than the product of the preset weight and the maximum variable value; and If the value of the distorted variable is greater than the product of the preset weight and the maximum variable value, the first detection result is output.
2. The image quality enhancement method as described in claim 1, characterized in that, The image quality detection result further includes a second detection result. The step of performing image quality detection on the image to be processed based on the image parameter values to obtain the image quality detection result further includes: If the encoded count value is less than the capacity, output the second detection result; and The second detection result is output when the value of the distorted variable is less than or equal to the product of the preset weight and the maximum variable value.
3. The image quality enhancement method as described in claim 1, characterized in that, The step of filtering the image to be processed based on the image quality detection result includes: Obtain the gradient values of multiple pixels in the image to be processed; and If the gradient value is greater than a preset gradient threshold, the pixel corresponding to the gradient value is filtered.
4. The image quality enhancement method as described in claim 1, characterized in that, The step of obtaining the gradient values of multiple pixels in the image to be processed includes: Obtain the width value, height value, first variable value, and second variable value of the image to be processed, wherein the first variable value represents the height of the plurality of pixels, and the second variable value represents the width of the plurality of pixels; If the value of the first variable is less than the difference between the height value and the preset value, and the value of the second variable is less than the difference between the width value and the preset value, the gradient value of the pixel corresponding to the first variable and the second variable is obtained.
5. The image quality enhancement method as described in claim 4, characterized in that, The step of filtering the image to be processed based on the image quality detection result further includes: The filtering process ends when the value of the first variable is greater than or equal to the difference between the height value and the preset value.
6. The image quality enhancement method as described in claim 4, characterized in that, The step of obtaining the gradient values of multiple pixels in the image to be processed further includes: If the second variable value is greater than or equal to the difference between the width value and the preset value, the first variable value is increased by a preset second step to obtain the increased first variable value, and the second variable value is reset to obtain the reset second variable value; and If the increased first variable value is less than the difference between the height value and the preset value, and the reset second variable value is less than the difference between the width value and the preset value, then the gradient value of the pixel corresponding to the increased first variable value and the reset second variable value is obtained.
7. The image quality enhancement method as described in claim 4, characterized in that, The step of filtering the image to be processed based on the image quality detection result further includes: If the gradient value is less than or equal to a preset gradient threshold, or after the filtering is performed, the second variable value is increased by a preset third step to obtain the increased second variable value. The step of obtaining the gradient values of multiple pixels in the image to be processed further includes: If the value of the first variable is less than the difference between the height value and the preset value, and the value of the increased second variable is less than the difference between the width value and the preset value, the gradient value of the pixel corresponding to the first variable and the increased second variable value is obtained.
8. The image quality enhancement method as described in claim 3, characterized in that, The gradient threshold includes a first threshold and a second threshold. The step of filtering the pixel corresponding to the gradient value when the gradient value is greater than the preset gradient threshold includes: Determine whether the gradient value is greater than the first threshold; If the gradient value is greater than the first threshold, median filtering is performed on the pixel corresponding to the gradient value. Determine whether the filtered gradient value is greater than the second threshold; and If the gradient value is greater than the second threshold, mean filtering is performed on the pixel corresponding to the gradient value.
9. The image quality enhancement method according to any one of claims 1 to 8, characterized in that, The image quality enhancement method also includes: Update the image parameter values to obtain the updated image parameter values; Acquire new images to be processed; and The image quality of the new image to be processed is detected based on the updated image parameter values to obtain the image quality detection result corresponding to the new image to be processed.
10. The image quality enhancement method as described in claim 9, characterized in that, The updating of the image parameter values includes: Obtain the encoded distortion value of the image to be processed; Update the variables in the distortion array and the distortion variable values according to the encoded distortion values; and Increase the code count value according to the preset first step length.
11. An image quality enhancement device, characterized in that, The image quality enhancement device includes: The first acquisition unit is used to acquire image parameter values; The image quality detection unit is used to perform image quality detection on the image to be processed based on the image parameter values to obtain the image quality detection result. The first filtering unit is used to filter the image to be processed based on the image quality detection result; An encoding unit is configured to encode the filtered image to be processed based on the image quality detection result to obtain an encoded bitstream; and The first output unit is used to output the image to be processed according to the encoded bitstream; The image parameter values include the encoding count value, the distortion variable value, and the capacity of the distortion array; the image quality detection result includes the first detection result. The step of performing image quality detection on the image to be processed based on the image parameter values to obtain the image quality detection result corresponding to the image to be processed includes: Determine whether the encoded count value is greater than or equal to the capacity; If the encoded count value is greater than or equal to the capacity, the largest variable value is selected from the variables in the distortion array; Determine whether the value of the distorted variable is greater than the product of the preset weight and the maximum variable value; and If the value of the distorted variable is greater than the product of the preset weight and the maximum variable value, the first detection result is output.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted for loading by a processor to perform the steps of the image quality enhancement method as described in any one of claims 1-10.
13. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a computer program, and the processor executing the steps of the image quality enhancement method as described in any one of claims 1-10 by calling the computer program stored in the memory.
Citation Information
Patent Citations
Image encoding device and method
JP2009224854A
Moving image encoding apparatus, control method therefor, and computer program
JP2013115580A