[FFmpeg-devel] [PATCH] Correction for Blackfin unscaled swscale

Måns Rullgård mans
Sat May 8 00:01:39 CEST 2010


Ronaldo Moura <ronaldo.moura at monity.com.br> writes:

> Hi everyone,
>
>   I found a problem in the Blackfin optimized function ff_bfin_uyvytoyv12,
> to convert video from packet 4:2:2 to planar 4:2:0 without rescaling.
>
>   The function just works correctly when srcStride  == 2*width.    For the
> cases where you have to skip some bytes in the end of a line and srcStride >
> 2*width ( for example to skip the ITU-T-655 horizontal blanking bytes),  the
> function ff_bfin_uyvytoyv12 doesn't work correctly.
>
>   The problem is caused because the pointers to odd or even srcLines  are
> incremented until position 2*width,  and then added to srcStride.  They
> should be incremented until srcStride and then added to srcStride again.
>
>   To fix the problem I've done the annexed patch, where every next line step
> adds srcStride + (srcStride - 2*width). I tested the function after the
> patch a now it is working correctly.
>
>   A similar correction was done to function ff_bfin_yuyvtoyv12 also.

Thanks for that.  Patch applied after trimming trailing whitespace.
Please avoid tabs and trailing whitespace in future patches.

Since you're working on Blackfin, perhaps you'd like to take a look at
the rest of the optimised code.  There are some functions there which
are disabled since they don't quite work, and I never had the time to
investigate why.

> Index: libswscale/bfin/internal_bfin.S
> ===================================================================
> --- libswscale/bfin/internal_bfin.S	(revision 31139)
> +++ libswscale/bfin/internal_bfin.S	(working copy)

[...]

> Index: libswscale/bfin/internal_bfin.S
> ===================================================================
> --- libswscale/bfin/internal_bfin.S	(revision 31139)
> +++ libswscale/bfin/internal_bfin.S	(working copy)

[...]

> Index: libswscale/bfin/internal_bfin.S
> ===================================================================
> --- libswscale/bfin/internal_bfin.S	(revision 31139)
> +++ libswscale/bfin/internal_bfin.S	(working copy)

Also, no need to file patches in triplicate.  We have photocopiers.

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



More information about the ffmpeg-devel mailing list