[go: up one dir, main page]

CN108846815A - Image antialiasing processing method, device and computer equipment - Google Patents

Image antialiasing processing method, device and computer equipment Download PDF

Info

Publication number
CN108846815A
CN108846815A CN201810629276.4A CN201810629276A CN108846815A CN 108846815 A CN108846815 A CN 108846815A CN 201810629276 A CN201810629276 A CN 201810629276A CN 108846815 A CN108846815 A CN 108846815A
Authority
CN
China
Prior art keywords
antialiasing
image
render instruction
mode
size
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810629276.4A
Other languages
Chinese (zh)
Other versions
CN108846815B (en
Inventor
杨启凡
黄源超
龙海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201810629276.4A priority Critical patent/CN108846815B/en
Publication of CN108846815A publication Critical patent/CN108846815A/en
Application granted granted Critical
Publication of CN108846815B publication Critical patent/CN108846815B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Image Generation (AREA)

Abstract

This application involves a kind of image antialiasing processing method, device and computer equipment, the method includes:Receive the render instruction that application program is triggered;Determine the corresponding image sawtooth degree of the render instruction;The corresponding antialiasing mode of the render instruction is determined based on described image sawtooth degree;The render instruction is modified according to the antialiasing mode, obtains acting on behalf of render instruction;It exports and described acts on behalf of render instruction;It is described act on behalf of render instruction and be used to indicate video driver antialiasing processing is carried out when rendering image.The problem of scheme provided by the present application can not make image reach ideal anti-aliasing effect to avoid the antialiasing mode artificially selected, to improve the quality of image.

Description

Image antialiasing processing method, device and computer equipment
Technical field
This application involves technical field of image processing, more particularly to a kind of image antialiasing processing method, device and meter Calculate machine equipment.
Background technique
With the continuous development of computer technology and image processing techniques, user can easily be seen using electronic equipment Various image informations are appreciated, and the image of high quality can often bring good visual experience to user.For example, user can make With mobile phone or computer viewing video or game is played, if the quality of figure picture is high in video or game, can be brought for user good Good visual experience, and user can be improved to the viscosity of product.It, will if sawtooth object occurs in the figure picture in video or game It will affect the visual experience of user.
In order to eliminate the sawtooth object in image, common way is:It include antialiasing in the offer of third party's optimization software In the operation pages of mode, antialiasing processing is carried out to image by user's manual setting corresponding antialiasing mode.However, according to The antialiasing mode artificially selected handles the sawtooth of image, possibly image can not be made to reach ideal anti-aliasing effect, to make The quality of image is relatively low.
Summary of the invention
Based on this, it is necessary to be imitated for because the antialiasing mode artificially selected can not make image reach ideal antialiasing Fruit makes the low-quality technical problem of image, provides a kind of image antialiasing processing method, device and computer equipment.
A kind of image antialiasing processing method, including:
Receive the render instruction that application program is triggered;
Determine the corresponding image sawtooth degree of the render instruction;
The corresponding antialiasing mode of the render instruction is determined based on described image sawtooth degree;
The render instruction is modified according to the antialiasing mode, obtains acting on behalf of render instruction;
It exports and described acts on behalf of render instruction;The render instruction of acting on behalf of is used to indicate video driver in rendering image when progress Antialiasing processing.
A kind of image antialiasing processing unit, including:
Receiving module, the render instruction triggered for receiving application program;
Sawtooth degree determining module, for determining the corresponding image sawtooth degree of the render instruction;
Antialiasing mode determining module, for determining the corresponding anti-saw of the render instruction based on described image sawtooth degree Tooth mode;
Instruction modification module obtains acting on behalf of render instruction for modifying the render instruction according to the antialiasing mode;
Output module described acts on behalf of render instruction for exporting;It is described act on behalf of render instruction and be used to indicate video driver exist Antialiasing processing is carried out when rendering image.
A kind of storage medium is stored with computer program, when the computer program is executed by processor, so that the place Manage the step of device executes described image antialiasing processing method.
A kind of computer equipment, including memory and processor, the memory are stored with computer program, the calculating When machine program is executed by the processor, so that the step of processor executes described image antialiasing processing method.
Above-mentioned image antialiasing processing method, device, storage medium and computer equipment receive what application program was triggered Render instruction determines the sawtooth degree of image by render instruction, so can determine whether modification render instruction, so as to figure As carrying out antialiasing processing.The antialiasing mode to be taken is chosen according to sawtooth degree, according to the antialiasing mode pair of selection Render instruction is modified, according to modified render instruction can root render image, and according to antialiasing in render process Mode carries out antialiasing processing, to realize the automatic antialiasing processing to image, improves anti-aliasing effect, and then improve The quality of image.
Detailed description of the invention
Fig. 1 is the applied environment figure of image antialiasing processing method in one embodiment;
Fig. 2 is the flow diagram of image antialiasing processing method in one embodiment;
Fig. 3 is that process the step of determining image sawtooth degree according to picture size and displaying size in one embodiment is shown It is intended to;
Fig. 4 is that the candidate antialiasing mode of formulation is corresponding with selection in the process of running during loading in one embodiment The flow diagram of the step of antialiasing mode;
Fig. 5 is stream the step of deleting alignment rendering antialiasing mode according to fluency and configuration parameter in one embodiment Journey schematic diagram;
Fig. 6 is to determine antialiasing mode and anti-saw according to computing capability value more than needed and image sawtooth degree in one embodiment Tooth parameter, and the flow diagram for the step of correspondingly modifying render instruction;
Fig. 7 is that process the step of carrying out antialiasing processing to the edge of object in image in one embodiment is illustrated Figure;
Fig. 8 be in one embodiment adjustment using points and according to it is adjusted using points to the edge of object into The flow diagram for the step of row uses;
Fig. 9 is the flow diagram that antialiasing mode to be taken is determined in one embodiment;
Figure 10 is the flow diagram that antialiasing strategy is formulated in one embodiment;
Figure 11 is to be generated in antialiasing strategy and operational process during loading in one embodiment according to antialiasing plan Slightly modify the flow diagram of render instruction;
Figure 12 is the flow diagram for modifying render instruction in one embodiment in the process of running;
Figure 13 is that comparison handles without antialiasing, handles and pass through FXAA by being aligned rendering mode in one embodiment The schematic diagram of the image of processing;
Figure 14 is the structural block diagram of image antialiasing processing unit in one embodiment;
Figure 15 is the structural block diagram of image antialiasing processing unit in another embodiment;
Figure 16 is the structural block diagram of computer equipment in one embodiment.
Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the objects, technical solutions and advantages of the application are more clearly understood The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, and It is not used in restriction the application.
Fig. 1 is the applied environment figure of image antialiasing processing method in one embodiment.Referring to Fig.1, the image antialiasing Processing method is applied to image antialiasing processing system.The image antialiasing processing system includes terminal 110 and server 120. Terminal 110 and server 120 pass through network connection.Terminal 110 specifically can be terminal console or mobile terminal, mobile terminal tool Body can be at least one of mobile phone, tablet computer, laptop etc..Server 120 can with independent server or It is the server cluster of multiple server compositions to realize.
Wherein, terminal 110 includes operating system, simulator and corresponding application program etc..Simulator runs on terminal In operating system.Application program is run in simulator, and simulator can simulate corresponding third party's operating system, for using journey Sequence provides running environment.Simulator includes system component and image rendering agency.Application program includes image rendering module and control Molding block.It should be noted that application program need to be run in third party's operating system.
The developer of application program researches and develops and maintenance applications, and passes through the distribution channel of application market (as application is precious) Push simulator to user (such as Tencent's hand swims assistant).User downloads simulator in application market, and in the operation system of terminal It is installed on system.Simulator simulates third party's operating system, to provide running environment for application program.
Application program includes at least control module and graph rendering module.Image rendering module is used for system component (such as Android system component) render instruction is issued, to carry out subsequent processing to render instruction.Control module is used for according to input Operation application program is controlled accordingly.
Simulator includes system component and image rendering Agent components.Wherein, system component is receiving application program When render instruction, render instruction is encoded.In addition, system component the corresponding parameter list of render instruction can also be encoded into Row coding.Data after coding are transmitted to the image rendering Agent components of simulator by system component.
When image rendering Agent components receive render instruction, render instruction is first decoded, then analyzes render instruction and right The parameter list answered judges the image sawtooth degree of image in application program.Image rendering Agent components combine different types of Antialiasing mode modifies render instruction.On the one hand the render instruction of modification carries out antialiasing processing to image, on the other hand can be certainly Protect to reaction type the fluency of application program.
Modified render instruction is transmitted to video driver and executed by image rendering Agent components, by video driver according to wash with watercolours It has a finger in every pie order and rendering and antialiasing processing is carried out to image.The image by antialiasing processing is obtained, and image is in by treated Now give user.
As shown in Fig. 2, in one embodiment, providing a kind of image antialiasing processing method.The present embodiment mainly with This method is applied to the terminal 110 in above-mentioned Fig. 1 to illustrate.Referring to Fig. 2, which is specifically included Following steps:
S202 receives the render instruction that application program is triggered.
Wherein, image antialiasing processing method can be applied to simulator, and application program runs on simulator, simulator operation In operating system, video driver runs on operating system.Specifically, simulator can be mounted to it is in terminal, for simulating The application software of third party's operating system, the Android simulator including simulating Android operation system, as Tencent's hand swims assistant.Simulation Device simulates third party's operating system, can be the application providing system running environment.Operating system, which refers to, operates in end Native operating system on end.Video driver can refer to the program of driving video card, be carried out by driving video card corresponding Rendering operations and antialiasing operation etc..If operation can be by terminal performed by terminal in subsequent embodiment without specified otherwise Simulator executes.
It should be noted that if the running environment of application program is third party's operating system, then terminal original cannot be run on The operating system of beginning.For example, it is assumed that the native operating system of terminal is Windows operating system, application program A is applied to Android Operating system, then, application program A is unable to run in the terminal of Windows operating system, to run application at the terminal Program A then need to install Android simulator in terminal and simulate Android system, by simulate come Android system provide using journey The running environment of sequence A.
In one embodiment, when a triggered event is detected, terminal receives the render instruction that application program is triggered.Touching Hair event can be:Start application program in simulator, or runs application program in simulator.Specifically, when using journey When sequence starts or runs in simulator, application program generates the render instruction of rendering picture, and application program is sent to mould Quasi- device.Simulator receives the render instruction that application program generates.
In one embodiment, terminal receives the rendering that application program is triggered by the system component in simulator and refers to It enables, and after encoding to received render instruction, the render instruction after coding is passed to the image rendering generation in simulator Manage component.Terminal obtains render instruction by the image rendering Agent components in simulator, solves to the render instruction of acquisition Code.It should be noted that due in operational process system component and image rendering Agent components there is different threads, to rendering Instruction transmits render instruction after being encoded among the different threads.
S204 determines the corresponding image sawtooth degree of render instruction.
Wherein, image sawtooth refers to that rough corner angle occurs in the contour edge of the image after rendering.The shape of image sawtooth The resolution ratio for being mainly image at reason is low, will when the low image of resolution ratio is shown in high-resolution or large-sized terminal The problem of will appear image sawtooth.Visually, image sawtooth degree can refer to rendering after image contour edge corner angle it is big Small, when the corner angle of the picture contour edge of image are larger, expression image sawtooth degree is larger.When the picture contour edge of image Corner angle are smaller, indicate that image sawtooth degree is smaller.
In one embodiment, terminal determines rendering by the picture size of image to be rendered and the displaying size of terminal Instruct image sawtooth degree corresponding, for image to be rendered.
In one embodiment, it when picture size, which is less than, shows size, indicates the image exhibition to be rendered of low resolution It is shown in high-resolution terminal, in fact it could happen that largely sawtooth.When picture size, which is equal to, shows size, indicate to differentiate Rate and the consistent image to be rendered of the resolution ratio of terminal display screen are showed in terminal, in fact it could happen that lesser degree of sawtooth.Work as figure As when size, which is greater than, shows size, indicating that the image to be rendered by the resolution ratio that resolution ratio is greater than terminal display screen is showed in end End sawtooth may not occurs or the sawtooth of small degree occurs.It is referred to it should be noted that image to be rendered is showed in terminal Image to be rendered is showed in terminal after rendering and antialiasing is handled.
For example, being shown when picture size is less than and shows size since the lower image of resolution ratio is amplified to high-resolution When display screen, serious rough corner angle will occur in image amplification sampling back edge profile, that is, serious image sawtooth occur.When When picture size is equal to displaying size, then there may be the image sawtooth of O-level.When picture size, which is greater than, shows size, Illustrate that application program may use antialiasing mode and carry out image antialiasing operation, to keep image sawtooth degree smaller, adopts Antialiasing mode can be SSAA (Super Sampling Anti-Aliasing, super sampling anti-aliasing) mode.
For the application program for operating in simulator, application program itself is possible to be provided with corresponding antialiasing side Formula, it is also possible to not set corresponding antialiasing mode.When application program is provided with corresponding antialiasing mode, application is indicated The render instruction of program triggering uses antialiasing mode.When the not set corresponding antialiasing mode of application program, indicate to answer Antialiasing mode is not used with the render instruction that program triggers, then executes S206.
S206 determines the corresponding antialiasing mode of render instruction based on image sawtooth degree.
Wherein, antialiasing mode includes but is not limited to:Alignment buffering antialiasing mode, MSAA (Multi Sampling Anti-Aliasing, multiple sampling antialiasing) and FXAA (Fast Approximate Anti-Aliasing, it is quickly approximate anti- Sawtooth).
Alignment buffering antialiasing mode refers to:In render process, when the size of image to be rendered is less than the displaying of terminal When size, terminal renders the image to be rendered of low resolution using size is shown, thus after being rendered image to be rendered Size is consistent with the displaying size of terminal.For example, if the size of image to be rendered is 1280 × 720, the displaying of terminal having a size of 1920 × 1080, terminal then modifies the size of frame buffer (Frame Buffer), and the size by modifying frame buffer realizes image The modification of size, is such as revised as 1920 × 1080 for 1280 × 720, makes the picture size of image to be rendered and the displaying ruler of terminal Very little alignment.Terminal renders image to be rendered using modified size, so that sawtooth effect is obviously cut down.
In one embodiment, when picture size, which is less than, shows size, expression carries out rendering time frame to image to be rendered The size of caching is not enough to support the displaying size of terminal, to more serious image sawtooth occur.At this point, determining pair of terminal Neat buffering antialiasing mode, to carry out alignment rendering to image to be rendered, and then achievees the effect that antialiasing.Wherein, alignment is slow It rushes antialiasing mode and is properly termed as alignment rendering mode.
To image to be rendered carry out render process in, OpenGL when obtaining image segments (fragment), due to Fragment is not last pixel data.Therefore, terminal such as mixes (blend), structuring to fragment by handling (texture), the processing operations such as glazing (lighting), obtain required pixel data.Wherein, for caching fragment number According to buffer area be frame buffer (frame buffer), the size of frame buffer can influence picture size.
S208 modifies render instruction according to antialiasing mode, obtains acting on behalf of render instruction.
In one embodiment, render instruction can carry antialiasing strategy, and before S208, terminal is according to antialiasing Strategy determines whether the render instruction of application triggers uses corresponding antialiasing mode.When terminal determines that render instruction is not adopted When with antialiasing mode, render instruction is modified according to determining antialiasing mode, obtains acting on behalf of render instruction.
In one embodiment, S208 can specifically include:Antialiasing strategy modification in render instruction is to adopt by terminal It is made an addition in render instruction with antialiasing mode, and by the parameter of corresponding antialiasing mode, render instruction is acted on behalf of in acquisition.For example, If it is not that the picture size of image to be rendered, which is less than the antialiasing strategy shown in size and the render instruction of application triggers, When using antialiasing mode, the antialiasing strategy modification in render instruction is using antialiasing by terminal modifications render instruction Mode, such as using alignment rendering antialiasing mode or MSAA or FXAA.Terminal adds corresponding parameter according to antialiasing mode It is added in render instruction.
In one embodiment, S208 can specifically include:The render instruction of application triggers is replaced with and is adopted by terminal With the render instruction of antialiasing mode, render instruction is acted on behalf of in acquisition.Alternatively, referred to as whether being used when using the name of render instruction When antialiasing mode, terminal modifies the title of the render instruction of application triggers, by the name modifications of render instruction To need to carry out the title of antialiasing mode, render instruction is acted on behalf of in acquisition.
In one embodiment, fluency when terminal detection operation application program, obtains configuration parameter, the configuration information For indicating the priority between picture quality and fluency.It is smooth when being determined according to the relationship between fluency and configuration parameter When spending preferential, terminal determines corresponding antialiasing mode according to fluency priority principle, modifies render instruction according to antialiasing mode, It obtains acting on behalf of render instruction.Comprehensively consider the relationship between sawtooth degree, image quality and the fluency of image, it is ensured that image Image quality and application program fluency.
S210, output agent render instruction;It acts on behalf of render instruction and is used to indicate video driver and resisted when rendering image Sawtooth processing.
Wherein, the image of rendering is properly termed as image to be rendered.Since picture size is less than the displaying size of terminal, so that There is serious crenellated phenomena during displaying in image, needs to carry out in render process using corresponding antialiasing mode at this time Antialiasing processing.The image of rendering can be each frame image of video in application program, the image being also possible in application program. Application program can be game application, Video Applications and social application etc..
Specifically, terminal is by simulator output agent render instruction, the video card that will be acted on behalf of render instruction and be transferred to terminal Driving.Terminal is controlled video card by video driver and carries out rendering and antialiasing processing to image.
In above-described embodiment, the render instruction that application program is triggered is received, the sawtooth of image is determined by render instruction Degree so can determine whether modification render instruction, to carry out antialiasing processing to image.Institute is chosen according to sawtooth degree The antialiasing mode to be taken modifies to render instruction according to the antialiasing mode of selection, is referred to according to modified rendering Enable can root render image, and antialiasing processing is carried out according to antialiasing mode in render process, to realize to image Automatic antialiasing processing, improve anti-aliasing effect, and then improve the quality of image.
In one embodiment, as shown in figure 3, S204 can specifically include:
S302 determines the picture size of image to be rendered according to render instruction.
Wherein, picture size can be the display size or image resolution ratio of image.The unit of display size can be li Rice.
In one embodiment, for application on site program, during terminal operating application program, application program is received The image to be rendered that background server is sent.According to render instruction corresponding with image to be rendered, the figure of image to be rendered is determined As size.Render instruction can carry the dimensional parameters of image to be rendered.
In one embodiment, it for offline application program, during terminal operating application program, is corresponded to from local obtain Image to be rendered.According to render instruction corresponding with image to be rendered, the picture size of image to be rendered is determined.Render instruction The dimensional parameters of image to be rendered can be carried.
S304, the displaying size of counterpart terminal when obtaining operation application program.
Wherein, show that size can be the display size or terminal resolution ratio of terminal.The unit of display size can be li Rice.Show that size is corresponding with picture size, when use such as picture size centimetre for unit, displaying size is also used centimetre for singly Position.It should be noted that if the displaying size can be the ruler of entire display screen when showing that size uses centimetre for unit It is very little, it is also possible to show the practical size for occupying display screen when image.
In one embodiment, terminal obtains from terminal configuration information table when receiving render instruction and shows size. Configuration information table is used to save the configuration information of terminal, the displaying size including terminal.
S306 determines picture size and shows the relationship between size;The relationship indicates the corresponding image sawtooth of render instruction Degree.
Wherein, the relationship between picture size and displaying size can refer to picture size and show the size between size.When When picture size is less than displaying size, indicate that image sawtooth degree is larger.When picture size, which is greater than or equal to, shows size, table Diagram is smaller as sawtooth degree.
In above-described embodiment, image sawtooth degree is indicated according to the relationship between picture size and displaying size, it can be quick Ground judges whether image has sawtooth, is conducive to the time for shortening the processing of image antialiasing, improves image antialiasing efficiency.
In one embodiment, as shown in figure 4, this method can also include:
S402 is then determined according to image sawtooth degree and is waited when render instruction in application program loading procedure by triggering Select antialiasing mode.
Wherein, loading procedure refers to application program on startup, and the corresponding file of application program is loaded onto terminal The process deposited.Candidate antialiasing mode is stored in antialiasing Policy List, which is stored in terminal.It is receiving When to render instruction, determine the need for being modified using antialiasing mode according to antialiasing mode in conjunction with antialiasing Policy List Render instruction.
In one embodiment, when application program is in loading procedure, terminal receives institute in application program loading procedure The render instruction of triggering according to picture size and shows that size determines the sawtooth degree of image, and according to the formulation pair of sawtooth degree The antialiasing strategy of formulation is stored in antialiasing Policy Table by the antialiasing strategy answered.
Wherein, antialiasing strategy can refer to whether terminal uses antialiasing mode, and using which kind of candidate antialiasing side Formula.Candidate antialiasing mode is to be formulated and be stored in antialiasing Policy List by terminal in application program loading procedure, when When terminal receives the render instruction triggered in application program operational process, correspondence image is chosen from candidate antialiasing mode The antialiasing mode of sawtooth degree, terminal refer to according to rendering received in the antialiasing strategy modification operational process of selection It enables, so that image reaches adenticulate effect, or reduces the effect of sawtooth degree.
For example, terminal resists image using alignment rendering antialiasing mode when picture size is less than and shows size Sawtooth processing.Antialiasing is not used when picture size is greater than or equal to the render instruction for showing that size and application program are triggered When mode, since image still has lesser sawtooth, terminal can determine a kind of antialiasing mode, and modify render instruction.It repairs Render instruction after changing is used to indicate video driver and carries out antialiasing operation to image using the antialiasing mode of MSAA or FXAA.
S206 can specifically include:
S404 is based on image sawtooth degree when render instruction in application program operational process by triggering, anti-from candidate Antialiasing mode corresponding with sawtooth degree is chosen in sawtooth fashion.
In one embodiment, in application program operational process, when picture size, which is less than, shows size, image saw is indicated Tooth degree is larger, and terminal chooses be aligned corresponding with sawtooth degree from candidate antialiasing mode and renders antialiasing mode.Terminal Render instruction is modified according to alignment rendering antialiasing mode, when rendering image according to modified render instruction so as to video driver Antialiasing processing is carried out, so that image reaches adenticulate effect, or reduces the effect of sawtooth degree.
In above-described embodiment, when render instruction in application program loading procedure by triggering, according to image sawtooth degree It determines candidate's antialiasing mode, provides corresponding antialiasing mode in the process of running for application program, it is corresponding to carry out Antialiasing processing.When render instruction in application program operational process by triggering, it is based on image sawtooth degree, from candidate anti-saw Antialiasing mode corresponding with sawtooth degree is chosen in tooth mode, so that the antialiasing mode according to acquisition carries out anti-saw to image Tooth processing improves the efficiency of antialiasing to realize the automatic antialiasing processing of image.
In one embodiment, between image sawtooth degree passes through image to be rendered picture size and corresponding displaying size Relationship indicate;S402 can specifically include:When picture size, which is less than, shows size, wash with watercolours will be aligned with showing that size is matched Dye antialiasing mode is included in candidate antialiasing mode.
In one embodiment, application program during loading, when picture size, which is less than, shows size, formulate by terminal It is aligned rendering antialiasing mode with showing that size is matched, and using the alignment of formulation rendering antialiasing mode as candidate antialiasing Mode.In the process of running so as to application program, when determine the picture size in operational process be less than show size when, terminal from Be aligned corresponding with sawtooth degree is chosen in candidate antialiasing mode renders antialiasing mode.
In above-described embodiment, when picture size, which is less than, shows size, the anti-saw of rendering will be aligned with showing that size is matched Tooth mode is included in candidate antialiasing mode, in order to carry out alignment rendering to image, picture size is made to be rendered into displaying ruler The image of very little size, to reduce the sawtooth degree of image.
In one embodiment, this method further includes:When render instruction does not use antialiasing mode, then by the anti-saw of target Tooth mode is included in candidate antialiasing mode;When determining antialiasing mode includes that alignment rendering antialiasing mode and target are anti- When sawtooth fashion, render instruction is acted on behalf of, video driver is used to indicate using alignment rendering antialiasing mode and carries out antialiasing processing Afterwards, antialiasing processing is further carried out using target antialiasing mode.
In one embodiment, when determining antialiasing mode includes target antialiasing mode and does not include that alignment rendering is anti- When sawtooth fashion, render instruction is acted on behalf of, video driver is used to indicate using target antialiasing mode and carries out antialiasing processing.
In one embodiment, when picture size is less than displaying size and render instruction does not use antialiasing mode, eventually End in addition to formulate be aligned rendering antialiasing mode other than, the antialiasing that also sets objectives mode, and using target antialiasing mode as Candidate antialiasing mode.
In one embodiment, when picture size is less than displaying size and render instruction does not use antialiasing mode, eventually The antialiasing mode that sets objectives is held, and using target antialiasing mode as candidate antialiasing mode.
Wherein, target antialiasing mode includes but is not limited to MSAA and FXAA.
In one embodiment, when terminal operating application program, terminal detects fluency, is according to the determination of process degree It is no to use corresponding antialiasing mode in candidate antialiasing mode.
In one embodiment, it when fluency is less than default fluency, does not modify to render instruction.Work as fluency When greater than default fluency, corresponding antialiasing mode is chosen from candidate antialiasing mode, according to the antialiasing mode of selection Modify render instruction.
In one embodiment, corresponding antialiasing mode is chosen from candidate antialiasing mode can specifically include:From Alignment rendering antialiasing mode is chosen in candidate antialiasing mode, and antialiasing mode is rendered to render instruction according to the alignment of selection It modifies, and executes following steps:
1) when video driver renders image according to alignment rendering antialiasing mode, fluency is continued to test.
2) when fluency, which is greater than default process, spends, terminal chooses target antialiasing mode from candidate antialiasing mode, It is modified according to alignment rendering antialiasing mode and target antialiasing mode to render instruction, so that video driver is according to alignment Rendering antialiasing mode and target antialiasing mode carry out rendering and antialiasing processing to image.
3) when fluency, which is less than default process, spends, terminal chooses target antialiasing side no longer from candidate antialiasing mode Formula only modifies to render instruction according to alignment rendering antialiasing mode, so that video driver renders antialiasing according to alignment Mode renders image, to realize the effect of image antialiasing.Alternatively, terminal does not modify to render instruction, directly It connects and render instruction is transmitted to video driver.
It then include waiting by target antialiasing mode when render instruction does not use antialiasing mode in above-described embodiment It selects in antialiasing mode, to obtain corresponding antialiasing mode.When determining antialiasing mode includes alignment rendering antialiasing When mode and target antialiasing mode, after carrying out antialiasing processing using alignment rendering antialiasing mode, target is further used Antialiasing mode carries out antialiasing processing, to realize the multiple antialiasing processing of image.
In one embodiment, as shown in figure 5, this method further includes:
S502, detection run fluency when application program.
Wherein, fluency can refer to terminal when running application program, the operation fluency of application program.
In one embodiment, the occupancy of the occupancy or graphics processor of terminal detection central processing unit, by accounting for Process degree when operation application program is determined with rate.Alternatively, application program is in the process of running, terminal detects each frame in video Whether image, which delay occurs, plays, and determines fluency according to whether each frame image in video delay broadcasting occurs.
In one embodiment, terminal is using the end position of the rendering frame of image as point of observation, in the statistical unit time Rendering frame number.Terminal determines average frame per second according to the rendering frame number in unit time and unit time, using average frame per second as Measure the fluency that application program is run on simulator.
S504 obtains configuration parameter.
In one embodiment, image antialiasing processing method is applied in simulator, and terminal obtains the configuration of simulator Parameter determines that current mode is that picture quality is preferential or fluency is preferential according to configuration parameter.
Wherein, image quality preferentially refers to paying the utmost attention to the image quality of image.It is preferential according to image quality, then may be used To exchange the image quality of image for as cost using fluency, anti-saw such as is carried out to image using the larger amount of computing capability of terminal Tooth processing.Fluency preferentially refers under the premise of guaranteeing fluency, antialiasing processing is carried out to image, as only using terminal Computing capability more than needed carries out antialiasing processing to image.
S506, when fluency is less than default fluency and configuration parameter indicates that fluency is more preferential than picture quality, from time It selects and deletes alignment rendering antialiasing mode in antialiasing mode.
In one embodiment, in the case where picture size is less than and shows dimensional conditions, when fluency is greater than default fluency, Alignment rendering antialiasing mode and target antialiasing mode are chosen from candidate antialiasing mode.
In one embodiment, in the case where picture size is less than and shows dimensional conditions, when fluency be greater than default fluency and When configuration parameter indicates that fluency is more preferential than picture quality, terminal chooses alignment rendering antialiasing side from candidate antialiasing mode Formula, and predict the fluency when rendering image using alignment rendering antialiasing mode.When the fluency of prediction is greater than default stream When freely spending, terminal chooses target antialiasing mode also from candidate antialiasing mode, to render antialiasing mode according to alignment Render instruction is modified with target antialiasing mode, obtains acting on behalf of render instruction.
In above-described embodiment, detection fluency and acquisition configuration parameter, when fluency is less than default fluency and configuration ginseng When number indicates that fluency is more preferential than picture quality, alignment rendering antialiasing mode is deleted from candidate antialiasing mode, thus When picture size is less than displaying size, the rendering that neat rendering antialiasing mode carries out image will not be chosen, ensures that smoothness The requirement of degree.
In one embodiment, as shown in fig. 6, S206 can specifically include:
S602, the computing capability value more than needed of counterpart terminal when determining application program operation.
Wherein, have more than needed computing capability value can refer to terminal when running each application program, remaining computing capability value.
In one embodiment, the application program of computing capabilitys a large amount of for consumption, when running application program, terminal is logical The utilization rate for crossing central processing unit and/or graphics processor determines the computing capability value more than needed of terminal.
In one embodiment, the application program of memories a large amount of for consumption, terminal are determined eventually by the utilization rate of memory The computing capability value more than needed at end.
In one embodiment, for not only consuming a large amount of computing capabilitys but also occupying the application programs of a large amount of memories, terminal is logical The comprehensive computing capability value more than needed for determining terminal of the utilization rate of the utilization rate and memory of crossing processor.
S604, be based on image sawtooth degree and computing capability value more than needed, determine the corresponding antialiasing mode of render instruction and Corresponding antialiasing parameter.
In one embodiment, when picture size, which is less than, shows size, indicate that image sawtooth degree is big, terminal can be chosen Alignment rendering antialiasing mode, target antialiasing mode (including MSAA and FXAA), it is final to determine using any or a variety of anti- Sawtooth fashion also needs to combine computing capability value more than needed.When computing capability value more than needed is greater than default computing capability value more than needed, terminal Antialiasing mode used by then determining is alignment rendering antialiasing mode and target antialiasing mode.In addition, terminal also determines Corresponding to target antialiasing mode and realize anti-aliasing effect preferably antialiasing parameter.When computing capability value more than needed is less than When default computing capability value more than needed, antialiasing mode used by terminal then determines is that alignment rendering antialiasing mode and target are anti- Sawtooth fashion.In addition, terminal also determines corresponding to target antialiasing mode and the lesser antialiasing ginseng of consumption computing capability Number.
It should be noted that different antialiasing parameters, the consumed computing capability in carrying out antialiasing treatment process It is different, and anti-aliasing effect also has difference.
S208 can specifically include:
S606 modifies render instruction according to antialiasing mode and corresponding antialiasing parameter, obtains acting on behalf of render instruction.
Wherein, according to antialiasing mode and the modification of corresponding antialiasing parameter, render instruction is resulting acts on behalf of render instruction, It is used to indicate video driver and antialiasing processing is carried out to image using antialiasing mode and corresponding antialiasing parameter.
In above-described embodiment, the computing capability value more than needed of image sawtooth degree and terminal determines that render instruction is corresponding anti- Sawtooth fashion and corresponding antialiasing parameter, so as to both ensure to be joined according to corresponding antialiasing mode and corresponding antialiasing Number carries out the antialiasing processing of image, reduces or eliminates the sawtooth of image, but also can guarantee the fluency of level of application.
In one embodiment, S208 can specifically include:Render instruction is revised as using determining antialiasing mode, It obtains acting on behalf of render instruction;Render instruction is acted on behalf of, video driver is used to indicate and renders image to be rendered, and referred to based on agency's rendering Antialiasing mode used by enabling carries out antialiasing processing to image resulting after rendering.
In one embodiment, under the premise of the computing capability of terminal value is sufficiently large, when picture size is less than terminal Show that size, the antialiasing mode that terminal determines include the antialiasing modes such as alignment rendering antialiasing mode, MSAA and FXAA.When Picture size is greater than the displaying size of terminal, and the antialiasing mode that terminal determines includes the antialiasing mode such as MSAA and FXAA.
In above-described embodiment, render instruction is revised as obtaining acting on behalf of render instruction using determining antialiasing mode.It is logical It crosses and acts on behalf of rendering and antialiasing processing that render instruction instruction video driver realizes image to be rendered.
In one embodiment, between image sawtooth degree passes through image to be rendered picture size and corresponding displaying size Relationship indicate.S208 can specifically include:When picture size, which is less than, shows size, then will be specified in render instruction to wash with watercolours The picture size of dye image is revised as showing size, and the antialiasing mode that antialiasing mode is used as render instruction, obtains To acting on behalf of render instruction.Act on behalf of render instruction, be used to indicate video driver according to show size adjusting image to be rendered size, Image after adjustment size is rendered.
Wherein, the antialiasing mode that antialiasing mode is used as render instruction can be referred to:The wash with watercolours of application triggers When having a finger in every pie order and not using alignment rendering antialiasing mode, neat rendering antialiasing mode is made an addition in render instruction, to make to show Card driving renders image to be rendered according to neat rendering antialiasing mode, realizes the effect of antialiasing.
In above-described embodiment, when picture size, which is less than, shows size, figure to be rendered that terminal will be specified in render instruction The picture size of picture is revised as showing size, so that video driver renders image to be rendered according to displaying size.Terminal It is obtained using antialiasing mode as antialiasing mode employed in render instruction to realize the addition of antialiasing mode Act on behalf of render instruction.And then indicate video driver according to the ruler for showing size adjusting image to be rendered according to render instruction is acted on behalf of It is very little, the image after adjustment size is rendered, the automatic antialiasing processing of image is realized.
In one embodiment, as shown in fig. 7, based on antialiasing mode used by render instruction is acted on behalf of to institute after rendering The image obtained carries out the step of antialiasing processing, can specifically include:
S702 determines after rendering the edge of each object in resulting image and to edge using counting.
Wherein, the object in image can be real object or virtual objects.Real object such as people or object etc..It is virtual right As the virtual role and stage property etc. in such as game.In the picture, the part for being easy to produce sawtooth is the side of each object in image Therefore edge can carry out antialiasing processing for the edge of object.
MSAA sub-sampling points be it is adjustable, can generally take 2,4 and 8 etc., i.e. MSAA 2X, MSAA 4X, MSAA 8X。
In one embodiment, terminal is according to the edge of object each in edge detection algorithm detection image.Specifically, eventually End can specifically include following four step according to the method and step at the edge of object each in edge detection algorithm detection image Suddenly:
(1) image is filtered.
First derivative and second dervative based on brightness of image are used in edge detection algorithm, due to the calculating pair of derivative Noise is very sensitive.Therefore, terminal is filtered image by filter.
(2) enhancing processing is carried out to image.
Terminal determines the changing value of each vertex neighborhood intensity in image, and by neighborhood intensity value, there are the click-through rowers of significant changes Note, the mode of mark, which can be, to be highlighted.
(3) image is detected.
The gradient magnitude of many of image point is larger, and these points may be not necessarily all edge.Terminal is by the ladder of each point Degree amplitude is compared with gradient amplitude threshold value, to judge whether it is marginal point.
(4) edge of image is determined.
The edge of object is determined according to the marginal point judged.
S704 counts according to sub-sampling, samples to the edge of each object.
In one embodiment, it when determining the edge of each object in image, is counted according to sub-sampling, to object The pixel at edge sampled.
S706 carries out antialiasing processing to the edge of gained object after sampling, obtains anti-aliased image.
In one embodiment, processing is zoomed in and out to the edge pixel of gained object after sampling.
In above-described embodiment, the edge of each object and sub-sampling points in image are determined, according to son using points to mesh The edge for marking object carries out pixel use, to obtain the edge pixel of object.Antialiasing processing is carried out to the edge of object, On the one hand, it realizes and antialiasing is carried out to image, reduce or eliminate the sawtooth of image;On the other hand, only to the edge of object Antialiasing processing is carried out, the calculation amount of terminal is reduced.
In one embodiment, as shown in figure 8, S704 can specifically include:
S802, the computing capability value more than needed of counterpart terminal when determining application program operation.
Wherein, have more than needed computing capability value can refer to terminal when running each application program, remaining computing capability value.
In one embodiment, the application program of computing capabilitys a large amount of for consumption, when running application program, terminal is logical The utilization rate for crossing central processing unit and/or graphics processor determines the computing capability value more than needed of terminal.
In one embodiment, the application program of memories a large amount of for consumption, terminal are determined eventually by the utilization rate of memory The computing capability value more than needed at end.
In one embodiment, for not only consuming a large amount of computing capabilitys but also occupying the application programs of a large amount of memories, terminal is logical The comprehensive computing capability value more than needed for determining terminal of the utilization rate of the utilization rate and memory of crossing processor.
S802 counts according to sub-sampling of the computing capability value more than needed adjustment to the edge of each object.
In one embodiment, it avoids leading to the calculation amount for increasing terminal using excessive sub-sampling points, influences to answer The problem of with the fluency of program.Before terminal samples at the edge to object, each mesh is adjusted according to computing capability more than needed Mark the sub-sampling points at the edge of object.When computing capability value more than needed is greater than default computing capability value more than needed, sub-sampling point is tuned up Number.MSAA 2X is such as adjusted to MSAA 4X, MSAA 8X.
S802 counts according to sub-sampling adjusted, samples to the edge of each object.
In above-described embodiment, counted according to sub-sampling of the computing capability value more than needed adjustment to the edge of each object, according to Sub-sampling points adjusted sample the edge of each object, and avoid influences to answer in carrying out antialiasing treatment process With the fluency of program.
As an example, as shown in figure 9, determining that the method and step of image sawtooth degree and corresponding antialiasing mode is specific May include:
S902 detects the size between the displaying size of the picture size and display screen in frame buffer, determines alignment rendering Mode.
The image rendering Agent components of simulator in terminal check render instruction (such as OpenGL ES instruction), such as check inspection Frame buffer creation function and its call parameters in render instruction are looked into, the application program (game of such as Android system is therefrom extracted Using) given frame buffer size, so that it is determined that corresponding picture size in corresponding frame buffer.Then, in conjunction with simulator and end The configuration information at end determines the displaying size of display screen, shows that size can be the virtual screen size of Android or display screen PPI or the resolution ratio of display screen etc..According to the size between picture size in frame buffer and the displaying size of display screen, really When determining application program and running at the terminal, there is the severity of sawtooth.
In general, if image will generate biggish sawtooth in frame buffer when the displaying size of picture size small display.If frame When picture size is greater than or equal to the displaying size of display screen in caching, image will generate lesser sawtooth.
S904 is determined by the render instruction in loading procedure and is used multiple sampling antialiasing mode.
The image rendering Agent components of simulator in terminal, the wash with watercolours of OpenGL ES version according to used in application program Order is had a finger in every pie, determines whether hardware antialiasing mode is used.
For example, in OpenGL initialization, image rendering Agent components are confirmed whether to use for OpenGL ES 2.0 MSAA.Alternatively, judging whether to use MSAA by analyzing the render instruction in other version OpenGL ES loading procedures.
S906 is determined by the feature of render instruction in loading procedure using quickly approximate antialiasing mode.
The image rendering Agent components of simulator in terminal analyze the feature of render instruction in OpenGL ES loading procedure, To detect whether other antialiasing technologies (such as FXAA) are used.
In addition, image rendering Agent components will also analyze whether other visual effect enhancing technologies are used.Wherein, depending on Feel that effect enhancing technology can be the dynamic fuzzy technology for making image frame visually more smooth.
As an example, as shown in Figure 10, S402 can be regarded as formulating the step of antialiasing strategy, specifically can wrap It includes:
Whether the size of S1002, frame buffer are enough.
The image rendering Agent components of simulator, the size of picture size is determined according to the size of frame buffer, is sentenced in terminal Whether disconnected picture size is greater than or equal to the displaying size of terminal display screen.Wherein, there are three kinds of possibility, i.e. picture size may Be less than, be equal to or greater than terminal display screen displaying size.
If picture size, which is less than, shows size, there may be largely sawtooth.By the figure of smaller picture size When fictionalizing the displaying size come as being amplified to larger-sized Android simulator, the edge of image when due to amplification sampling Profile will become unsmooth, to generate sawtooth.If picture size, which is equal to, shows size, there may be the saws of O-level Tooth.If picture size, which is greater than, shows size, indicate that application program may use super-resolution antialiasing SSAA technology, thus only Generate slight sawtooth.
Therefore, when picture size is less than displaying size, image rendering Agent components determine that the size of frame buffer is inadequate, so that Picture size is less than the displaying size of display screen, makes occur the appreciable sawtooth of user on the image frame of application program.Image It renders Agent components and determines addition alignment rendering mode, to carry out alignment rendering to image.Picture size is greater than or equal to Show size both of these case, what image generated is the sawtooth of O-level or slight extent, addition.
S1004, addition alignment rendering mode.
Alignment this strategy of rendering mode is added to antialiasing strategy by the image rendering Agent components of simulator in terminal In list.Wherein, various candidate antialiasing modes are stored in antialiasing Policy List, in the process of running so as to application program, Corresponding antialiasing mode is obtained from antialiasing Policy List.
S1006 judges whether fluency is impacted.
The image rendering Agent components of simulator in terminal are judged by detecting the fluency variation of application program to figure As carrying out whether antialiasing processing influences fluency.If fluency is affected, image rendering Agent components adjust antialiasing plan Slightly, such as from antialiasing Policy List alignment rendering mode is removed.
Affected degree can be divided into both of which discussion:
Mode 1, balanced antialiasing mode.
Balanced antialiasing mode is to protect based on the fluency of application program.Therefore, if the fluency of application program occurs When appreciable decline, it is determined that the fluency of application program is impacted.
Mode 2, ultimate attainment antialiasing mode.
Ultimate attainment antialiasing mode with guarantee the image frame in application program it is smooth based on.Therefore, if the stream of application program Smooth degree is maintained in user's tolerance interval, it is determined that the fluency of application program is not affected by influence.
S1008 deletes alignment rendering mode.
The image rendering Agent components of simulator will be aligned when the fluency for determining application program is impacted in terminal Rendering mode is removed from antialiasing Policy List.
S1010, if the other candidate antialiasing modes of addition.
The image rendering Agent components of simulator, comprehensively consider whether application program uses other antialiasing in terminal Both factors of the fluency of mode and application program further determine whether to need to add other candidate antialiasing modes. If application program uses other antialiasing modes, such as SSAA, MSAA or FXAA antialiasing mode.Alternatively, using journey The fluency of sequence is affected, and image rendering Agent components will no longer add other antialiasing modes, directly exports currently Carry the antialiasing strategy of alignment rendering mode.
S1012 adds corresponding target antialiasing mode.
The image rendering Agent components of simulator in terminal, addition use MSAA or FXAA antialiasing strategy, so as into One step eliminates sawtooth tiny in image.
S1014, output carry the antialiasing strategy of candidate antialiasing mode.
The image rendering Agent components of simulator in terminal, are saved and are exported to antialiasing strategy.Wherein, output Antialiasing strategy includes antialiasing mode, antialiasing parameter and the application order used, for making when subsequent modification render instruction With.
As an example, as shown in figure 11, generation includes the antialiasing strategy of candidate antialiasing mode and according to anti- The method and step of sawtooth strategy modification render instruction, can specifically include:
S1102 receives image rendering instruction.
The image rendering Agent components of simulator in terminal are encoded receiving by system component (such as Android system component) Binary system render instruction after, parsing by coding render instruction, so that render instruction of the follow-up process to application program is done It is further processed, such as modifies render instruction.In the embodiment of the present invention, specific limit is not done for the coding and decoding of render instruction It is fixed.
S1104 judges that application program is in loading procedure or operational process.
According to Embedded open graphic library (OpenGL ES) standard, image rendering Agent components judge current application Program state in which is in loading procedure or operational process.Corresponding, image rendering Agent components can will be received Render instruction (such as OpenGL ES instruction) be divided into two class of loading procedure and operational process.
Wherein, the render instruction processing mode during the purpose of the state demarcation of application program is to discriminate between two:It is answering With program loading procedure, the image sawtooth degree of correspondence image in application program is analyzed, corresponding antialiasing strategy is formulated, modified Corresponding antialiasing parameter.In application program operational process, used antialiasing mode is determined by antialiasing strategy, according to Determining antialiasing mode modifies render instruction, to reach anti-aliasing effect.
S1106 determines image sawtooth degree.
The image rendering Agent components of simulator in application program loading procedure, terminal check render instruction (such as OpenGL ES instruction), as checked frame buffer creation function and its call parameters in render instruction, therefrom extracts and answer With the frame buffer size that program (game application of such as Android system) is given, so that it is determined that corresponding image ruler in corresponding frame buffer It is very little.Then, the configuration information in conjunction with simulator and terminal determines the displaying size of display screen, shows that size can be Android The PPI of virtual screen size or display screen or the resolution ratio of display screen etc..According to picture size in frame buffer and display screen Displaying size between size, when determining that application program is run at the terminal, there is the severity of sawtooth.
S1108 generates antialiasing strategy.
In integrated applications after the image sawtooth degree of image and the fluency of application program, image rendering Agent components Antialiasing strategy will be generated, the fluency of the image quality and application program of image in application program is balanced.
Since the high image quality of image and the high fluency of application program are usually to oppose.The embodiment of the present invention is in addition to using The antialiasing strategy of application program smoothness degree is protected, i.e., balanced antialiasing mode is carried out using the computing capability value more than needed of terminal The antialiasing of image is handled.In addition, also using ultimate attainment antialiasing mode, i.e., using fluency as generation when progress image antialiasing is handled Valence exchanges the image of high image quality for.
S1110 modifies the render instruction in loading procedure according to the antialiasing mode in antialiasing strategy.
Image rendering Agent components determine corresponding antialiasing side according to antialiasing strategy in application program loading procedure Formula, such as setting MSAA and alignment rendering mode antialiasing mode.Specific application method can be modification render instruction, example Such as, it is instructed for specific OpenGL ES, rewrites or increase the parameter in render instruction, or change OpenGL ES instruction name Claim.
Render instruction is transmitted to video driver by S1112.
Image rendering Agent components are by after modification or unmodified render instruction is transmitted to video driver, so as to video card Render instruction carries out rendering to image based on the received and antialiasing is handled for driving.In this step, antialiasing processing will be corresponded to It is pellucidly come into force with program, i.e., does not influence the normal operation of application program.
S1114 judges whether according to antialiasing strategy using antialiasing mode.
In application program operational process, image rendering Agent components judge whether in need using corresponding antialiasing side Formula, to carry out antialiasing processing to image.If it is determined that resistance mode is not used, then render instruction will be directly transferred to video card drive It is dynamic.If it is determined that not using resistance mode, then S1116 is executed.
S1116 modifies render instruction according to antialiasing mode.
Image rendering Agent components will be by antialiasing strategy, and the two class modes of selection realize antialiasing strategy.It specifically includes, needle To hard-wired standard antialiasing technology, such as MSAA rewrites specific instruction and corresponding parameter;Alternatively, for game picture The antialiasing technology of global post-processing formula, such as FXAA are instructed by the way that several new OpenGL ES are added between specific instruction, To complete three capture, processing and submission operations of original game picture.
Render instruction is transmitted to video driver by S1118.
Image rendering Agent components by after modification, unmodified or newly-generated render instruction be transmitted to video driver, with Just render instruction carries out rendering to image to video driver based on the received and antialiasing is handled.
S1120 detects the fluency of application program.
Image rendering Agent components analyze the corresponding temporal aspect of render instruction, using the end of an image rendering frame as Point of observation counts rendering frame number per second.Image rendering Agent components answer average frame per second using within the unit time as measurement The fluency run on simulator with program.In addition, image rendering Agent components can using the linear of average frame per second or Nonlinear Mapping or other fluency indexs are as evaluation criterion.In embodiments of the present invention, to the evaluation criterion of fluency It is not specifically limited.
As an example, as shown in figure 12, the method and step for modifying render instruction, can specifically include:
S1202 receives image rendering instruction.
The image rendering Agent components of simulator in terminal receive the binary picture rendering encoded by system component and refer to It enables, and is decoded after receiving render instruction.
S1204 judges whether using alignment rendering mode.
Image rendering Agent components judge the displaying size of the picture size of image and terminal display screen in application program, if Picture size, which is less than, shows size, it is determined that the image sawtooth degree of image is larger in application program.At this point, judging antialiasing plan With the presence or absence of alignment rendering mode in slightly, and if it exists, then using alignment rendering mode.
S1206 modifies the size of the frame buffer in render instruction, so that the displaying size pair of picture size and display screen Together.
Image rendering Agent components get the displaying size of terminal display screen, which can be the void of simulator Quasi- screen size.Image rendering Agent components search creation frame buffer render instruction, by picture size therein be revised as with Show size same size.
S1208, if use multiple sampling antialiasing mode.
Image rendering Agent components are according to antialiasing strategy, it is determined whether using the antialiasing mode of MSAA.For example, when connecing When receiving the render instruction sent in application program operational process, judge whether the render instruction uses the antialiasing side of MSAA Formula in order to handle the sawtooth in image, then determines the antialiasing needed using MSAA if not using MSAA according to antialiasing strategy Mode.
S1210 modifies the antialiasing parameter in render instruction according to multiple sampling antialiasing mode.
Image rendering Agent components receive the render instruction sent in application program operational process, or search application program and add Render instruction during load modifies render instruction according to MSAA, to enable the antialiasing mode of MSAA.Wherein, MSAA Sub-sampling points be it is adjustable, generally take 2,4,8 etc., i.e. MSAA2X, MSAA 4X, MSAA 8X.
Wherein, the sub-sampling points of MSAA can balance the image quality and application of image in application program by self feed back condition The fluency of program.
S1212, if using quickly approximate antialiasing mode.
Image rendering Agent components are according to antialiasing strategy, it is determined whether using the antialiasing mode of FXAA.For example, when connecing When receiving the render instruction sent in application program operational process, judge whether the render instruction uses the antialiasing side of FXAA Formula, if not using FXAA, the sawtooth in image, then determine according to antialiasing strategy and need using FXAA's for further processing Antialiasing mode.
S1214 modifies render instruction according to Fast rendering antialiasing mode, so that video driver is by the image of application program Picture is redirected to additional frame buffer, is input with additional true caching, using quick approximate antialiasing mode to image into The processing of row antialiasing.
For the antialiasing mode of the global post-processing formula of image in application program, image rendering Agent components are received Between render instruction, new render instruction (such as OpenGL ES instruction) is added, by received render instruction and new render instruction It is transmitted to video driver, to complete the capture, processing of original image in application program and to submit three operations.It will apply The drafting of image frame is redirected in advance in the frame buffer additionally retained in program, and the size and application program of the frame buffer create Frame buffer size it is consistent.
Render instruction is transmitted to video driver by S1216.
Image rendering Agent components by after modification, unmodified or newly added OpenGL ES render instruction is transmitted to Video driver executes.
As an example, as shown in figure 13, it is handled without antialiasing, for comparison in one embodiment by being aligned wash with watercolours Dye mode handles and the schematic diagram of the image by FXAA processing.
As shown in Figure 13 (a), for the image for not using the scheme of the embodiment of the present invention to handle, personage edge goes out in figure Now apparent sawtooth, as personage arm and leg edge between sawtooth clearly, personage face it is also unintelligible.Image generates The reason of sawtooth is:It is the aobvious of 1080P when being amplified to resolution ratio since application program default renders image frame using 720P Just occurs apparent sawtooth in display screen.
As shown in Figure 13 (b), the displaying size of the picture size and display screen that are arranged in detecting frame buffer is inconsistent When, the size of frame buffer is adjusted, and then picture size is made to reach the displaying size of display screen, that is, the frame buffer for establishing 1080P is replaced For the 720P frame buffer that application program voluntarily creates, to make picture size reach the displaying size of display screen, to reduce figure The sawtooth of picture.Wherein, picture size can be resolution ratio.It is corresponding, show that size can be resolution ratio.
As shown in Figure 13 (c), ensure application program fluency it is unaffected under the premise of, further using MSAA or The antialiasing mode of FXAA, make full use of in computing capability value more than needed further eliminate the sawtooth of image.
In above-described embodiment, by combining a variety of antialiasing modes, realizes and antialiasing processing is carried out to image.In addition, When carrying out antialiasing processing to image, it is ensured that the fluency of application program avoids the antialiasing because of the manual configuration diagram picture of user Mode and the decline for causing fluency, or the excessively fuzzy pictures that cause of antialiasing.By simulator, automatic antialiasing is set, The compatible universality of simulator is good, is adapted to the application program and terminal video card of mainstream operation system.
Fig. 2 is the flow diagram of image antialiasing processing method in one embodiment.Although should be understood that Fig. 2 Flow chart in each step successively show that but these steps are not inevitable to indicate according to arrow according to the instruction of arrow Sequence successively execute.Unless expressly stating otherwise herein, there is no stringent sequences to limit for the execution of these steps, these Step can execute in other order.Moreover, at least part step in Fig. 2 may include multiple sub-steps or multiple Stage, these sub-steps or stage are not necessarily to execute completion in synchronization, but can execute at different times, These sub-steps perhaps the stage execution sequence be also not necessarily successively carry out but can be with other steps or other steps Sub-step or at least part in stage execute in turn or alternately.
As shown in figure 14, in one embodiment, a kind of image antialiasing processing unit is provided, at the image antialiasing Reason device specifically includes:Receiving module 1402, sawtooth degree determining module 1404, antialiasing mode determining module 1406, instruction Modified module 1408 and output module 1410;Wherein:
Receiving module 1402, the render instruction triggered for receiving application program;
Sawtooth degree determining module 1404, for determining the corresponding image sawtooth degree of render instruction;
Antialiasing mode determining module 1406, for determining the corresponding antialiasing side of render instruction based on image sawtooth degree Formula;
Instruction modification module 1408 obtains acting on behalf of render instruction for modifying render instruction according to antialiasing mode;
Output module 1410 is used for output agent render instruction;It acts on behalf of render instruction and is used to indicate video driver and rendering Antialiasing processing is carried out when image.
In above-described embodiment, the render instruction that application program is triggered is received, the sawtooth of image is determined by render instruction Degree so can determine whether modification render instruction, to carry out antialiasing processing to image.Institute is chosen according to sawtooth degree The antialiasing mode to be taken modifies to render instruction according to the antialiasing mode of selection, is referred to according to modified rendering Enable can root render image, and antialiasing processing is carried out according to antialiasing mode in render process, to realize to image Automatic antialiasing processing, improve anti-aliasing effect, and then improve the quality of image.
In one embodiment, sawtooth degree determining module 1404 is also used to determine image to be rendered according to render instruction Picture size;The displaying size of counterpart terminal when obtaining operation application program;It determines picture size and shows the relationship between size; The relationship indicates the corresponding image sawtooth degree of render instruction.
In above-described embodiment, image sawtooth degree is indicated according to the relationship between picture size and displaying size, it can be quick Ground judges whether image has sawtooth, is conducive to the time for shortening the processing of image antialiasing, improves image antialiasing efficiency.
In one embodiment, antialiasing mode determining module 1406 is also used to when render instruction be that application program loaded When triggered in journey, then candidate antialiasing mode is determined according to image sawtooth degree;When render instruction is that application program was run When triggered in journey, then the corresponding antialiasing mode of render instruction is determined based on image sawtooth degree, including:Based on image sawtooth Degree chooses antialiasing mode corresponding with sawtooth degree from candidate antialiasing mode.
In above-described embodiment, when render instruction in application program loading procedure by triggering, according to image sawtooth degree It determines candidate's antialiasing mode, provides corresponding antialiasing mode in the process of running for application program, it is corresponding to carry out Antialiasing processing.When render instruction in application program operational process by triggering, it is based on image sawtooth degree, from candidate anti-saw Antialiasing mode corresponding with sawtooth degree is chosen in tooth mode, so that the antialiasing mode according to acquisition carries out anti-saw to image Tooth processing improves the efficiency of antialiasing to realize the automatic antialiasing processing of image.
In one embodiment, between image sawtooth degree passes through image to be rendered picture size and corresponding displaying size Relationship indicate;Antialiasing mode determining module 1406 is also used to when picture size is less than and shows size, will be with displaying size Matched alignment rendering antialiasing mode is included in candidate antialiasing mode.
In above-described embodiment, when picture size, which is less than, shows size, the anti-saw of rendering will be aligned with showing that size is matched Tooth mode is included in candidate antialiasing mode, in order to carry out alignment rendering to image, picture size is made to be rendered into displaying ruler The image of very little size, to reduce the sawtooth degree of image.
In one embodiment, antialiasing mode determining module 1406 is also used to not use antialiasing mode when render instruction When, then it include in candidate antialiasing mode by target antialiasing mode;When determining antialiasing mode includes that alignment rendering is anti- When sawtooth fashion and target antialiasing mode, render instruction is acted on behalf of, is used to indicate video driver using alignment rendering antialiasing side After formula carries out antialiasing processing, antialiasing processing is further carried out using target antialiasing mode.
In one embodiment, antialiasing mode determining module 1406 is also used to when determining antialiasing mode include target Antialiasing mode and when not including alignment rendering antialiasing mode, acts on behalf of render instruction, is used to indicate video driver using target Antialiasing mode carries out antialiasing processing.
It then include waiting by target antialiasing mode when render instruction does not use antialiasing mode in above-described embodiment It selects in antialiasing mode, to obtain corresponding antialiasing mode.When determining antialiasing mode includes alignment rendering antialiasing When mode and target antialiasing mode, after carrying out antialiasing processing using alignment rendering antialiasing mode, target is further used Antialiasing mode carries out antialiasing processing, to realize the multiple antialiasing processing of image.
In one embodiment, as shown in figure 15, which further includes:Fluency detection module 1412, parameter configuration obtain Modulus block 1414 and removing module 1416;Wherein:
Fluency detection module 1412, for detecting fluency when operation application program;
Parameter configuration obtains module 1414, for obtaining configuration parameter;
Removing module 1416, for being less than default fluency and configuration parameter expression fluency than image matter when fluency When measuring preferential, alignment rendering antialiasing mode is deleted from candidate antialiasing mode.
In above-described embodiment, detection fluency and acquisition configuration parameter, when fluency is less than default fluency and configuration ginseng When number indicates that fluency is more preferential than picture quality, alignment rendering antialiasing mode is deleted from candidate antialiasing mode, thus When picture size is less than displaying size, the rendering that neat rendering antialiasing mode carries out image will not be chosen, ensures that smoothness The requirement of degree.
In one embodiment, counterpart terminal when antialiasing mode determining module 1406 is also used to determine application program operation Computing capability value more than needed;Based on image sawtooth degree and computing capability value more than needed, the corresponding antialiasing side of render instruction is determined Formula and corresponding antialiasing parameter;Instruction modification module 1408 is also used to be repaired according to antialiasing mode and corresponding antialiasing parameter Change render instruction, obtains acting on behalf of render instruction.
In above-described embodiment, the computing capability value more than needed of image sawtooth degree and terminal determines that render instruction is corresponding anti- Sawtooth fashion and corresponding antialiasing parameter, so as to both ensure to be joined according to corresponding antialiasing mode and corresponding antialiasing Number carries out the antialiasing processing of image, reduces or eliminates the sawtooth of image, but also can guarantee the fluency of level of application.
In one embodiment, instruction modification module 1408 is also used to for render instruction being revised as using determining antialiasing Mode obtains acting on behalf of render instruction;Render instruction is acted on behalf of, video driver is used to indicate and renders image to be rendered, and based on agency Antialiasing mode used by render instruction carries out antialiasing processing to image resulting after rendering.
In above-described embodiment, render instruction is revised as obtaining acting on behalf of render instruction using determining antialiasing mode.It is logical It crosses and acts on behalf of rendering and antialiasing processing that render instruction instruction video driver realizes image to be rendered.
In one embodiment, between image sawtooth degree passes through image to be rendered picture size and corresponding displaying size Relationship indicate;Instruction modification module 1408 is also used to then specify in render instruction when picture size is less than and shows size The picture size of image to be rendered be revised as showing size, and the antialiasing side that antialiasing mode is used as render instruction Formula obtains acting on behalf of render instruction;Render instruction is acted on behalf of, is used to indicate video driver according to displaying size adjusting image to be rendered Size renders the image after adjustment size.
In above-described embodiment, when picture size, which is less than, shows size, figure to be rendered that terminal will be specified in render instruction The picture size of picture is revised as showing size, so that video driver renders image to be rendered according to displaying size.Terminal It is obtained using antialiasing mode as antialiasing mode employed in render instruction to realize the addition of antialiasing mode Act on behalf of render instruction.And then indicate video driver according to the ruler for showing size adjusting image to be rendered according to render instruction is acted on behalf of It is very little, the image after adjustment size is rendered, the automatic antialiasing processing of image is realized.
In one embodiment, output module 1410 is also used to indicate each in resulting image after video driver determines rendering The edge of object and to edge using counting;It is counted according to sub-sampling, the edge of each object is sampled;To sampling The edge of gained object carries out antialiasing processing afterwards, obtains anti-aliased image.
In above-described embodiment, the edge of each object and sub-sampling points in image are determined, according to son using points to mesh The edge for marking object carries out pixel use, to obtain the edge pixel of object.Antialiasing processing is carried out to the edge of object, On the one hand, it realizes and antialiasing is carried out to image, reduce or eliminate the sawtooth of image;On the other hand, only to the edge of object Antialiasing processing is carried out, the calculation amount of terminal is reduced.
In one embodiment, output module 1410 is also used to indicate corresponding whole when video driver determines application program operation The computing capability value more than needed at end;It is counted according to sub-sampling of the computing capability value more than needed adjustment to the edge of each object;According to tune Sub-sampling points after whole, sample the edge of each object.
In above-described embodiment, counted according to sub-sampling of the computing capability value more than needed adjustment to the edge of each object, according to Sub-sampling points adjusted sample the edge of each object, and avoid influences to answer in carrying out antialiasing treatment process With the fluency of program.
Figure 16 shows the internal structure chart of computer equipment in one embodiment.The computer equipment specifically can be figure Terminal 110 in 1.As shown in figure 16, it includes the place connected by system bus which, which includes the computer equipment, Manage device, memory, network interface, input unit and display screen.Wherein, memory includes non-volatile memory medium and interior storage Device.The non-volatile memory medium of the computer equipment is stored with operating system, can also be stored with computer program, the computer When program is executed by processor, processor may make to realize image antialiasing processing method.It can also be stored in the built-in storage Computer program when the computer program is executed by processor, may make processor to execute image antialiasing processing method.It calculates The display screen of machine equipment can be liquid crystal display or electric ink display screen, and the input unit of computer equipment can be aobvious The touch layer covered in display screen is also possible to the key being arranged on computer equipment shell, trace ball or Trackpad, can also be External keyboard, Trackpad or mouse etc..
It will be understood by those skilled in the art that structure shown in Figure 16, only part relevant to application scheme The block diagram of structure, does not constitute the restriction for the computer equipment being applied thereon to application scheme, and specific computer is set Standby may include perhaps combining certain components or with different component layouts than more or fewer components as shown in the figure.
In one embodiment, image antialiasing processing unit provided by the present application can be implemented as a kind of computer program Form, computer program can run in computer equipment as shown in figure 16.It can be stored in the memory of computer equipment Each program module of the image antialiasing processing unit is formed, for example, receiving module 1402, sawtooth degree shown in Figure 14 are true Cover half block 1404, antialiasing mode determining module 1406, instruction modification module 1408 and output module 1410.Each program module The computer program of composition executes processor at the image antialiasing of each embodiment of the application described in this specification Step in reason method.
For example, computer equipment shown in Figure 16 can pass through connecing in image antialiasing processing unit as shown in figure 14 It receives module 1402 and executes S202.Computer equipment can execute S204 by sawtooth degree determining module 1404.Computer equipment can S206 is executed by antialiasing mode determining module 1406.Computer equipment can execute S208 by instruction modification module 1408. Computer equipment can execute S210 by output module 1410.
In one embodiment, a kind of computer equipment, including memory and processor are provided, memory is stored with meter Calculation machine program, when computer program is executed by processor, so that processor executes following steps:Receive what application program was triggered Render instruction;Determine the corresponding image sawtooth degree of render instruction;Determine that render instruction is corresponding anti-based on image sawtooth degree Sawtooth fashion;Render instruction is modified according to antialiasing mode, obtains acting on behalf of render instruction;Output agent render instruction;Act on behalf of wash with watercolours It has a finger in every pie order and is used to indicate video driver and carry out antialiasing processing when rendering image.
In one embodiment, image antialiasing processing method is applied to simulator, and application program runs on simulator, mould Quasi- device runs on operating system, and video driver runs on operating system.
In one embodiment, computer program is executed by processor the corresponding image sawtooth degree of determining render instruction When step, so that processing implement body executes following steps:The picture size of image to be rendered is determined according to render instruction;Obtain fortune The displaying size of counterpart terminal when row application program;It determines picture size and shows the relationship between size;Relationship indicates that rendering refers to Enable corresponding image sawtooth degree.
In one embodiment, when computer program is executed by processor, so that processor also executes following steps:Work as wash with watercolours When having a finger in every pie order by triggering in application program loading procedure, then candidate antialiasing mode is determined according to image sawtooth degree;Work as wash with watercolours When having a finger in every pie order by triggering in application program operational process, then the corresponding antialiasing of render instruction is determined based on image sawtooth degree Mode, including:Based on image sawtooth degree, antialiasing mode corresponding with sawtooth degree is chosen from candidate antialiasing mode.
In one embodiment, between image sawtooth degree passes through image to be rendered picture size and corresponding displaying size Relationship indicate;When computer program is executed by processor the step according to the determining candidate antialiasing mode of image sawtooth degree, So that processing implement body executes following steps:When picture size, which is less than, shows size, wash with watercolours will be aligned with showing that size is matched Dye antialiasing mode is included in candidate antialiasing mode.
In one embodiment, when computer program is executed by processor, so that processor also executes following steps:Work as wash with watercolours It then include in candidate antialiasing mode by target antialiasing mode when having a finger in every pie order not using antialiasing mode;When determining resists When sawtooth fashion includes alignment rendering antialiasing mode and target antialiasing mode, render instruction is acted on behalf of, is used to indicate video card drive It moves after carrying out antialiasing processing using alignment rendering antialiasing mode, is further carried out at antialiasing using target antialiasing mode Reason.
In one embodiment, when determining antialiasing mode includes target antialiasing mode and does not include that alignment rendering is anti- When sawtooth fashion, render instruction is acted on behalf of, video driver is used to indicate using target antialiasing mode and carries out antialiasing processing.
In one embodiment, when computer program is executed by processor, so that processor also executes following steps:Detection Run fluency when application program;Obtain configuration parameter;When fluency is less than default fluency and configuration parameter expression smoothness When spending more preferential than picture quality, alignment rendering antialiasing mode is deleted from candidate antialiasing mode.
In one embodiment, computer program, which is executed by processor, determines that render instruction is corresponding based on image sawtooth degree Antialiasing mode step when so that processing implement body execute following steps:Counterpart terminal when determining application program operation Computing capability value more than needed;Based on image sawtooth degree and computing capability value more than needed, the corresponding antialiasing mode of render instruction is determined With corresponding antialiasing parameter;
Computer program, which is executed by processor, modifies render instruction according to antialiasing mode, obtains the step for acting on behalf of render instruction When rapid, so that processing implement body executes following steps:Render instruction is modified according to antialiasing mode and corresponding antialiasing parameter, It obtains acting on behalf of render instruction.
In one embodiment, computer program, which is executed by processor, modifies render instruction according to antialiasing mode, obtains When acting on behalf of the step of render instruction, so that processing implement body executes following steps:Render instruction is revised as resisting using determining Sawtooth fashion obtains acting on behalf of render instruction;Render instruction is acted on behalf of, video driver is used to indicate and renders image to be rendered, and be based on It acts on behalf of antialiasing mode used by render instruction and antialiasing processing is carried out to image resulting after rendering.
In one embodiment, between image sawtooth degree passes through image to be rendered picture size and corresponding displaying size Relationship indicate;Computer program, which is executed by processor, modifies render instruction according to antialiasing mode, obtains acting on behalf of render instruction Step when so that processing implement body execute following steps:When picture size, which is less than, shows size, then by render instruction middle finger The picture size of fixed image to be rendered is revised as showing size, and the antialiasing that antialiasing mode is used as render instruction Mode obtains acting on behalf of render instruction;Render instruction is acted on behalf of, is used to indicate video driver according to displaying size adjusting image to be rendered Size, to adjustment size after image render.
In one embodiment, computer program, which is executed by processor, is based on acting on behalf of antialiasing side used by render instruction When formula carries out the step of antialiasing processing to image resulting after rendering, so that processing implement body executes following steps:Determine wash with watercolours After dye in resulting image the edge of each object and to edge using counting;It is counted according to sub-sampling, to each object Edge is sampled;Antialiasing processing is carried out to the edge of gained object after sampling, obtains anti-aliased image.
In one embodiment, computer program is executed by processor counts according to sub-sampling, to the edge of each object When the step sampled, so that processing implement body executes following steps:Counterpart terminal is more than needed when determining application program operation Computing capability value;It is counted according to sub-sampling of the computing capability value more than needed adjustment to the edge of each object;According to son adjusted Sampling number samples the edge of each object.
In one embodiment, a kind of computer readable storage medium is provided, computer program, computer journey are stored with When sequence is executed by processor, so that processor executes following steps:Receive the render instruction that application program is triggered;Determine rendering Instruct corresponding image sawtooth degree;The corresponding antialiasing mode of render instruction is determined based on image sawtooth degree;According to anti-saw Tooth mode modifies render instruction, obtains acting on behalf of render instruction;Output agent render instruction;It acts on behalf of render instruction and is used to indicate video card Driving carries out antialiasing processing when rendering image.
In one embodiment, image antialiasing processing method is applied to simulator, and application program runs on simulator, mould Quasi- device runs on operating system, and video driver runs on operating system.
In one embodiment, computer program is executed by processor the corresponding image sawtooth degree of determining render instruction When step, so that processing implement body executes following steps:The picture size of image to be rendered is determined according to render instruction;Obtain fortune The displaying size of counterpart terminal when row application program;It determines picture size and shows the relationship between size;Relationship indicates that rendering refers to Enable corresponding image sawtooth degree.
In one embodiment, when computer program is executed by processor, so that processor also executes following steps:Work as wash with watercolours When having a finger in every pie order by triggering in application program loading procedure, then candidate antialiasing mode is determined according to image sawtooth degree;Work as wash with watercolours When having a finger in every pie order by triggering in application program operational process, then the corresponding antialiasing of render instruction is determined based on image sawtooth degree Mode, including:Based on image sawtooth degree, antialiasing mode corresponding with sawtooth degree is chosen from candidate antialiasing mode.
In one embodiment, between image sawtooth degree passes through image to be rendered picture size and corresponding displaying size Relationship indicate;When computer program is executed by processor the step according to the determining candidate antialiasing mode of image sawtooth degree, So that processing implement body executes following steps:When picture size, which is less than, shows size, wash with watercolours will be aligned with showing that size is matched Dye antialiasing mode is included in candidate antialiasing mode.
In one embodiment, when computer program is executed by processor, so that processor also executes following steps:Work as wash with watercolours It then include in candidate antialiasing mode by target antialiasing mode when having a finger in every pie order not using antialiasing mode;When determining resists When sawtooth fashion includes alignment rendering antialiasing mode and target antialiasing mode, render instruction is acted on behalf of, is used to indicate video card drive It moves after carrying out antialiasing processing using alignment rendering antialiasing mode, is further carried out at antialiasing using target antialiasing mode Reason.
In one embodiment, when determining antialiasing mode includes target antialiasing mode and does not include that alignment rendering is anti- When sawtooth fashion, render instruction is acted on behalf of, video driver is used to indicate using target antialiasing mode and carries out antialiasing processing.
In one embodiment, when computer program is executed by processor, so that processor also executes following steps:Detection Run fluency when application program;Obtain configuration parameter;When fluency is less than default fluency and configuration parameter expression smoothness When spending more preferential than picture quality, alignment rendering antialiasing mode is deleted from candidate antialiasing mode.
In one embodiment, computer program, which is executed by processor, determines that render instruction is corresponding based on image sawtooth degree Antialiasing mode step when so that processing implement body execute following steps:Counterpart terminal when determining application program operation Computing capability value more than needed;Based on image sawtooth degree and computing capability value more than needed, the corresponding antialiasing mode of render instruction is determined With corresponding antialiasing parameter;
Computer program, which is executed by processor, modifies render instruction according to antialiasing mode, obtains the step for acting on behalf of render instruction When rapid, so that processing implement body executes following steps:Render instruction is modified according to antialiasing mode and corresponding antialiasing parameter, It obtains acting on behalf of render instruction.
In one embodiment, computer program, which is executed by processor, modifies render instruction according to antialiasing mode, obtains When acting on behalf of the step of render instruction, so that processing implement body executes following steps:Render instruction is revised as resisting using determining Sawtooth fashion obtains acting on behalf of render instruction;Render instruction is acted on behalf of, video driver is used to indicate and renders image to be rendered, and be based on It acts on behalf of antialiasing mode used by render instruction and antialiasing processing is carried out to image resulting after rendering.
In one embodiment, between image sawtooth degree passes through image to be rendered picture size and corresponding displaying size Relationship indicate;Computer program, which is executed by processor, modifies render instruction according to antialiasing mode, obtains acting on behalf of render instruction Step when so that processing implement body execute following steps:When picture size, which is less than, shows size, then by render instruction middle finger The picture size of fixed image to be rendered is revised as showing size, and the antialiasing that antialiasing mode is used as render instruction Mode obtains acting on behalf of render instruction;Render instruction is acted on behalf of, is used to indicate video driver according to displaying size adjusting image to be rendered Size, to adjustment size after image render.
In one embodiment, computer program, which is executed by processor, is based on acting on behalf of antialiasing side used by render instruction When formula carries out the step of antialiasing processing to image resulting after rendering, so that processing implement body executes following steps:Determine wash with watercolours After dye in resulting image the edge of each object and to edge using counting;It is counted according to sub-sampling, to each object Edge is sampled;Antialiasing processing is carried out to the edge of gained object after sampling, obtains anti-aliased image.
In one embodiment, computer program is executed by processor counts according to sub-sampling, to the edge of each object When the step sampled, so that processing implement body executes following steps:Counterpart terminal is more than needed when determining application program operation Computing capability value;It is counted according to sub-sampling of the computing capability value more than needed adjustment to the edge of each object;According to son adjusted Sampling number samples the edge of each object.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the program can be stored in a non-volatile computer and can be read In storage medium, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, provided herein Each embodiment used in any reference to memory, storage, database or other media, may each comprise non-volatile And/or volatile memory.Nonvolatile memory may include that read-only memory (ROM), programming ROM (PROM), electricity can be compiled Journey ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) directly RAM (RDRAM), straight Connect memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance Shield all should be considered as described in this specification.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously The limitation to the application the scope of the patents therefore cannot be interpreted as.It should be pointed out that for those of ordinary skill in the art For, without departing from the concept of this application, various modifications and improvements can be made, these belong to the guarantor of the application Protect range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.

Claims (15)

1. a kind of image antialiasing processing method, including:
Receive the render instruction that application program is triggered;
Determine the corresponding image sawtooth degree of the render instruction;
The corresponding antialiasing mode of the render instruction is determined based on described image sawtooth degree;
The render instruction is modified according to the antialiasing mode, obtains acting on behalf of render instruction;
It exports and described acts on behalf of render instruction;It is described act on behalf of render instruction and be used to indicate video driver carry out anti-saw when rendering image Tooth processing.
2. the method according to claim 1, wherein the method is applied to simulator, the application program fortune Row is in the simulator, and the simulator runs on operating system, and the video driver runs on the operating system.
3. the method according to claim 1, wherein the corresponding image sawtooth journey of the determination render instruction Degree, including:
The picture size of image to be rendered is determined according to the render instruction;
Obtain the displaying size of counterpart terminal when running the application program;
Determine described image size and the relationship shown between size;The relationship indicates the corresponding image of the render instruction Sawtooth degree.
4. the method according to claim 1, wherein the method also includes:
When the render instruction in the application program loading procedure by triggering, then determined according to described image sawtooth degree Candidate antialiasing mode;
It is when the render instruction in the application program operational process by triggering, then described to be based on described image sawtooth degree Determine the corresponding antialiasing mode of the render instruction, including:
Based on described image sawtooth degree, antialiasing corresponding with the sawtooth degree is chosen from the candidate antialiasing mode Mode.
5. according to the method described in claim 4, it is characterized in that, described image sawtooth degree passes through the image of image to be rendered Size and the corresponding relationship shown between size indicate;
It is described that candidate antialiasing mode is determined according to described image sawtooth degree, including:
When described image size is less than the displaying size, antialiasing mode will be rendered with matched be aligned of the displaying size It is included in candidate antialiasing mode.
6. according to the method described in claim 5, it is characterized in that, the method also includes:
It then include in candidate antialiasing mode by target antialiasing mode when the render instruction does not use antialiasing mode In;
When the determining antialiasing mode includes the alignment rendering antialiasing mode and the target antialiasing mode, institute It states and acts on behalf of render instruction, be used to indicate video driver and rendered after antialiasing mode carries out antialiasing processing using the alignment, into One step carries out antialiasing processing using target antialiasing mode.
7. according to the method described in claim 6, it is characterized in that, when the determining antialiasing mode includes that the target is anti- Sawtooth fashion and when not including alignment rendering antialiasing mode, it is described to act on behalf of render instruction, it is used to indicate video driver and adopts Antialiasing processing is carried out with target antialiasing mode.
8. the method according to the description of claim 7 is characterized in that the method also includes:
Detection runs the fluency when application program;
Obtain configuration parameter;
When the fluency is less than default fluency and the configuration parameter indicates that fluency is more preferential than picture quality, from institute It states and deletes the alignment rendering antialiasing mode in candidate antialiasing mode.
9. the method according to claim 1, wherein described determine the rendering based on described image sawtooth degree Corresponding antialiasing mode is instructed, including:
The computing capability value more than needed of counterpart terminal when determining application program operation;
Based on described image sawtooth degree and the computing capability value more than needed, the corresponding antialiasing mode of the render instruction is determined With corresponding antialiasing parameter;
It is described that the render instruction is modified according to the antialiasing mode, obtain acting on behalf of render instruction include:
The render instruction is modified according to the antialiasing mode and corresponding antialiasing parameter, obtains acting on behalf of render instruction.
10. method according to any one of claims 1 to 9, which is characterized in that described to be modified according to the antialiasing mode The render instruction obtains acting on behalf of render instruction, including:
The render instruction is revised as obtaining acting on behalf of render instruction using the determining antialiasing mode;It is described to act on behalf of wash with watercolours Order is had a finger in every pie, video driver is used to indicate and renders image to be rendered, and act on behalf of antialiasing side used by render instruction based on described Formula carries out antialiasing processing to image resulting after rendering.
11. according to the method described in claim 10, it is characterized in that, described image sawtooth degree passes through the figure of image to be rendered As size and the corresponding relationship shown between size indicate;
It is described to be revised as obtaining acting on behalf of render instruction using the determining antialiasing mode by the render instruction, including:
When described image size is less than the displaying size, then
The picture size for the image to be rendered specified in the render instruction is revised as the displaying size, and by the anti-saw The antialiasing mode that tooth mode is used as render instruction, obtains acting on behalf of render instruction;
It is described to act on behalf of render instruction, be used to indicate video driver according to it is described show size adjusting image to be rendered size, it is right Image after adjustment size is rendered.
12. according to the method described in claim 10, it is characterized in that, described resisted used by render instruction based on described act on behalf of Sawtooth fashion carries out antialiasing processing to image resulting after rendering, including:
Determine after rendering the edge of each object in resulting image and to the edge using counting;
It is counted according to the sub-sampling, the edge of each object is sampled;
Antialiasing processing is carried out to the edge of gained object after sampling, obtains anti-aliased image.
13. according to the method for claim 12, which is characterized in that it is described to be counted according to the sub-sampling, to each mesh The edge of mark object is sampled, including:
The computing capability value more than needed of counterpart terminal when determining application program operation;
It is counted according to the computing capability value adjustment more than needed the sub-sampling at the edge of each object;
It is counted according to sub-sampling adjusted, the edge of each object is sampled.
14. a kind of image antialiasing processing unit, including:
Receiving module, the render instruction triggered for receiving application program;
Sawtooth degree determining module, for determining the corresponding image sawtooth degree of the render instruction;
Antialiasing mode determining module, for determining the corresponding antialiasing side of the render instruction based on described image sawtooth degree Formula;
Instruction modification module obtains acting on behalf of render instruction for modifying the render instruction according to the antialiasing mode;
Output module described acts on behalf of render instruction for exporting;It is described act on behalf of render instruction and be used to indicate video driver rendering Antialiasing processing is carried out when image.
15. a kind of computer equipment, including memory and processor, the memory is stored with computer program, the calculating When machine program is executed by the processor, so that the processor is executed such as any one of claims 1 to 13 the method Step.
CN201810629276.4A 2018-06-19 2018-06-19 Image anti-aliasing processing method and device and computer equipment Active CN108846815B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810629276.4A CN108846815B (en) 2018-06-19 2018-06-19 Image anti-aliasing processing method and device and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810629276.4A CN108846815B (en) 2018-06-19 2018-06-19 Image anti-aliasing processing method and device and computer equipment

