View Full Version : Compiling Xvid with DEVC++ (or DevCPP)
ciper
26th January 2003, 19:28
This is really a cool C/C++ (and other) IDE, based in gcc (now version 3.2).. it's not as bloated as VSC++. Has anyone managed to compile Xvid in this baby? If so what steps have you made?
Prettz
26th January 2003, 21:06
Aside from compiler-specific libraries that might or might not be included in your project, what's the difference in the actual compiled code? I mean, does it actually optimize better in general or come with more advanced CPU-specific intrinsics?
Koepi
26th January 2003, 21:16
Pretz,
no, it's none of that.
It's a GPLed compiler IDE. As such I'd prefer it for xvid too, but it produces slower code. And we're for FPS and not FPM, right? ;)
Regards
Koepi
JimiK
26th January 2003, 22:28
Not sure how it really works with DevC++. I know it's using MinGW, so I think you can access all MinGW commands via console (I've also DevC++, but I let it use the tools from my MinGW installation). If these commands are available, then you could simply use this batch:
cd .\xvidcore\build\generic\
mingw32-make -f Makefile.dj
cd ..\..\..\
cd .\vfw\bin\
mingw32-make -f Makefile.mingw
cd ..\..\
del *.o /s
Place the batch-file directly in your CVS folder. There should be the subfolders "xvidcore" and "vfw". Maybe your make command is not mingw32-make, but just make. You need three MFC-files that are not in CVS: afxres.h, afxres.rc and winres.h. Mfluder said that you could obtain this files legally from the linux "Wine" project. Maybe you can also find them somewhere else. I will not attach them because I think there is a reason they are not in CVS. If you got these files, copy them to .\vfw\src. Then run the batch, you will find the dll in .\vfw\bin.
Concerning speed, I can not totally agree with Koepi. I've got an AthlonXP and I made some speed comparisons against Koepi's builds (which are great by the way) and Koepis where only slightly faster (2-3%). So if you don't have a Intel processor, you should try to make a compile yourself (guess Koepi's should run quite fast on Intel PC's).
Best regards,
JimiK
easyfab
26th January 2003, 22:44
Originally posted by JimiK
Not sure how it really works with DevC++. I know it's using MinGW, so I think you can access all MinGW commands via console (I've also DevC++, but I let it use the tools from my MinGW installation). If these commands are available, then you could simply use this batch:
cd .\xvidcore\build\generic\
mingw32-make -f Makefile.dj
cd ..\..\..\
cd .\vfw\bin\
mingw32-make -f Makefile.mingw
cd ..\..\
del *.o /s
Place the batch-file directly in your CVS folder. There should be the subfolders "xvidcore" and "vfw". Maybe your make command is not mingw32-make, but just make. You need three MFC-files that are not in CVS: afxres.h, afxres.rc and winres.h. Mfluder said that you could obtain this files legally from the linux "Wine" project. Maybe you can also find them somewhere else. I will not attach them because I think there is a reason they are not in CVS. If you got these files, copy them to .\vfw\src. Then run the batch, you will find the dll in .\vfw\bin.
Concerning speed, I can not totally agree with Koepi. I've got an AthlonXP and I made some speed comparisons against Koepi's builds (which are great by the way) and Koepis where only slightly faster (2-3%). So if you don't have a Intel processor, you should try to make a compile yourself (guess Koepi's should run quite fast on Intel PC's).
Best regards,
JimiK
Do you change the makefile to enable :
CFLAGS += -march=athlon-xp -mcpu=athlon-xp
Because when i do this i have ~same speed as koepi builds .
ciper
27th January 2003, 11:50
@Jimik & easyfab..
Thanx a lot .. ;) Can't wait to try it after work ;) Guess i'll have a busy night today !!
JimiK
28th January 2003, 10:34
Just an update in case you didn't find out for yourselves. You have to edit "Makefile.dj" to get an optimal performance. I did another test an without these switches the build would be 30% slower than Koepis while with them it's really even. You should enable the following:
CFLAGS = -Wall -DARCH_X86
CFLAGS += -DBFRAMES -DBFRAMES_DEC #not sure if this one is still required
CFLAGS += -funroll-loops -ffast-math -fstrict-aliasing -fomit-frame-pointer
CFLAGS += -O3 #this one is essential an will give you the speed boost
CFLAGS += -march=athlon-xp -mcpu=athlon-xp #choose your CPU from the list
Now I still don't now if the oversize bug has been fixed in CVS (haven't checked it out yet), but if not, you can use the fix Foxer suggested in another thread. Edit "2pass.c": you will find a line "nns1.dd_v = stats->hlength;" and should replace it with "nns1.dd_v = 0;", then you'll hit the filesize in 2pass encoding.
Sincerly,
JimiK
ciper
30th January 2003, 01:15
Compiled everything ok .. but i think there are lacking some advanced features (for sure they can be activated at compile time) .. I tried to compile the directshow filter (converted the VC++ project with DEVCPP) .. but no luck .. again lacking some includes (maybe directx 8.1 SDK, just guessing)... for now the only one i seem to be lacking is "streams.h" ..
After the compile i just installed the codec right clicking in the xvid.inf and choosing install .. Vdub works with it beautifully .. but as it uses the vfw interface it should work like that anyway .. the other players that use directshow (including the damn windows preview panel from the filemanager) don't work saying that the dll is nowhere to be found .. (the windows panel crashes ;D )
last issue, but not related to compilation, i thing my directshow layer is messed up (winXP), when i install koepi build, the directshow filter comflicts with the divx one (go figure) .. that is, divx stops working, then, when installing divx again .. xvid stops working, and so on and so on .. ;) any idees to fix this thing?
cheers to all ;D
JimiK
30th January 2003, 15:03
I can't help you with that one, sorry. I never compile the DShow-filter, even though I have to admit I tried. But yes, from what I know you need the DirectX-SDK. I got SDK 7.0, but there is no streams.h in it. Maybe you need at least version 8.
Regarding your compatibility problem: have you ever tried to use ffdshow to playback your videos (xvid and divx)? If not you should definitely give it a try.
Best regards,
JimiK
ciper
30th January 2003, 15:54
I'm getting DX9 SDK .. so i'll give it a try...
Yes, i tried ffdshow (and it rocks btw), i installed the latest alpha (as the previous didn't work with b-frames), i guess those DirectShow problems started when i uninstalled it (i'm waiting for the next beta release, as i think that this latest alpha was kind slower than the previous version).
One more thing .. Got the latest xvid CVS and then imported the VC++ project (xvidcore) to DEVCPP with no problems .. i got the latest MinGW32 2.0 (http://www.mingw.org/) with gcc-3.2 (as the one bundled with devcpp was 2.95.3 and didn't support the mcpu=athlon-xp and march=athlon-xp flags). Copied Makefile.dj to Makefile.win (in the recent project root) and got some problems compiling the thing inside DEVCPP ..errors like "error making void * from <another type>".. had to solve those with casts .. i'm not at home, later i'll expose this more accurately. Other problem was not getting nasm to produce any objects (inside DevCpp), so there were problems with the linking in the end ..
It would be a good idea to produce a (working) project configuration for DevCpp and bundle that with the xvid source
cheers ;D
JimiK
17th March 2003, 11:48
Hi, has anyone, contributing or reading this thread, been able to compile XviD with MinGW? After GomGom (it was him, right?) changed the makefile under the generic folder, I can no longer compile the source. My problems are: I'm no C-Programmer, so I don't have much experience with makefiles. I'm running under Windows and have no "configure" tool. Is there still a way for MinGW under windows?
Best regards,
JimiK
mfluder
17th March 2003, 18:07
Hi JimiK,
Yes, there is a way. You'll need to download MSYS package from MinGW SourceForge page. It's similar to cygwin but it's designed specificly for MinGW so it's quite minimalistic. To be able to run configure script you'll also need automake, autoconf and libtool. All this is contained in another package called msysDTK (MSYS Developer Tool Kit) so you'll need to download that too.
Although, there is another way if you don't want to download all these packages. I can send you generated platform.inc file so you can compile it just with MinGW package.
But for me ever since the dev-api-3 brach merged to CVSHEAD and this new compiling system took place, I'm geting 10-15% slower builds than before. I'm using exactly the same CFLAGS that I was using before but they are slower. I tried million other things but it didn't help. So I'm now using Koepi's builds and he is also using simple IDCT which was the main reason for me to continue compiling my own builds. Also, he added that editbox for b-frames threshold which was not in CVS the last time I checked so it's another reason to use it. Believe me, just download Koepi's build and use it, you'll have one less thing to think about. Thanks Koepi :)
Regards,
mfluder
JimiK
17th March 2003, 21:14
Hi mfluder,
you're my hero. That's the second time you help me out with this.
I did not yet download the needed files, but I'll try then. Anyways, could you still append a version platform.inc to one of your posts (I think you would have to zip it to make it a valid attachment)? Still I'll keep on using Koepis builds. I did so before, it's just to be able to compile a working build on your own. It's fun to check out the CVS every day to see if there has been some progress (of course I can still check out CVS, but where is the point in doing that when you can't compile it?).
Sincerely,
JimiK
mfluder
18th March 2003, 02:16
I think it would be better if I send you this instead of attaching it to my post because you'll be the only one who will download it. Also, that way we will not have to bother moderators to approve the attachment because they are busy enough already. Private message me your email address and I'll send it to you.
cinghio
19th March 2003, 17:14
I would also like to receive an XviD source package for devcpp
Thanks
BR
pomate@mail.com
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.