[FFmpeg-devel] [PATCH] avfilter/vf_threshold: add x86 SIMD

Paul B Mahol onemda at gmail.com
Fri Dec 1 22:09:04 EET 2017


On 12/1/17, Martin Vignali <martin.vignali at gmail.com> wrote:
> Hello,
>
> +
>> +INIT_XMM sse4
>>
> Maybe use a macro (AVX2 can probably, be easy to add)

Not now.

>
>
>> +cglobal threshold8, 10, 13, 5, in, threshold, min, max, out, ilinesize,
>> tlinesize, flinesize, slinesize, olinesize, w, h, x
>> +    mov         wd, dword wm
>> +    mov         hd, dword hm
>>
> Maybe you can use ptrdiff_t for w and h, so you can directly use it, using
> wq, hq

Feel free to change that later.

>
>
>> +    mova        m4, [pb_128]
>> +    add        inq, wq
>> +    add thresholdq, wq
>> +    add       minq, wq
>> +    add       maxq, wq
>> +    add       outq, wq
>> +    neg         wq
>> +.nextrow:
>> +    mov         xq, wq
>> +
>> +    .loop:
>> +        movu            m1, [inq + xq]
>> +        movu            m0, [thresholdq + xq]
>> +        movu            m2, [minq + xq]
>> +        movu            m3, [maxq + xq]
>> +        pxor            m0, m4
>> +        pxor            m1, m4
>>
> Do you need pxor m0, m4 and pxor m1, m4 ?

Yes,
    I need it.
>
>
>> +        pcmpgtb         m0, m1
>> +        pblendvb        m3, m2, m0
>> +        movu   [outq + xq], m3
>> +        add             xq, mmsize
>> +    jl .loop
>> +
>> +    add          inq, ilinesizeq
>> +    add   thresholdq, tlinesizeq
>> +    add         minq, flinesizeq
>> +    add         maxq, slinesizeq
>> +    add         outq, olinesizeq
>> +    sub         hd, 1
>> +    jg .nextrow
>> +RET
>>
>
>
> Martin
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list