Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 18th April 2004, 04:04   #1  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,268
Microsoft releases free optimizing C++ compiler

Quote:
http://msdn.microsoft.com/visualc/vctoolkit2003/

The same compiler that ships in VC.net 2003... for free!
(Snagged from Ars Technica)

After downloading the Windows platform SDK and adjusting the includes/lib environment variables, it seems to work fine at compiling AviSynth plug-ins. (When invoking cl.exe, don't forget the /LD switch to output a DLL, and keep in mind that the switches are case-sensitive.)
stickboy is offline   Reply With Quote
Old 18th April 2004, 07:41   #2  |  Link
Richard Berg
developer wannabe
 
Richard Berg's Avatar
 
Join Date: Nov 2001
Location: Brooklyn, NY
Posts: 1,212
Nice! (posted to the front page)
Richard Berg is offline   Reply With Quote
Old 18th April 2004, 10:18   #3  |  Link
avih
Capture, Deinterlace
 
avih's Avatar
 
Join Date: Feb 2002
Location: Right there
Posts: 1,947
these are indeed interesting news. you might want to follow this mozillazine thread for a discussion. it seems to be missing midl.exe (i think it can somehow be downloaded).

are they trying o fight mingw/cygwin?
__________________
E8400/P43, 4G, GTX260+, Win7-64.
Get Firefox. Get SmoothWheel Firefox extension.
avih is offline   Reply With Quote
Old 18th April 2004, 13:34   #4  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,293
Nice! Did anyone of you tried to compile AviSynth itself with this?
Wilbert is offline   Reply With Quote
Old 18th April 2004, 19:34   #5  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,268
Not yet... AFAICT there is no make utility included, and AviSynth also needs the VS6sp5 Processor Pack (but for that, I guess one can get the necessary files from masm32?).
stickboy is offline   Reply With Quote
Old 19th April 2004, 02:50   #6  |  Link
Kurosu
Registered User
 
Join Date: Sep 2002
Location: France
Posts: 422
Re: Microsoft releases free optimizing C++ compiler

Quote:
it seems to work fine at compiling AviSynth plug-ins
Just what I needed.

[edit]From "Optimization.doc":
Quote:
If you are sure you are building code for a computer that has SSE2 support, e.g. Pentium 4 or AMD Athlon machine, you can use the /arch:SSE2 option. This produces code that will not run on other chips, but is much faster, especially for routines with a lot of floating point arithmetic.
Since when Athlon (except 64) have SSE2 support, and since when SSE2 is for floating point operations !? Given /arch:SSE exists, I feel there quite some nonsense in this document...[/edit]

Last edited by Kurosu; 19th April 2004 at 03:04.
Kurosu is offline   Reply With Quote
Old 19th April 2004, 22:32   #7  |  Link
Sigmatador
Guest
 
Posts: n/a
does anyone have done a benchmark versus the intel compiler 8 ?


does it work with vc6sp5 ? (i don't want to use vc.net2k3 ^^)
  Reply With Quote
Old 20th April 2004, 00:46   #8  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,268
Quote:
Originally posted by Sigmatador
does it work with vc6sp5 ? (i don't want to use vc.net2k3 ^^)
If you had vc.net2k3, you'd already have the compiler

(Edit: Oh, right, you might have the non-optimizing version of the compiler. Oops.)

Anyhow, it works fine with VC6sp5; you just need to change the include/lib/bin directory settings and maybe adjust some of the compiler flags.

Last edited by stickboy; 20th April 2004 at 02:39.
stickboy is offline   Reply With Quote
Old 22nd April 2004, 01:08   #9  |  Link
Sigmatador
Guest
 
Posts: n/a
Quote:
Originally posted by stickboy
If you had vc.net2k3, you'd already have the compiler

(Edit: Oh, right, you might have the non-optimizing version of the compiler. Oops.)

Anyhow, it works fine with VC6sp5; you just need to change the include/lib/bin directory settings and maybe adjust some of the compiler flags.
yes, i *have* it, but i still dont like it.
anyway, the version of the vc.net2k3 seems to be lesser than the one in this vctoolkit2k3.

and yes it worked fine with the good old msvc6, but i still want to test versus ICL8 ^^;
  Reply With Quote
Old 24th April 2004, 00:27   #10  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
could someone please post the comamndline i have to use to make this compiler create myplugin.dll from myplugin.cpp?
thx
E-Male is offline   Reply With Quote
Old 24th April 2004, 01:58   #11  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,268
At a minimum, all you really need is:
Code:
cl.exe /LD myplugin.cpp
(assuming you have your include/lib environment variables set correctly.)

You probably will want to use some of the optimization flags too (/Ox is probably a good starting point).

Last edited by stickboy; 24th April 2004 at 02:01.
stickboy is offline   Reply With Quote
Old 24th April 2004, 02:03   #12  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
thx
E-Male is offline   Reply With Quote
Old 24th April 2004, 07:22   #13  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
i hope you don't mind my noobish questions here
but i get a bunch of errors when i try to compile the "invert" sample plug-in
i copied the whole list (just removed the path to shorten it a bit)
maybe someone can tell me what i missed
----------------------------
x:\..\WinNT.h(3874) : error C2146: syntax error : missing ';' before identifier 'ContextRecord'
x:\..\WinNT.h(3874) : error C2501: '_EXCEPTION_POINTERS::PCONTEXT' : missing storage-class or type specifiers
x:\..\WinNT.h(3874) : error C2501: '_EXCEPTION_POINTERS::ContextRecord' : missing storage-class or type specifiers
x:\..\WinNT.h(8260) : error C2065: 'PCONTEXT' : undeclared identifier
x:\..\WinNT.h(8261) : error C2146: syntax error : missing ')' before identifier 'ContextRecord'
x:\..\WinNT.h(8261) : warning C4229: anachronism used : modifiers on data are ignored
x:\..\WinNT.h(8261) : error C2182: 'RtlCaptureContext' : illegal use of type 'void'
x:\..\WinNT.h(8261) : error C2491: 'RtlCaptureContext' : definition of dllimport data not allowed
x:\..\WinNT.h(8261) : error C2059: syntax error : ')'
x:\..\WinBase.h(747) : error C2146: syntax error : missing ';' before identifier 'LPCONTEXT'
x:\..\WinBase.h(747) : error C2378: 'PCONTEXT' : redefinition; symbol cannot be overloaded with a typedef
x:\..\WinBase.h(747) : error C2501: 'LPCONTEXT' : missing storage-class or type specifiers
x:\..\WinBase.h(2904) : error C2061: syntax error : identifier 'LPCONTEXT'
x:\..\WinBase.h(2912) : error C2143: syntax error : missing ',' before '*'
----------------------------
E-Male is offline   Reply With Quote
Old 24th April 2004, 09:52   #14  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,268
If you mean the Invert sample code from avisynth.org, then you need to modify the #include lines to:
Code:
#include "windows.h" // add this
#include "avisynth.h"
Also, you'll need to rename your entry point from AvisynthPluginInit to AvisynthPluginInit2.

(I'll add these corrections to the avisynth.org page right now.)
stickboy is offline   Reply With Quote
Old 25th April 2004, 12:11   #15  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
added that line, now it works

i also found the needed change to make the old example work with avisynth 2.5 (just adding a "2")
E-Male is offline   Reply With Quote
Old 25th April 2004, 15:50   #16  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
txh again, i managed to compile my first usefull plug-in with it
it allows adding integers to the r, g & b value of each pixel
so you can for example give the picture a more "cold" look
i'm sure such a plug-in already exists, but for educational purpose it was really helpfull
i'll post it in an own thread after some improvement and code clean up
E-Male is offline   Reply With Quote
Old 28th April 2004, 14:13   #17  |  Link
Sigmatador
Guest
 
Posts: n/a
I've done a quick benchmark CL vs ICL vs GCC on a MD5 hash bruteforce.

CL 13.10.3052 /Ox /O2
ICL 8.0.040 /O3 /Qipo /Qunroll /QxK
GCC 3.3.1 -march=athlon-xp -O3 -ffast-math -malign-double -funroll-loops -pipe -fomit-frame-pointer -msse -mfpmath=sse,387

(if you know better optarg...)

ICL : ~8.6millions hashes/sec
GCC: ~8.3millions hashes/sec
CL : ~6.4millions hashes/sec

m$ rulez

edit: some errors.

Last edited by Sigmatador; 28th April 2004 at 16:57.
  Reply With Quote
Old 29th April 2004, 06:58   #18  |  Link
dandragonrage
Registered User
 
Join Date: Mar 2004
Posts: 14
-ffast-math is a little unfair.

Here are my CFLAGS: "-O3 -march=athlon-xp -mcpu=athlon-xp -mmmx -m3dnow -msse -fomit-frame-pointer -funroll-loops -fforce-addr -frerun-loop-opt -falign-functions=16 -falign-jumps=16 -falign-loops=16 -falign-labels=1 -finline-functions -pipe -mfpmath=sse,387 -fprefetch-loop-arrays -fmove-all-movables -ftracer -momit-leaf-frame-pointer"

If you wonder why I have march, mcpu, mmx, m3dnow and msse and all of the other redundant stuff, that is because some CFLAGS are stripped for some packages under Gentoo. march may be stripped but not mcpu, for example.


Edit to note that VS.net uses the same exact compiler. I have personally used it and can tell you that everything there is included. Also, from that page: "Microsoft C/C++ Optimizing Compiler and Linker. These are the same compiler and linker that ship with Visual Studio .NET 2003 Professional!"
__________________
XP box: A7N8X-Dx 1.04, Barton 2600+ @ 180FSB, 512MB Corsair XMS3500, Radeon 9500 Pro 128MB, 2xWD1200JD, Toshiba SD-M1612, Pioneer DVR-A05, Lite-On 24x10x40 CD-RW

Gentoo box: K7S5A, Palomino 2100+, 512MB PC133, GF256, WD800JB, Samsung 8x DVD-ROM

Last edited by dandragonrage; 29th April 2004 at 07:01.
dandragonrage is offline   Reply With Quote
Old 3rd May 2004, 20:05   #19  |  Link
Prettz
easily bamboozled user
 
Prettz's Avatar
 
Join Date: Sep 2002
Location: Atlanta
Posts: 373
Re: Re: Microsoft releases free optimizing C++ compiler

Quote:
Originally posted by Kurosu

Since when Athlon (except 64) have SSE2 support, and since when SSE2 is for floating point operations !? Given /arch:SSE exists, I feel there quite some nonsense in this document...
SSE and SSE2 have always been about floating point operations. SSE introduces the XMM registers and 32-bit floating point instructions to operate on them. SSE2 introduces 64-bit floating point instructions to operate on the XMM registers, as well as a ton of MMX-like integer instructions to operate on them.
Prettz is offline   Reply With Quote
Old 3rd May 2004, 22:13   #20  |  Link
Kurosu
Registered User
 
Join Date: Sep 2002
Location: France
Posts: 422
Re: Re: Re: Microsoft releases free optimizing C++ compiler

Quote:
Originally posted by Prettz
SSE and SSE2 have always been about floating point operations. SSE introduces the XMM registers and 32-bit floating point instructions to operate on them. SSE2 introduces 64-bit floating point instructions to operate on the XMM registers, as well as a ton of MMX-like integer instructions to operate on them.
True enough: I have never seen SSE2 code used for something else than integers, so I didn't know that 64-bits floating point instructions were added. I'm wrong on that one, as integer part of SSE2 is probably not the main use of the whole SSE2 instruction set.

But in the way it is written, I think it's false: non-64bits Athlons don't have SSE2. Not all Athlons have SSE (in fact, the float part of SSE, as the MMX part of 3DNow! is much alike iSSE).

So, in spite of it being irrelevant to the thread, I'm wondering what they are talking about, though I suspect they meant iSSE code.

@Sigmatador
I think -O7 is the highest hidden switch for optimization, although I don't know what it does. I'm siding with dandragonrage for the mcpu/march switches. The mmmx/m3dnow/msse switches never gave me any speed increase on a P4 Willamette and and Athlon Barton.

In addition, /O2 and /Ox seemed redundant to me for cl.exe. I'd suggest /Ox /Og /Ob2 /Oi /Ot /Oy /GT /G6 (or /G7, depends on your CPU) /Zp16

Last edited by Kurosu; 3rd May 2004 at 22:17.
Kurosu is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:37.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.