[FFmpeg-devel] Concerning RV40 chroma MC functions

Måns Rullgård mans
Tue Nov 25 16:11:46 CET 2008


Michael Niedermayer wrote:
> On Tue, Nov 25, 2008 at 01:07:02PM +0200, Kostya wrote:
>> As you may know, RV40 chroma MC functions look a lot like H.264, they use
>> the same formula
>> dst[i] = (A*src[i] + B*src[i+1] + C*src[i+stride] + D*src[i+stride+1] +
>> bias)>>6
>>
>> the problem is that while A,B,C and D are calculated in the same manner,
>> bias value is constant for H.264 and varies for RV40:
>
>  0 16 32 16
> 32 28 32 28
>  0 32 16 32
> 32 28 32 28
>
>> Now the questions:
>> * how can one calculate that bias value?
>
> table
>
>> * what is the best way to incorporate those functions into lavc?
>
> the variant in your future patch after a few dozen rounds ;)
> no i really dont know
> if this can be merged in the h264 code with _NO_ performance loss then
> thats a good idea, if not id just write a naive and small C implementation
> and use h264 mc when flag fast is set

The H.264 functions can use a rounding shift instruction on ARM/NEON.
With bias != 32 separate add and shift instructions would have to be
used.  Not *much* slower but certainly a little.

>> * should RV40 designers burn in hell?
>
> yes

Agreed.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list