[XviD-devel] dark blocks in b-frames

suxen_drol suxen_drol at hotmail.com
Sat Feb 15 13:42:22 CET 2003


On Sat, 15 Feb 2003 02:52:01 +1030 Radek Czyz <radoslaw at syskin.cjb.net> wrote:

> First, I just used DC value after fdct. When I saw what's happening I
> also checked the values before fdct, to see if it's not fdct problem.
> 
> Take a look at this dark block:
> 
> block number 2 before fdct:
> 
> -2 -4 -1 -1 0 -4 -3 -3
> -2 -2 -1 1 0 -2 -3 -2 
> 1 -1 -2 -2 1 -3 -2 -2 
> -2 -1 -3 1 1 -2 -4 -2 
> -2 -1 -3 -3 -1 -3 -2 -4 
> -3 -3 -3 -3 -2 -2 -3 -3 
> -1 0 -1 -3 -1 0 1 -2 
> -3 -1 -1 -3 -3 0 0 -3 


looking through 'makurukurushike.avi,' it appears all the bframes use
quant=7, whilst i/pframes use quant=4.

if we take the above "input" matix, and pipe it through fdct we get:

	-14,  1, -3,  2,  1, -1, -1,  1,
	  0,  2, -3, -2,  5,  0,  0,  1,
	  1, -1,  0, -1, -2,  2,  1,  1,
	 -3, -1,  0,  0,  0,  0,  0,  1,
	 -2,  0, -1, -1,  0,  0,  0,  0,
	  2,  0,  0,  0,  1,  0,  0,  1,
	 -2,  0,  1,  0,  1,  0,  1,  1,
	  1,  1,  2,  1, -1,  0, -1,  2,

h263 inter quantization causes all coefficients to be divide by twice
the quantization paramet. so everything is divided by 14. 
the matrix after quantiztion becomes:

	 -1,  0,  0,  0,  0,  0,  0,  0,
	  0,  0,  0,  0,  0,  0,  0,  0,
	  0,  0,  0,  0,  0,  0,  0,  0,
	  0,  0,  0,  0,  0,  0,  0,  0,
	  0,  0,  0,  0,  0,  0,  0,  0,
	  0,  0,  0,  0,  0,  0,  0,  0,
	  0,  0,  0,  0,  0,  0,  0,  0,
	  0,  0,  0,  0,  0,  0,  0,  0,

now at dequantization, we multiply all the non-zero coefficients by 14
_and_ the add 13 (quant-1). the dequantized matrix then becomes:

	 -27, 0,  0,  0,  0,  0,  0,  0,
	  0,  0,  0,  0,  0,  0,  0,  0,
	  0,  0,  0,  0,  0,  0,  0,  0,
	  0,  0,  0,  0,  0,  0,  0,  0,
	  0,  0,  0,  0,  0,  0,  0,  0,
	  0,  0,  0,  0,  0,  0,  0,  0,
	  0,  0,  0,  0,  0,  0,  0,  0,
	  0,  0,  0,  0,  0,  0,  0,  0,

after inverse dct the matrix is a uniform -3:

	 -3, -3, -3, -3, -3, -3, -3, -3,
	 -3, -3, -3, -3, -3, -3, -3, -3,
	 -3, -3, -3, -3, -3, -3, -3, -3,
	 -3, -3, -3, -3, -3, -3, -3, -3,
	 -3, -3, -3, -3, -3, -3, -3, -3,
	 -3, -3, -3, -3, -3, -3, -3, -3,
	 -3, -3, -3, -3, -3, -3, -3, -3,
	 -3, -3, -3, -3, -3, -3, -3, -3,


as gruel has said, this probably isnt a bug, rather the effect of using
a mix or high quantizers for bframes. though iam curious why this only
happens for direct mode.

-- pete; life is like a box of ammo




More information about the XviD-devel mailing list