[FFmpeg-devel] Extend/optimize RGB to RGB conversions funcs into rgb2rgb.c

yann.lepetitcorps at free.fr yann.lepetitcorps at free.fr
Mon Sep 10 00:27:05 CEST 2012


I think that is a little more speed because of this :

-        dst[3 * i + 0] = src[4 * i + 2];
-        dst[3 * i + 1] = src[4 * i + 1];
-        dst[3 * i + 2] = src[4 * i + 0];

+        dst[0] = psrc[2];
+        dst[1] = psrc[1];
+        dst[2] = psrc[0];

=>  the copy is make with a "direct" adressing, cf. without multiplications or
additions into the [] array adressing
    (can the compilator handle automaticaly the * 3 multiplication for free ?)


@+
Yannoo

Selon Reimar Döffinger <Reimar.Doeffinger at gmx.de>:

> Hello,
>
> On 9 Sep 2012, at 23:00, yann.lepetitcorps at free.fr wrote:
> > Here is the .diff file about rgb32torgb24() and rgb24torgb32() funcs
> > modifications as generated by the command "git diff"
> >
> > => is it on the good format ?
>
> Yes, though git send-mail or similar (which includes a commit message) would
> be even better.
> Also, not top-posting would be appreciated.
> Though one thing I wonder is why exactly that is faster, and why your
> compiler can't figure out how to optimize it on its own.
> There is also a bit the issue that compared to NEON-optimizing the code this
> is rather a very minor optimization.
>
> >
> > Selon yann.lepetitcorps at free.fr:
> >
> >> I have make a check and computing the gain of my new version of
> rgb24to32()
> >> and
> >> rgb32to24() funcs with 8096 loops of 1024 rgb24->rgba32 and rgba32->rgba24
> >> conversions  :
> >>
> >> This isn't a BigEndian plateform
> >>
> >> Test original rgb24torgb32() func : 141 ms
> >> Test modified rgb24torgb32() func : 116 ms
> >> Test original rgb32torgb24() func : 121 ms
> >> Test modified rgb32torgb24() func : 93 ms
> >>
> >> rgb24to32() : original=141ms modified=116ms (25ms 21.55%)
> >>
> >> rgb32to24() : original=121ms modified=93ms (28ms 30.11%)
> >>
> >>
> >> => I make the modification into my local source tree and test to generate
> the
> >> .diff file with git :)
> >>
> >>
> >> @+
> >> Yannoo
> >>
> >> Selon yann.lepetitcorps at free.fr:
> >>
> >>> Thanks for your feedback,
> >>>
> >>> I have found a tuto about how to handle git branch/versions and patchs
> for
> >>> FFMPEG at
> >>> https://bitbucket.org/tran_c/ffmpeg/src/f139838d6473/doc/git-howto.txt
> >>>
> >>> => I begin to use the git/patchs way immediately :)
> >>>
> >>> I have see the #ifdef TEST / main() in a lot of files, where have I to
> >> locate
> >>> the #define TEST for to can directly use the test located in the main()
> >> entry
> >>> into the modified file ?
> >>>
> >>>
> >>> @+
> >>> Yannoo
> >>>
> >>> Selon Carl Eugen Hoyos <cehoyos at ag.or.at>:
> >>>
> >>>> <yann.lepetitcorps <at> free.fr> writes:
> >>>>
> >>>> [...]
> >>>>
> >>>> Please consider reading http://www.ffmpeg.org/developer.html -
> >>>> especially "Submitting patches".
> >>>> Alternatively, setup a git clone with your changes.
> >>>>
> >>>> Don't forget to add some performance tests results for
> >>>> patches that change performance critical functions.
> >>>>
> >>>> Carl Eugen
> >>>>
> >>>> _______________________________________________
> >>>> ffmpeg-devel mailing list
> >>>> ffmpeg-devel at ffmpeg.org
> >>>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >>>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >
> >
> > <rgba24t8rgba32.diff>
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>




More information about the ffmpeg-devel mailing list