Jpeg compressing.

I don't DCT on colors and don't quantise colors.
After I've done it - the picture became green.
And I have very bad quality of output picture. Maybe, I am doing
something wrong? But all formulas are correct. Hmmm... I don't
understand...