This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Scaling an Image to Half-Res


Scaling an Image to Half-Res

Postby drgoldie » Dec 12, 2004 @ 11:24am

drgoldie
pm Member
 
Posts: 330
Joined: Jan 10, 2003 @ 10:46am
Location: Vienna


Postby Kak » Dec 12, 2004 @ 11:53am

User avatar
Kak
pm Member
 
Posts: 291
Joined: Jul 26, 2003 @ 12:24pm
Location: Zannarkand, Spira


Postby drgoldie » Dec 12, 2004 @ 11:59am

drgoldie
pm Member
 
Posts: 330
Joined: Jan 10, 2003 @ 10:46am
Location: Vienna


Postby Tala » Dec 12, 2004 @ 1:44pm

I think your routine is optimal and Kaks suggestions should not help.

Lets look what the compiler is doing with the inner loop:

|$L28333|
ldr r0, [r2], #4
//the compiler is filling the delay slot(s) by moving the x -= 4; to here
sub r4, r4, #4
cmp r4, #0
ldr r1, [r2], #4
//again the compiler fills delay slots with &, this makes the & basically free
//also note, that the constant is already in R5
and r0, r0, r5
orr r1, r0, r1, lsl #16
str r1, [r3], #4
bhi |$L28333|


As far as the cache is concerned, it wont help you here, since you are only reading and writing data. Caching only helps if you read data in one iteration to be used in other iterations, which is not the case here.
With other words, compilers are pretty clever these days. Even with asm you wont get any faster.

Tala
Tala
pm Member
 
Posts: 125
Joined: Feb 6, 2004 @ 4:32pm


Postby drgoldie » Dec 12, 2004 @ 1:57pm

drgoldie
pm Member
 
Posts: 330
Joined: Jan 10, 2003 @ 10:46am
Location: Vienna


Postby Tala » Dec 12, 2004 @ 2:18pm

Tala
pm Member
 
Posts: 125
Joined: Feb 6, 2004 @ 4:32pm


Postby drgoldie » Dec 12, 2004 @ 2:28pm

drgoldie
pm Member
 
Posts: 330
Joined: Jan 10, 2003 @ 10:46am
Location: Vienna


Postby Kak » Dec 12, 2004 @ 2:46pm

User avatar
Kak
pm Member
 
Posts: 291
Joined: Jul 26, 2003 @ 12:24pm
Location: Zannarkand, Spira


Postby StephC » Dec 12, 2004 @ 2:55pm

Stephane Cocquereaumont / Game Developer at <a href=http://int13.net>int13 production</a> (code monkey)
User avatar
StephC
pm Insider
 
Posts: 442
Joined: Jun 12, 2003 @ 10:41am
Location: Bordeaux - France


Postby Tala » Dec 12, 2004 @ 3:12pm

Tala
pm Member
 
Posts: 125
Joined: Feb 6, 2004 @ 4:32pm


Postby Dan East » Dec 13, 2004 @ 6:11am

User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby drgoldie » Dec 13, 2004 @ 5:37pm

drgoldie
pm Member
 
Posts: 330
Joined: Jan 10, 2003 @ 10:46am
Location: Vienna


Postby drgoldie » Dec 14, 2004 @ 3:29pm

drgoldie
pm Member
 
Posts: 330
Joined: Jan 10, 2003 @ 10:46am
Location: Vienna


Postby StephC » Dec 14, 2004 @ 6:21pm

Stephane Cocquereaumont / Game Developer at <a href=http://int13.net>int13 production</a> (code monkey)
User avatar
StephC
pm Insider
 
Posts: 442
Joined: Jun 12, 2003 @ 10:41am
Location: Bordeaux - France


Postby drgoldie » Dec 14, 2004 @ 6:28pm

drgoldie
pm Member
 
Posts: 330
Joined: Jan 10, 2003 @ 10:46am
Location: Vienna


Next

Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron