Posted: Thu Jul 28, 2005 1:18 am Post subject:
VQA Encoder v0.4
Major news in this version is added support for old C&C and RA1 VQAs.
See the readme file for instructions.
Due to speed issues, I'm now providing two versions of the encoder, one for TS and one for C&C/RA1.
UGM2VQA handles both cases, however.
Another news is that I decided to drop the graphics version altogether. It wasn't of much use before and the text versions do more error checking anyway. They also have the ability to run in the background.
well as much as i cant do one for the RA1/TD VQP, it wont let me run RA1 or TD on my computer , but i trust your exellent work and take for note that it works. well done again QUICK_EDIT
Erm... Well, It worked and it all encoded with Old_Enc, but there are blips all over the screen. I'd guess its a palette error, but I don't know. Here's a picture of it.
Phew... That looks serious.
What game did you try it on? How many palettes did you calculate, did you read the readme file about the multiples of KEY in order for it to work correctly?
If you left the KEY value to 8 in the config, it means you could only generate a new palette every 8,16,24,32, etc. frames.
Does it appear all the time or just periodically?
I'd also need your compression settings to know more. QUICK_EDIT
Hmm...
I didn't try it in a game, I tried it in a couple of VQA players.
The first time I made the mistake of generating a different palette for each image, but then I tried again, applying a palette to all of the frames and reencoded it. Same thing happened.
I did read the readme file, but with one palette it should work.
It appears all the time apparently randomly. And the last frame is all noise.
The original video is uncompressed. _________________
Hm. Can you post the first few frames (preferably >16) of the sequence you used in a zip and tell me the BLOCKS and KEY settings so I can try to reconstruct the error? QUICK_EDIT
I can't but that's because I found the problem! You see, I batch-converted all the frames to use a palette in Photoshop. But, the problem was that when I switched them to index mode in my batch script, I forced them to use the colours in my palette, but it didn't use the same index each frame. I fixed this by adding in the extra step of loading the actual palette into the image. _________________ Last edited by DeathRay2K on Thu Jul 28, 2005 11:37 pm; edited 2 times in total QUICK_EDIT
Now you see why I recommended RAD Video Tools for the purpose
It's much easier to streamline the process and it generates the best palettes, too. Also, when calculating more than one palette, it automatically minimizes the change between the palettes you there's very little to none flicker when changing the palettes ingame. QUICK_EDIT
Joined: 24 May 2004 Location: Flanders (Be) Posts:300000001
Posted: Thu Jul 28, 2005 6:38 pm Post subject:
For RA1/C&C1, can this generate VQP files as well? They are apparently sets of palettes for the streched movies in the Win95 version of the game. _________________ Last edited by Nyerguds on Thu Jul 28, 2005 7:02 pm; edited 2 times in total QUICK_EDIT
Joined: 24 May 2004 Location: Flanders (Be) Posts:300000001
Posted: Thu Jul 28, 2005 7:04 pm Post subject:
Hmm... and has this been tested in both DOS C&C and C&C Gold?
Also, is there any option to add an audio stream? Or is that still in developement? I suppose the encoding is just WW's standard AUD format... _________________ QUICK_EDIT
Well, if you actually read the readme file, you'd find this bit:
UGM2VQA.EXE
~~~~~~~~~~
This little app basically multiplexes the encoded video stream with a WAV file (optional)
to produce the final VQA.
So in short: yes it supports audio...
I've tested a couple of VQAs in C&C Gold and they appear to work fine. I don't intend to do extensive checking in C&C for DOS or RA1, that's the sort of thing I expect from you, the end users... QUICK_EDIT
if anyone has one made for dos C&C you can pm it to me because i have a working copy of C&C Dos _________________ Life Sucks, Live It... or Not, IT;s Up To You QUICK_EDIT
I'd PM one to you, but you can't attach VQAs... _________________ Last edited by DeathRay2K on Fri Jul 29, 2005 6:37 pm; edited 1 time in total QUICK_EDIT
OK, it turns out that a certain quality "improvement" I made to the old VQA encoder wasn't an impovement at all
As it is it produces weird color artifacts, most noticeable on smooth color surfaces... I've fixed it and am providing the new version of OLD-ENC.EXE.
You can see the difference in the attached pic.
diff.png
Description:
Comparison between the old and new version of OLD VQA encoder.
8-bit VQA encoder works good, but I have some small "problem". It's resolution limit. Can you changi it? Or may be support twise sizes: 320x200 and 640x400?
hires_8bit_vqa_without_vqp.gif
Description:
RA1 Intro VQA is 640x400 and without VQP... I need to create my intro...
That's true, and the block size is also doubled. THe only VQA that <i>is</i>320x200 is the Sneak Peak video. The rest are 320x156, so 320x200 is a bit of an increase in quality. _________________
The only VQA in C&C/RA1 that is in a higher resolution of 640x400 is that very sequence Siberian Gremlin pointed out, the startup sequence for the Red Alert 95 version.
Each frame index array (uncompressed VPTZ chunk) of a VQA is (WIDTH/BLOCK_WIDTH)*(HEIGHT/BLOCK_HEIGHT)*2 bytes large. A limitation of format-80 compression (old VQAs use the unmodified, original version) says that the largest buffer that CAN be compressed is 64 kilobytes.
Now, if you plug in the numbers for the high res VQA and the normal block size you get 64000 bytes, an awful lot for a single frame (also pretty close to the max limit for format-80). That's the reason they chose to double the block height and get this size down to 32000 bytes. This is the only case blocks of 4x4 pixels are used in C&C/RA1. Other games like Lands of Lore 2 AFAIK also use the larger blocks.
My point is that I really don't want to create another case for the encoder which should allow 4x4 blocks, seeing there's only one place such a VQA will work (if you replace other movies with a high res version, the games crash, AFAIK).
It isn't a coding problem at all, it's just that I'd have to define a variable called BLOCK_HEIGHT in the code, right now I'm using a preprocessor macro that defines the block sizes. Using variables in tight loop bounds (and there's an immense number of loops performed in the encoder) imposes a speed penalty and it's the principal reason why I split the two types of encoder into different executables - the TS VQAs use 4x4 blocks, old VQAs use 4x2 blocks.
As for heightening the resolution limit, I don't see a purpose to it, besides - allowing to do that and leaving the blocks to 4x2 would produce overwhelmingly large VQAs... QUICK_EDIT
I thought about it and realized encoding old VQAs is less demanding due to the very fact the images are smaller so the speed penalty also isn't great.
I've relaxed the resolution limits to 640x400 and the encoder automatically selects 4x4 blocks if video height is larger than 240 pixels.
This should also fix some color issues a bit (Deathray, try encoding that old sequence you had problems with, without fixing the palette indexes, I'm curious of the results)
I tried the sequence with the unfixed palettes, but with the same result. No matter though, I can't really think of anything to do with VQAs that this encoder doesn't do, except maybe play them, which is superfluous anyways. Excellent work Gordan! The only thing that I can think of that would make it more userfriendly is a frontend, which would just write to the configuration file and un the programs anyways. Not that hat's a request or anything. _________________
Joined: 24 May 2004 Location: Flanders (Be) Posts:300000001
Posted: Fri Jul 29, 2005 6:25 pm Post subject:
ugordan wrote:
Well, if you actually read the readme file, you'd find this bit:
UGM2VQA.EXE
~~~~~~~~~~
This little app basically multiplexes the encoded video stream with a WAV file (optional)
to produce the final VQA.
So in short: yes it supports audio...
Oww, sorry. I'm incredibly interested in this project.. it's like a dream coming true for C&C1 mod makers like me... but unfortunately I've had very very little time lately, so I didn't read through the entire readme file.
ugordan wrote:
I've tested a couple of VQAs in C&C Gold and they appear to work fine. I don't intend to do extensive checking in C&C for DOS or RA1, that's the sort of thing I expect from you, the end users...
I won't disappoint you
Banshee wrote:
Place your VQAs in a zip and attach the zip. VQAs are very big files.
I've noticed RAR usually compressed VQA much better than ZIP. _________________ QUICK_EDIT
Place your VQAs in a zip and attach the zip. VQAs are very big files.
Not necessarily, its very easy to make them quite small, just by lowering the quality. Since its just a test it doesn't need to look great. _________________
Well, zip is just the format. You can get really awesome zip compression, but some zip programs (Such as XP and Winzip) can't read them...
As you said though, back on topic. As far as I can tell there are only a couple things left that can possibly be added, those being a frontend and/or combination of the two programs. Although the frontend could be made to run both those programs in order anyways, so that wouldn't matter. Speed could be improved, but its already pretty good. This is awesome! _________________
VQA format was cracked a long time ago. The long delay has to do more with the fact that encoding a VQA is not the reverse of decoding it.
Even if someone were to release Tiberian Sun (or any game) source code, it would not make things easier.
One needs to sink his teeth into the realm of vector quantization before one can make an encoder like this.
I guess none of the guys who do modding were into VQ, if they were, they'd made something like this ages ago. I know I made my first working Red Alert VQA somewhere around 2000./2001. and it sort of collected dust since then, my machine at the time (486 DX2/66 ) was dreadfully slow and this was (and still is!) a tedious process so I just kinda gave up on it...
On a side note, we all keep saying encoder when we should be saying compressor, AFAIK the term encoding is used for a lossless process, and this obviously ain't... QUICK_EDIT
Here's an alpha version of a GUI for the encoders, it's NOT a final release version!. This encodes to UGM, you still need UGM2VQA, though I'm planning of linking the two into one program.
You don't need Old-enc.exe or Hi-enc.exe, however.
You can select an image sequence or an avi file for input.
If you choose image sequence, pick any image from it and it will recognize it. You'll need to set the frame number and frame rate manually, though.
If you select an avi file, you'll be limited to the HiColor encoder only, due to reasons I mentioned a while earlier.
This is an early and experimental release and I expect crashes and bugs. When you encounter one, I'd like to know exactly what you did to provoke the crash...
Put the exe file in the folder of the older encoder as it needs alleg40.dll (either that or put the dll in the windows/system dir).
lol ok, it was me , but i just encoded that huge AVI fine and it works and plays normal, one thing i have to ask tho, is it possible to set a resolution becasue my movie was 640x400 and it took it down to a smaller size, i think 320x200. QUICK_EDIT
Joined: 24 May 2004 Location: Flanders (Be) Posts:300000001
Posted: Sun Jul 31, 2005 9:19 am Post subject:
Hmm... I tried this a couple of times, and my C&C always crashes on the result... after playing the movie in pretty nasty colours.
Also, is it normal the VQP file is 4 times the size of the VQA?! In C&C that was never the case.
What's more is that all frames I used for the movie (459 of 'em) had the same color palette...
[edit]
Another thing... when watching the movie in C&C95, the blank lines between each row of pixels (you know, the streching thing) were purple instead of black...
This is most probably because that purple is the first color on the frames' color palette... Can't you make sure that that color is always black? _________________ QUICK_EDIT
Can you PM me a few frames of your input sequence so I can test this myself? Are you sure you saved the images palettized, purple sounds an awful lot like truecolor images...
I don't plan on making any modifications of the input palettes in the program, that's why I recomended those color settings for RAD Video Tools in the readme file, "To begin at" 1 guarantees color 0 will be black.
VQP's can get large when there's a large number of palettes in the corresponding VQA, each paletet adds another 32896 bytes. An all time record for VQP size is held by I believe Lands of Lore 2 sneak peek from RA1, it changed palettes almost with every scene. OTOH, its VQP is definitely >1MB... QUICK_EDIT
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum