## Recommended Posts

JasonL220    132
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 on other sites
Bezben    202
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 on other sites
jyk    2094
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 on other sites
JohnBolton    1372
It's very strange that you learned integration with encountering summation.

##### Share on other sites
JasonL220    132
well we have only just don integration so we my be going it soon.