[FFmpeg-devel] [PATCH] modification of the MMX H264 MC chroma functions to support RV40
Mathieu Velten
matmaul
Tue Dec 23 13:15:53 CET 2008
2008/12/23 Michael Niedermayer <michaelni at gmx.at>:
> On Tue, Dec 23, 2008 at 02:19:56AM +0100, Mathieu Velten wrote:
>> 2008/12/23 Michael Niedermayer <michaelni at gmx.at>:
>> > you are not doing ff_pw_tab[bias>>3], you are doing
>> > "*ff_pw_tab[bias] >>3"
>> >
>> in this case it is the same.
>
> yes both can be done by changing the table
>
> hint:
> %2 and 8+%2 can be then used to address both the original and
> the >>3 variant
Sorry I don't understand what you mean. Should I use an other table
(rv40_bias_div_8 for example) and pass the bias for the 1-dimensional
case in the function call too ?
or use a bigger rv40_bias table and use a shift to find the >>3
variant in the table ?
>> {
>> - const uint64_t *rnd_reg;
>> DECLARE_ALIGNED_8(uint64_t, AA);
>> DECLARE_ALIGNED_8(uint64_t, DD);
>> int i;
>> @@ -45,17 +44,16 @@
>> /* 1 dimensional filter only */
>> const int dxy = x ? 1 : stride;
>>
>> - rnd_reg = rnd ? &ff_pw_4 : &ff_pw_3;
>> -
>> __asm__ volatile(
>> "movd %0, %%mm5\n\t"
>> "movq %1, %%mm4\n\t"
>> - "movq %2, %%mm6\n\t" /* mm6 = rnd */
>> + "movq %2, %%mm6\n\t"
>> + "psrlw $3, %%mm6\n\t" /* mm6 = bias >> 3 */
>> "punpcklwd %%mm5, %%mm5\n\t"
>> "punpckldq %%mm5, %%mm5\n\t" /* mm5 = B = x */
>> "pxor %%mm7, %%mm7\n\t"
>> "psubw %%mm5, %%mm4\n\t" /* mm4 = A = 8-x */
>
>> - :: "rm"(x+y), "m"(ff_pw_8), "m"(*rnd_reg));
>> + :: "rm"(x+y), "m"(ff_pw_8), "m"(*bias_reg));
>>
>> for(i=0; i<h; i++) {
>> __asm__ volatile(
>
> this renaming is purely cosmetic -> does not belong in this patch,
> besides i dont see the sense in it.
before the patch rnd was a "boolean" and it decided bias value
according to the boolean.
now the bias is directly passed to the function.
Mathieu Velten
More information about the ffmpeg-devel
mailing list