Re: Fastcode IDCT B&V 0.1.0



That is ok :)

DCT is hard to grasp at first. You can see the Coef[0] as the average of the
whole block, multiplied by 8. So it is smallint range (max 8 * 255),
actually usually only 0 or positive values for this particular coefficient.

Coef[1] and Coef[2] are the horizontal slope and vertical slope of the
block, respectively (also multiplied by *some* factor). The rest are
higher/mixed frequencies (or higher degree slopes). To complicate matters,
there's also a zig-zag pattern applied, but the coefficients the IDCT gets
are already de-zigzagged.

Above is not entirely true, only if you first multiply the coefficients with
the quantization factors. For "small tables", as defined by Jpeg Baseline,
the maximum value of a quantization factor is 255. A Quantization factor of
1 means "no quantization".

Some libraries split the dequantization and IDCT step. But IJG has
integrated it to use the fast integer method, because by multiplying the
*quantization* factors again, one can gain a few multiplication steps, by
replacing them by additions.

Isn't that smart.. (and complicated!) :)

You have gotten my source code.. there's actually a routine in the
JpegMain.pas file, that does a "brute force" DCT and IDCT, so you can see
how it works.. it's an integration over the 8x8 block, with 4 loops. That
demo routine works with doubles, and you can see that doing a DCT followed
by IDCT gives practically your old results back, within some machine
precision (e.g. 1E-20).

Nils

"Dennis" <marianndkc@xxxxxxxxxxxxxxx> schreef in bericht
news:464768ea@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi Nils

Please be patient with me ;-) It takes me some time to understand the IDCT
well enough to make proper validation and benchmarking. I will take all
your
advice and implement it piece by piece as soon as I understand it. As we
go
I will probably ask many questions (intelligent or not ;-))

Best regards
Dennis Kjaer Christensen




.



Relevant Pages

  • Re: JPEG XR draft specification?
    ... HDR images can contain sharp transitions from low to extremely high luminance values, for example at the edges of light sources. ... Information about sharp edges is encoded into high-frequency DCT coefficients, ... The DCT is a linear transformation, which means that if I increase the precision of the input data by additional bits, the absolute error due to quantization ...
    (comp.compression)
  • I have a question
    ... I have a question about how to use of the DCT II and DCT III ... I want to get the transform of the follow IDCT matrix F ... But, when I using the FFTW package, the document of FFTW in section ... only states the 1D IDCT formula. ...
    (sci.image.processing)
  • Re: Fastcode IDCT B&V 0.7.0
    ... The IDCT function should be plugable into any framework. ... We need some reference datasets; 8x8 Coefficients/Quantizations/Samples ... We need to discuss some validation functions - most importantly the ... Should the Fastcode IDCT work with prescaled quantization constants? ...
    (borland.public.delphi.language.basm)
  • Re: jpeg worst case scenario?
    ... the inverse DCT on that. ... I believe uses RLE to compress identical values ... whose DCT output, after quantization, contains 64 different values. ... This will prevent any RLE compression, and will cause maximum work for ...
    (comp.compression)
  • reciprocals for quantization
    ... I'm building a quantization table to use with the IMG_quantize function ... on a TI DSP to quantize the DCT of an image. ... The first problem I found is that using the "optimal" reciprocal leads ... I think I could find a reciprocal that automatically rounds down, ...
    (comp.dsp)