📜 ⬆️ ⬇️

MLAA morphological smoothing algorithm for CPU

Intel has published a description of the morphological smoothing algorithm (MLAA) , which is designed to work in real time on the CPU ( demo, source code ).

As in the case of the graphics depixelization algorithm in games, which was discussed a couple of months ago on Habré , the Intel algorithm does not scale the image, but works with pixels in the original resolution. They are modified according to several simple rules that are shown in the diagram.


')
In short, the MLAA filter searches for L-, Z- and U-shaped borders of pixel groups, and then blurs the surrounding pixels to get smooth outlines.

Simplicity and performance at the source pixel level is the main advantage of MLAA. It does not require complex processing and work with the alpha channel, there are no resource-intensive processes at all. The filter works frame by frame with the already rendered image and its performance can be clearly calculated in advance. It does not depend on the complexity of the scene, so you can guarantee the absence of "freezes" at any time. On the test machine (see the graph below), the MLAA speed ranges from 4 ms per frame 1280 x 800 to 11 ms per frame 1920 x 1200, regardless of the complexity of the scene.

Perhaps this is generally the fastest method of smoothing, which can work almost in real time on large images without the help of the GPU. Intel positions MLAA as a competitor to MSAA (Multisample anti-aliasing), their performance is compared in the graph.


Intel Core i7-2820QM: Sandy Bridge, 4 cores, 8 2.3 GHz streams, GT2 graphics, 4 GB RAM, Windows 7 Ultimate 64-bit SP 1

The effectiveness of MLAA is visible in the following images: a frame from the Battlefield: Bad Company 2 game without anti-aliasing (first image) and with MLAA enabled (second image).





Here is an enlarged (500%) fragment of the first and second image.





An even more obvious example (thanks, oxitnik ).

via Hot Hardware , ExtremeTech , Intel

Source: https://habr.com/ru/post/124913/


All Articles