f



Writing DCT coefficients directly to JPEG file ?

Hi,

I have a question regarding writing the DCT coefficients direclty to a
JPEG file using the jpeg_write_coefficients() function.

After reading the jpeg DCT coefficients using jpeg_read_coefficients()
function. I changed all DCT coefficients with value '1' to '-1' prior
to writing it using the jpeg_write_coefficients(). This causes the
filesize of the output file to be different from the one of the input
file !!!!

I dont see any reason why this should happen , as both are in the same
category and use the same huffman code.
Can anybody suggest why this might be happening.

Even if somebody hasnt used any of the functions, logically could
there be any reason for filesize to change if all DCTs with a
particular value are replaced with their negative values.



Thanx in advance
VIkky
0
vikky999
7/2/2003 5:17:18 AM
comp.compression 4696 articles. 0 followers. Post Follow

1 Replies
1324 Views

Similar Articles

[PageSpeed] 2

Vikky:

[...]

>Even if somebody hasnt used any of the functions, logically could
>there be any reason for filesize to change if all DCTs with a
>particular value are replaced with their negative values.

Maybe there are a couple of existing -1 coefficients, and with those
new -1 coefficients the following run length encoding step can find
longer runs, which result in a somewhat smaller output file.

Regards,
Marco
0
Marco
7/2/2003 6:02:50 AM
Reply: