Click here to Skip to main content
15,890,371 members
Home / Discussions / C#
   

C#

 
AnswerRe: 3 way byte merge Pin
Michael Kingsford Gray23-Sep-10 4:36
Michael Kingsford Gray23-Sep-10 4:36 
AnswerRe: 3 way byte merge Pin
patbob23-Sep-10 6:13
patbob23-Sep-10 6:13 
GeneralRe: 3 way byte merge Pin
jkohler23-Sep-10 7:40
jkohler23-Sep-10 7:40 
AnswerRe: 3 way byte merge Pin
englebart23-Sep-10 7:32
professionalenglebart23-Sep-10 7:32 
AnswerRe: 3 way byte merge Pin
JesperMadsen12323-Sep-10 8:32
JesperMadsen12323-Sep-10 8:32 
AnswerRe: 3 way byte merge Pin
starmerak23-Sep-10 20:47
starmerak23-Sep-10 20:47 
AnswerRe: 3 way byte merge Pin
oggenok6423-Sep-10 21:11
oggenok6423-Sep-10 21:11 
AnswerRe: 3 way byte merge Pin
englebart24-Sep-10 8:11
professionalenglebart24-Sep-10 8:11 
Another approach. Some of the other posts got this idea kicking...

Have one outer loop based on a block size that tries to optimize read and write cache sizes.
By working with a single color at a time you should optimize read hits.
A simple starting point of blocksize = 1 should be close to what you have now.
You are trading read cache hits for loop overhead. The correct block size might swing this in your favor.

loop totalsize/blocksize
output pointer = (set based on block size)
loop blocksize(red)
read one byte from red pointer (pointer += 1)
write one byte to output pointer (pointer +=3)
endloop blocksize(red)
output pointer = (set based on block size) + 1 offset to skip red
loop blocksize(green)
read one byte from green pointer (pointer += 1)
write one byte to output pointer (pointer +=3)
endloop blocksize(green)
output pointer = (set based on block size) + 2 offset to skip red and green
loop blocksize(blue)
read one byte from blue pointer (pointer += 1)
write one byte to output pointer (pointer +=3)
endloop blocksize(blue)


endloop totalsize/blocksize

Variations:
have the input pointers start at different offsets (thirds) within the blocksize
and wrap at the end. This will smooth write conflicts on the output pointer.
apply one thread per color - you would want these threads
to be preallocated and dedicated to the blit engine
AnswerRe: 3 way byte merge Pin
Tim Yen26-Sep-10 14:35
Tim Yen26-Sep-10 14:35 
QuestionInstalling low level mouse hook in background thread Pin
PrefinMafin22-Sep-10 3:10
PrefinMafin22-Sep-10 3:10 
AnswerRe: Installing low level mouse hook in background thread Pin
Luc Pattyn22-Sep-10 3:22
sitebuilderLuc Pattyn22-Sep-10 3:22 
GeneralRe: Installing low level mouse hook in background thread Pin
PrefinMafin22-Sep-10 3:47
PrefinMafin22-Sep-10 3:47 
QuestionHow to enable in old application icon for windows 7 taskbar Pin
Chesnokov Yuriy22-Sep-10 2:37
professionalChesnokov Yuriy22-Sep-10 2:37 
AnswerRe: How to enable in old application icon for windows 7 taskbar Pin
Eddy Vluggen22-Sep-10 8:47
professionalEddy Vluggen22-Sep-10 8:47 
GeneralRe: How to enable in old application icon for windows 7 taskbar Pin
Chesnokov Yuriy22-Sep-10 9:43
professionalChesnokov Yuriy22-Sep-10 9:43 
GeneralRe: How to enable in old application icon for windows 7 taskbar Pin
Eddy Vluggen22-Sep-10 10:03
professionalEddy Vluggen22-Sep-10 10:03 
GeneralRe: How to enable in old application icon for windows 7 taskbar Pin
Chesnokov Yuriy22-Sep-10 19:11
professionalChesnokov Yuriy22-Sep-10 19:11 
GeneralRe: How to enable in old application icon for windows 7 taskbar Pin
Eddy Vluggen23-Sep-10 11:51
professionalEddy Vluggen23-Sep-10 11:51 
GeneralRe: How to enable in old application icon for windows 7 taskbar Pin
Chesnokov Yuriy23-Sep-10 19:06
professionalChesnokov Yuriy23-Sep-10 19:06 
GeneralRe: How to enable in old application icon for windows 7 taskbar Pin
Eddy Vluggen23-Sep-10 20:34
professionalEddy Vluggen23-Sep-10 20:34 
GeneralRe: How to enable in old application icon for windows 7 taskbar Pin
Chesnokov Yuriy23-Sep-10 20:45
professionalChesnokov Yuriy23-Sep-10 20:45 
QuestionKeeping track of classes and namespaces Pin
Smon the Vidd22-Sep-10 2:33
Smon the Vidd22-Sep-10 2:33 
AnswerRe: Keeping track of classes and namespaces Pin
Luc Pattyn22-Sep-10 2:59
sitebuilderLuc Pattyn22-Sep-10 2:59 
AnswerRe: Keeping track of classes and namespaces Pin
T M Gray22-Sep-10 4:43
T M Gray22-Sep-10 4:43 
AnswerRe: Keeping track of classes and namespaces Pin
Abhinav S22-Sep-10 6:37
Abhinav S22-Sep-10 6:37 

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.