[FFmpeg-devel] port mplayer eq filter to libavfilter
Michael Niedermayer
michaelni
Tue Nov 30 01:27:36 CET 2010
On Fri, Nov 26, 2010 at 09:51:02AM -0500, Ronald S. Bultje wrote:
> Hi,
>
> On Fri, Nov 26, 2010 at 9:38 AM, William Yu <genwillyu at gmail.com> wrote:
> > 2010/11/25 Ronald S. Bultje <rsbultje at gmail.com> wrote:
> >> On Thu, Nov 25, 2010 at 4:27 AM, William Yu <genwillyu at gmail.com> wrote:
> >>> + ? ? ? ?for (i = w&7; i; i--) {
> >>> + ? ? ? ? ? ?pel = ((*line* contrast)>>12) + brightness;
> >>> + ? ? ? ? ? ?if (pel&768) pel = (-pel)>>31;
> >>> + ? ? ? ? ? ?*line++ = pel;
> >>> + ? ? ? ?}
> >>
> >> Please don't mix and match C and ASM, this takes about 10-20 lines in
> >> asm, if you want you can even compile it using gcc and directly copy
> >> it (see above, use FASTDIV also). That will prevent it from using eax
> >> and then the function gets faster.
> >
> > Can you tell why don't mix and match C and ASM. I think compiler's optimizer
> > can does better than my manual code except those MMX instruction.
>
> See doc/optimization.txt
>
> Short version: there is no guarantee that values are maintained
> between asm blocks or between looped calls to the same asm block,
> unless the loop itself is within asm. This is correct:
>
> asm("setup .. loop .. inner .. end loop");
>
> This is not:
>
> asm("setup"); for (..) { asm("inner"); }
this btw, reminds me of C-- (a language which was more or less C embeded in
x86 asm instead of asm in C, that was >10years ago)
Some of its syntax was actually quite nice compared to the syntax
nasm/yasm (not to mention gcc) use today
things like:
if(++eax>0){
mov ...
imul ...
}
IIRC
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101130/925ee31a/attachment.pgp>
More information about the ffmpeg-devel
mailing list