[XviD-devel] dark blocks in b-frames. some resonable answers, finally

Radek Czyz radoslaw at syskin.cjb.net
Sat Feb 15 20:32:54 CET 2003


Hello everyne,,

Christoph wrote

> And there are no such blocks with potive values? DC==+14 quantized to +1 ?

and I follwed the idea of statistical approach versus 'what's wrong
with this particular macroblock' approach.

Finally, I have some useful results.

I my experiment, I was counting the blocks which look suspicious.
In particular, I was counting:
 - DC == -1 ; sum == 1 ('dark block' maybe)
 - DC == 1 ; sum == 1 ('white block', unspotted as a bug)

Test was reasonably long, halfpel + motion precision 4. Again Pframe's
quant 4 and Bframe's quant 7.

First, forward mode results:
Total number of _coded_ forward-mode luma blocks: 115088
DC = -1, sum = 1 : 11307
DC = 1, sum = 1 : 8508

before I comment, backward mode:
total blocks : 124632
DC = -1, sum = 1 : 12081
DC = 1, sum = 1 : 9945

There is a slight bias towards negative DC. My hypotesis was: halfpel
interpolation uses rounding_control = 0, so the total compensated
image might indeed be a bit brighter - the formula is
      r1 + r2 + 1 - rounding; .

Further experiments confirm this - the values get swapped if I use
rounding control of 1.

So far, so good.

Let's check interpolate mode:

total coded blocks : 83683
DC = -1, sum = 1 : 9954
DC = 1, sum = 1 : 4897

The bias got bigger. Why? Because we interpolate two pictures and
_again_ round away from zero, towards white. MPEG4 sucks, how can we
round in the same direction twice?

Now, direct mode, the one which causes trouble:
total : 616349
DC -1 : 115687
DC +1 : 31955

Can you see the problem? Once again, we're rounding towards white
twice. This time however, motion compensation can't do nothing about
it - it's very limited, both reference pictures are interpolated with
the probability of 75% each, so there is 56% that they are both
interpolated and only 6% that none. And in the end, they are
interpolated together, again with rounding towards infinity.

And this is the problem.

I tried rounding of 1 for the interpolation - the picture was looking
better already, there both white blocks and dark blocks, both almost
invisible. And the filesize was smaller. However, this is not a
solution.

Please comment.

Radek



More information about the XviD-devel mailing list