Publications (2)

Publication Number Publication Date
CN108846815A true CN108846815A (en) 2018-11-20
CN108846815B CN108846815B (en) 2023-03-24

Family

ID=64202753

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810629276.4A Active CN108846815B (en) 2018-06-19 2018-06-19 Image anti-aliasing processing method and device and computer equipment

Country Status (1)

Country Link
CN (1) CN108846815B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112785676A (en) * 2021-02-08 2021-05-11 腾讯科技(深圳)有限公司 Image rendering method, device, equipment and storage medium
CN113706672A (en) * 2020-05-09 2021-11-26 腾讯科技(深圳)有限公司 Image rendering method, device and equipment and storage medium
WO2021248706A1 (en) * 2020-06-12 2021-12-16 完美世界(北京)软件科技发展有限公司 Depth anti-aliasing data reading method and device, computer program and readable medium
CN113837955A (en) * 2021-08-17 2021-12-24 每平每屋(上海)科技有限公司 Image anti-aliasing processing method and electronic equipment
WO2022100663A1 (en) * 2020-11-13 2022-05-19 华为技术有限公司 Method, apparatus and device for selecting anti-aliasing algorithm and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020101435A1 (en) * 2000-08-23 2002-08-01 Nobuo Sasaki Apparatus and method for rendering antialiased image
CN104793837A (en) * 2014-01-20 2015-07-22 腾讯科技(深圳)有限公司 Picture generation method and device
CN108022218A (en) * 2017-11-24 2018-05-11 中国航空工业集团公司西安航空计算技术研究所 A kind of adaptive texture character library antialiasing method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020101435A1 (en) * 2000-08-23 2002-08-01 Nobuo Sasaki Apparatus and method for rendering antialiased image
CN104793837A (en) * 2014-01-20 2015-07-22 腾讯科技(深圳)有限公司 Picture generation method and device
CN108022218A (en) * 2017-11-24 2018-05-11 中国航空工业集团公司西安航空计算技术研究所 A kind of adaptive texture character library antialiasing method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张岩: "2006图形技术指南", 《个人电脑》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113706672A (en) * 2020-05-09 2021-11-26 腾讯科技(深圳)有限公司 Image rendering method, device and equipment and storage medium
WO2021248706A1 (en) * 2020-06-12 2021-12-16 完美世界(北京)软件科技发展有限公司 Depth anti-aliasing data reading method and device, computer program and readable medium
WO2022100663A1 (en) * 2020-11-13 2022-05-19 华为技术有限公司 Method, apparatus and device for selecting anti-aliasing algorithm and readable storage medium
CN114565708A (en) * 2020-11-13 2022-05-31 华为技术有限公司 Method, device and equipment for selecting anti-aliasing algorithm and readable storage medium
EP4231244A4 (en) * 2020-11-13 2024-05-29 Huawei Technologies Co., Ltd. ANTI-aliasing ALGORITHM SELECTION METHOD, APPARATUS AND DEVICE AND READABLE STORAGE MEDIUM
CN114565708B (en) * 2020-11-13 2025-10-28 华为技术有限公司 Method, device, apparatus and readable storage medium for selecting anti-aliasing algorithm
CN112785676A (en) * 2021-02-08 2021-05-11 腾讯科技(深圳)有限公司 Image rendering method, device, equipment and storage medium
CN112785676B (en) * 2021-02-08 2024-04-12 腾讯科技(深圳)有限公司 Image rendering method, device, equipment and storage medium
CN113837955A (en) * 2021-08-17 2021-12-24 每平每屋(上海)科技有限公司 Image anti-aliasing processing method and electronic equipment

