[XviD-devel] I/P/B frame decision

Radoslaw 'sysKin' Czyz xvid-devel@xvid.org
Sun, 29 Sep 2002 20:05:51 +0930


> if i understand well, the best if we have dynamic bframes is :
> scenechange : Iframe
> fast motion : Pframe
> slow motion : Bframe

> right ??

My answer is: I have no idea. ;-)
But my reasoning was as follows: if we have mostly motion, we use B
frame; if we have new texture, we use P frame.
That's what my P/B decision is suppesed to do, more or less - it adds
up all SADs found by ME, and adds very little of motion vector costs
(which is made by assuming quant 2 in calc_delta_16).

But I'll repeat: I have no idea if this is correct.

> so i've created a little motion detector, who's very fast, easy for SIMD,
> and quite good (less noise/alignement sensitivity than a image_mad)

> if i want to test it, i only need to replace "image_mad()>30"
> by my decision, right ??

Could you make it in a similar way I did it? I made it this way:
int mode; // somewhere at the beginning, of course

instead of "image_mad()>30": "2 == (mode = function() ) - that's for I
frame detection

And then in place of P/B decision:
    } else if (pEnc->bframenum_tail >= pEnc->mbParam.max_bframes) {
do
    } else if (pEnc->bframenum_tail >= pEnc->mbParam.max_bframes || mode != 0) {

So the function should return 2 for I, 1 for P and 0 for B.
I don't know if it's the best, but it works so you can replace it with
your code easly.

> BTW, i can't test SysKin MEanalysis based detection, because it breaks Bframes.

Could you explain how it brakes them? What happens when you set
max_bframes to 0?
Also, what happens when you make my MEanalysis return either 2 or 0?
or what happens when you make it only return 0?

Regards,
Radek