confusions about qbits and quant coef matrix

Eric Miao <[email protected]> Tue, 15 Apr 2003 06:18:23 -0700 (PDT)
Newsgroups gmane.comp.video.h264.devel
Message-ID <[email protected]>
Hi,

In jvt-b038.doc, qbits = 17 + QP/6.
But I also noted that in some articles and jm6 ref
software, qbits = 15 + QP/6.
What is right?

And I also calculated quant coef matrix according to
equation: MF/qbits = PF/qstep.
My result is 
 a^2   (b^2)/4 (ab)/2
13107     5243     8290
11916     4766     7536
10082     4033     6377
 9362     3745     5921
 8192     3277     5181
 7282     2913     4605
But it is different from the one used in jm61
software,
mainly column 2 and column 3.
The following is used in jm61:
 a^2   (b^2)/4 (ab)/2
13107 5243 8066
11916 4660 7490
10082 4194 6554
 9362 3647 5825
 8192 3355 5243
 7282 2893 4559

Attached is a c file I used to calculate the matrix.
Can anyone point out any wrong in my implem?



__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com
calc_mf.c (text/plain, 678 B)
#include <stdio.h>
#include <math.h>

static double quantStep[6] =
{
    0.625,
    0.6875,
    0.8125,
    0.875,
    1.0,
    1.125
};

static double postScalingFactor[3];

int
main()
{
    double a, b;
    int i;

    a = 0.5;
    b = sqrt(0.4);

    postScalingFactor[0] = a * a;
    postScalingFactor[1] = (b * b) / 4;
    postScalingFactor[2] = (a * b) /2;

    for(i = 0; i < 6; i++)
    {
        printf("%8d %8d %8d\n",
               (int)((postScalingFactor[0] * 32768) / quantStep[i] + 0.5),
               (int)((postScalingFactor[1] * 32768) / quantStep[i] + 0.5),
               (int)((postScalingFactor[2] * 32768) / quantStep[i] + 0.5));
    }

    return 0;
}