MIT researchers streamline coding for image processing

02.08.2012
Researchers at the Massachusetts Institute of Technology have figured out a way of helping developers more easily rearrange their image processing code so that it could execute faster and use fewer computational resources.

Such a technique could prove especially beneficial for mobile phones and other portable devices where battery power is at a premium. Users are growing ever more accustomed to running advanced photo manipulation apps like Instagram on their phones, so developers of these apps are struggling to make their creations as speedy as possible.

"I was looking for some easier way to write high performance code for mobile devices, but it turned out to be great for desktops as well," said Andrew Adams, a postdoctoral student at the MIT Computer Science and Artificial Intelligence Laboratory (CSAIL).

Adams, along with other researchers from MIT, Stanford University and Adobe, have developed a DSL (Domain Specific Language), and associated compiler, that creates a layer of abstraction that allows developers to easily move around chunks of code in order to find the most computationally efficient method of processing images.

The researchers have used the DSL, called , to rewrite several common image-processing functions. In many cases they were able to demonstrate two-, three-, or even six-fold increases in speed.

Typically, image processing involves multiple steps, some of which can be executed in a parallel in multicore processors. For developers, however, moving code around to find the optimal order of execution can be a complicated and error-prone process, given that with the imperative languages used today for image processing -- such as C++ -- the order in which a program executes tends to be "baked into the code," Adams said.