This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

A problem about IMG_quantize in IMGLIB

Hello,

When I see imglib manual for C64x , I found that the function IMG_quantize is using DCT coefficient to multiply the coefficient of quantization table, but I think it should use DCT coefficient to divide the coefficient of quantization table. How should I use this quantization function and how to choose a reasonable quantization table parameters q_pt (Q-point of quantization value)?

Thank you very much!

  • Thomas,

    The function IMG_quantize() quantizes matrices by multiplying their contents with a second matrix that contains reciprocals of the quantization terms so effectively it is using DCT coefficient to divide the coefficient of quantization table. Selection of Q point depends on how you want to handle precisions and overflows situations while doing fixed point multiplication. For Example, the result of fixed point multiplication could potentially have as many bits as the sum of the number of bits in the two operands. In order to fit the result into the same number of bits as the operands, the answer must be rounded and truncated. In this case, the choice of which bits to keep is very important. When multiplying two fixed point numbers with the same Q point format, for instance with I integer bits, and Q fractional bits, the answer could have up to 2I integer bits, and 2Q fractional bits. In such cases you should try to have a sufficiently large q point so that there is no loss of integer bits that can lead to large inaccuracies.

    A reasonable way for you to pick the q point would be to use test vectors that test the full range of data values that need to be quantized and see if the function is able to handle the quantiation with minimal loss of precision. I hope this explanation helps. Please look at the sample code in the examples directory for a reference implmentation.

    Good luck!!

    Regards,

    Rahul