Click here to Skip to main content
15,887,267 members
Home / Discussions / Algorithms
   

Algorithms

 
QuestionHELP WITH BILINEAR INTERPOLATION??? Pin
rainasu27-Sep-09 12:27
rainasu27-Sep-09 12:27 
AnswerRe: HELP WITH BILINEAR INTERPOLATION??? Pin
Luc Pattyn27-Sep-09 13:27
sitebuilderLuc Pattyn27-Sep-09 13:27 
GeneralRe: HELP WITH BILINEAR INTERPOLATION??? Pin
rainasu27-Sep-09 13:38
rainasu27-Sep-09 13:38 
GeneralRe: HELP WITH BILINEAR INTERPOLATION??? Pin
Luc Pattyn27-Sep-09 14:06
sitebuilderLuc Pattyn27-Sep-09 14:06 
GeneralRe: HELP WITH BILINEAR INTERPOLATION??? Pin
thebeekeeper8-Oct-09 10:46
thebeekeeper8-Oct-09 10:46 
QuestionHelp with TEA decrypt Pin
jcoulson@hotmail.com24-Sep-09 22:27
jcoulson@hotmail.com24-Sep-09 22:27 
QuestionFast Image Processing - programming language to use Pin
Amarnath S20-Sep-09 20:58
professionalAmarnath S20-Sep-09 20:58 
AnswerRe: Fast Image Processing - programming language to use Pin
Alan Balkany21-Sep-09 5:01
Alan Balkany21-Sep-09 5:01 
All the .NET languages are slow. Despite the dubious claims by some people that they can be as fast as unmanaged code, .NET programs are usually sluggish. Managed code does JITing, boxing/unboxing, and run-time checking (e.g. bounds checking on array accesses) for example.

However, .NET programs are more reliable. Recently the same subsystem was implemented at my company in C# and unmanaged C++. The C++ code was faster but would regularly crash mysteriously. The C# code was solid.

The best approach is to write the bulk of your code in C#, but do the image processing in unmanaged C++. This gives you the reliability of managed code, and the speed of unmanaged code for the time-consuming repetitive tasks.

The fastest processing is in small C++ loops that fit entirely into the cache, with no contained branches. This allows out-of-order execution which speeds up processing.

Since a loop is a branch, which makes out-of-order execution difficult, you can process two or more cases inside your loop (instead of one) to do more processing before the branch. This is called "loop unrolling", and can speed up processing.

Processing the image from low addresses to high addresses minimizes memory accesses and makes use of the cache, which fills a 32 (or 64)-byte buffer (called a "cache line") with a single memory access (even one pixel). Subsequent memory accesses at addresses just above this DON'T access memory because the contents are already in the cache. This saves time by avoiding the need for the processor to wait for a memory access.

The Intel (and AMD) SSE and MMX extensions to the instruction set (http://en.wikipedia.org/wiki/Streaming_SIMD_Extensions[^]) allow the use of 128-bit registers which may allow you to do image-processing operations in parallel for more speed.
GeneralRe: Fast Image Processing - programming language to use Pin
Tim Craig21-Sep-09 18:14
Tim Craig21-Sep-09 18:14 
GeneralRe: Fast Image Processing - programming language to use Pin
Alan Balkany22-Sep-09 5:12
Alan Balkany22-Sep-09 5:12 
GeneralRe: Fast Image Processing - programming language to use Pin
harold aptroot22-Sep-09 5:20
harold aptroot22-Sep-09 5:20 
GeneralRe: Fast Image Processing - programming language to use Pin
Tim Craig22-Sep-09 13:00
Tim Craig22-Sep-09 13:00 
GeneralRe: Fast Image Processing - programming language to use Pin
Alan Balkany23-Sep-09 3:19
Alan Balkany23-Sep-09 3:19 
GeneralRe: Fast Image Processing - programming language to use Pin
Tim Craig23-Sep-09 8:53
Tim Craig23-Sep-09 8:53 
GeneralRe: Fast Image Processing - programming language to use [modified] Pin
Amarnath S21-Sep-09 19:15
professionalAmarnath S21-Sep-09 19:15 
GeneralRe: Fast Image Processing - programming language to use Pin
Alan Balkany22-Sep-09 5:15
Alan Balkany22-Sep-09 5:15 
GeneralRe: Fast Image Processing - programming language to use Pin
Luc Pattyn22-Sep-09 5:35
sitebuilderLuc Pattyn22-Sep-09 5:35 
GeneralRe: Fast Image Processing - programming language to use Pin
CPallini24-Sep-09 21:12
mveCPallini24-Sep-09 21:12 
GeneralRe: Fast Image Processing - programming language to use Pin
Nagy Vilmos24-Sep-09 21:46
professionalNagy Vilmos24-Sep-09 21:46 
GeneralRe: Fast Image Processing - programming language to use Pin
CPallini24-Sep-09 21:57
mveCPallini24-Sep-09 21:57 
GeneralRe: Fast Image Processing - programming language to use Pin
Luc Pattyn25-Sep-09 2:59
sitebuilderLuc Pattyn25-Sep-09 2:59 
GeneralRe: Fast Image Processing - programming language to use [modified] Pin
CPallini25-Sep-09 9:28
mveCPallini25-Sep-09 9:28 
AnswerRe: Fast Image Processing - programming language to use Pin
Chris Losinger24-Oct-09 10:50
professionalChris Losinger24-Oct-09 10:50 
AnswerRe: Fast Image Processing - programming language to use Pin
novice__geek30-Oct-09 0:13
novice__geek30-Oct-09 0:13 
GeneralPagerank and its mathematics: Explanation needed Pin
kentipsy20-Sep-09 8:24
kentipsy20-Sep-09 8:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.