[FFmpeg-devel] [PATCH] Indeo 5 decoder

Alexander Strange astrange
Tue Feb 2 11:23:34 CET 2010


On Feb 1, 2010, at 12:49 PM, Kostya wrote:

> On Mon, Feb 01, 2010 at 02:38:33AM -0500, Alexander Strange wrote:
>> 
>> On Feb 1, 2010, at 2:17 AM, Kostya wrote:
>> 
>>> $subj
>>> <indeo5.patch>

>> p * 4 + i saves parens.
> 
> using shifts in such case is our tradition, no?

I tried it and gcc (4.2) converts n*4 to n<<2 even with no optimizations. Maybe it's different with larger scales.

>>> +            /* select dequant matrix according with plane and band number */
>> 
>> Same.
>> 
>>> +        band1 = &ctx->planes[1].bands[i];
>>> +        band2 = &ctx->planes[2].bands[i];
>>> +
>>> +        band2->width         = band1->width;
>>> +        band2->height        = band1->height;
>>> +        band2->mb_size       = band1->mb_size;
>>> +        band2->blk_size      = band1->blk_size;
>>> +        band2->is_halfpel    = band1->is_halfpel;
>>> +        band2->quant_mat     = band1->quant_mat;
>>> +        band2->scan          = band1->scan;
>>> +        band2->inv_transform = band1->inv_transform;
>>> +        band2->dc_transform  = band1->dc_transform;
>>> +        band2->is_2d_trans   = band1->is_2d_trans;
>> 
>> 
>> memcpy them?
> 
> no, they contain buffer pointers

I meant that IVIBandDesc could be reordered so that
memcpy(&band2->width, &band1->width, (char*)&band2->checksum - (char*)&band2->width);
would work instead of all the assignments (where checksum is the next member after is_2d_trans).
But it's actually pretty ugly, so probably not worth it.




More information about the ffmpeg-devel mailing list