Also Published As

Publication number Publication date
CN108846815B (en) 2023-03-24

Similar Documents

Publication Publication Date Title
CN108846815A (en) Image antialiasing processing method, device and computer equipment
CN102591848B (en) Selection of foreground characteristics based on background
KR102307163B1 (en) Cross-platform rendering engine
US8878857B2 (en) Methods and apparatuses for expressing animation in a data stream
JP5242789B2 (en) Mapping of graphics instructions to related graphics data in performance analysis
US20070124691A1 (en) Dynamic reflective highlighting of a glass appearance window frame
US20100328321A1 (en) Graphics analysis techniques
DE112007002107T5 (en) Portable electronic device, method and graphical user interface for displaying structured electronic documents
US7532222B2 (en) Anti-aliasing content using opacity blending
CN103810728A (en) System, method, and computer program product for inputting modified coverage data into a pixel shader
CN112596843A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
US10140268B2 (en) Efficient browser composition for tiled-rendering graphics processing units
CN106468984A (en) A kind of method of item associations picture rapid preview and device
CN107885645A (en) Calculate method, apparatus and electronic equipment that the first screen of the page renders duration
US8624907B2 (en) Graphics analysis techniques
US20180143747A1 (en) User interface device and method for displaying screen of user interface device
CN111932689A (en) Three-dimensional object rapid selection method adopting ID pixel map
CN103345389B (en) The operational approach of a kind of vector graphics being applied to webpage and device
US9436372B2 (en) Method and apparatus indicating scroll position on a display
JP5242788B2 (en) Partition-based performance analysis for graphics imaging
Sidorov Strategies for frontend performance optimization using advanced web design techniques
CN115328768A (en) Browser debugging method, debugging device, electronic device and storage medium
KR20230032826A (en) Method for merging layer based on virtual z-thickness in multi-fragment rendering, apparatus and computer program for performing the method
CN117395434B (en) Hardware encoding and decoding debugging method, device, equipment and storage medium
CA2581233C (en) System and method of adapting sub-picture data for being displayed on mini-screens

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant