[Unichrome-devel] Re: [mythtv] [PATCH] xvmcvld picture quality

Terry Barnaby terry1 at beam.ltd.uk
Tue Sep 14 10:05:25 EDT 2004


Hi Ivor,

So are you saying that the MPEG stream can have two different formats
for the QMatrix data: zig_zag and alternate. (I'm not up on MPEG
but learning slowly ....).

As the MythTv assumes zig_zag format and sets up intra_matrix[] assuming
this format, what we need to do if the MPEG alternate bit is
set is:
	1. DeZigzag intra_matrix[]
	2. Apply the alternate conditioning.

So we get something like:
     for (i = 0; i < 64; i++){
     	if(s->alternate_scan)
		qmatrix.intra_quantiser_matrix[i] = 
s->intra_matrix[s->dsp.idct_permutation[ff_alternate_vertical_scan[de_zigzag[i]]]];
	else
	        qmatrix.intra_quantiser_matrix[i] = s->intra_matrix[s->dsp.idct_permutation[i]];
     }

Terry

Ivor Hewitt wrote:
> Terry Barnaby wrote:
> 
>> Some points from what I can see:
>> 1. The Default QMatrix is setup using:
>>     s->intra_matrix[s->dsp.idct_permutation[i]] = default_matrix[i];
>> 2. The QMatrix is setup from MPEG using:
>>     s->intra_matrix[s->dsp.idct_permutation[ff_zigzag_direct[i]]] = 
>> default_matrix[i];
>>     I assume the MPEG data streams QMATRIX is sent in a zigzag pattern ?
>>
>> It appears that MythTv sets separate scan tables (inter_scantable ?) 
>> for alternate
>> scan's for the various IDCT algorithems and that intra_matrix is 
>> unchanged.
>>
>> So I would have assumed we can set the viaXvMC using:
>>     qmatrix.intra_quantiser_matrix[i] = 
>> s->intra_matrix[s->dsp.idct_permutation[i]];
>> This seems to match Ivors last patch.
>> Does this make sense ?
> 
> 
> I think it still needs to choose between scan tables based on whether 
> it's alternate or zig-zag. I've worked up a new patch but I can't try it 
> out till tonight.
> 
>> Also I note that MythTv can and does set separate chroma qmatrixes if 
>> present
>> int the MPEG stream. If they are not present it appears to use
>> the standard qmatrix's in the MPEG stream for them.
>> I also note that the Via hardware decoder, from the datasheet has the 
>> ability
>> to set these Matrixes. Should we be doing this ??
> 
> 
> Absolutely. Although there was only ever code setting the first matrix 
> in the ddmpeg code. Wonder if the chipset actually supports it? :-)
> 
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
> 

-- 
Dr Terry Barnaby                     BEAM Ltd
Phone: +44 1454 324512               Northavon Business Center, Dean Rd
Fax:   +44 1454 313172               Yate, Bristol, BS37 5NH, UK
Email: terry at beam.ltd.uk             Web: www.beam.ltd.uk
BEAM for: Visually Impaired X-Terminals, Parallel Processing, Software
                       "Tandems are twice the fun !"


More information about the mythtv-dev mailing list