[FFmpeg-devel] Indeo3 replacement, take 3

Maxim max_pole
Sun Nov 8 00:22:19 CET 2009


Michael Niedermayer schrieb:
> On Thu, Nov 05, 2009 at 10:50:46PM +0100, Maxim wrote:
> [...]
>   
>>> [...]
>>>   
>>>       
>>>> /**
>>>>  *  Requant a 8 pixel line by duplicating each even pixel as follows:
>>>>  *  ABCDEFGH -> AACCEEGG
>>>>  */
>>>> static inline uint64_t requant(uint64_t a) {
>>>> #if HAVE_BIGENDIAN
>>>>     a &= 0xFF00FF00FF00FF00;
>>>>     a |= a >> 8;
>>>> #else
>>>>     a &= 0x00FF00FF00FF00FF;
>>>>     a |= a << 8;
>>>> #endif
>>>>     return a;
>>>> }
>>>>     
>>>>         
>>> i would not call this operation re-quantization
>>>   
>>>       
>> Ok, what is it then?
>>     
>
> duplicating every second pixel
>   

You are surely right! I didn't really understood the meaning of this
operation! It ensures that every 2nd pixel of the prediction for a 8x8
block is the same as the 1st one. Those can vary in the case two
neighboring 4x4 blocks serve as prediction. Maybe it helps to avoid
overflows...
i'll rename it and add an appropriate explanation in the comment...

>
> [...]
>   
>>> [...]
>>>   
>>>       
>>>>         /* convert four pixels at once using softSIMD */
>>>>         for (x = 0; x < plane->width >> 2; x++)
>>>>             *dst32++ = (*src32++ & 0x7F7F7F7F) << 1;
>>>>     
>>>>         
>>> is the & needed, arent these bits 0 anyway?
>>>   
>>>       
>> See the question above with the "ref_block"...
>>     
>
> iam not sure if i understand you
> but for damaged files it really doesnt matter what value
> the least significant bits have
> but i may be misunderstaning you ...
>   

Ok, it actually plays no important role for the output. That "ensure the
MSB is always 0" should be integrated somewhere in the decoder and be
applied internally, because having pixels out of the 7bit range can lead
to overflows later (if the frame containing overflowing pixels will be
used as reference) and cause segfaults...
That's why I'll remove that mask...



More information about the ffmpeg-devel mailing list