Sign in to follow this  
JasonL220

jpeg loading maths

Recommended Posts

I have been read the jpeg compression standard from wotsit, but when i got to the maths i found it abit confusing, especially the E-like symbol. I have cover integration and differention in my math a-level, i think this uses and definate integral, but thats all i understand. Could you please clarify the maths for me, thanks.

Share this post


Link to post
Share on other sites
IIRC the E like symbol means summation.

So the bit on the first line between the [ and the * mean sum from x=0 to x=7 and sum from y=0 to y=7 f(x, y)

Or to put it another way:

for ( x = 0; x < 8; ++x )
for ( y = 0; y < 8; ++y )
sum += f( x, y );

I've never read the jpg specs so without context I have no idea what that math is supposed to do.

Share this post


Link to post
Share on other sites
The sigma is a symbol for summation. You can think of it like a 'for' loop. The first pair of sigmas in your example is sort of like the c++ nested loop:
for (int x = 0; x <=7; ++x) {
for (int y = 0; y <= 7; ++y) {
}
}
Although the equations you posted are recursive and somewhat complicated, once you understand what the sigma notation means it should be relatively straightforward to convert to code.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this