• Please review our updated Terms and Rules here

8088 corruption encoder... a new one

Mike Chambers

Veteran Member
Joined
Sep 2, 2006
Messages
2,621
Something I've been working on recently. I did that really terrible VB6 encoder that I posted here years ago, but this new one is in C and is light years beyond it. I actually based it off Trixter's lecture this time. ;) The quality is really close to his original encoder, which was unfortunately never released.

I used the ffmpeg libs for source input, so it can accept practically any video file format and turn it into a TMV file. It can use up to 12 processing threads to speed things up on a multicore system. It's not that fast, I get about 5 FPS on my overclocked core i7-4930k but it does a pretty good quality encode. Two screenshots of it's encode of the Tron disc scene, and one of the Enterprise from the Star Trek TNG intro:

tmvenc.png


ST:TNG intro... Youtube kind of hurts the quality a bit.

Or download it to play on your XT: http://rubbermallet.org/tngintro-tmv.zip :D

Download the encoder here if you want to play with it: http://rubbermallet.org/tmvenc-0.14.2.14.zip

It's a command line app. Run tmvenc.exe -h to print out usage info. Have fun!
 
This is great!

Have you thought of expanding this video format? I mean, using another modes besides 40x25, this should be really cool for encoding videos to 80x25 and get much more resolution video effect on fast XTs :D
 
You should post the whole TNG intro, that actually looks awesome, and maybe do the final battle from st6

Ooh, yeah... that battle might turn out well in TMV format, I'll have to try it. Hmm, I don't think I have a panned and scanned version of st6. Even my laserdisc of it is widescreen. I could try cropping it myself, but the original pan and scan would probably be best.


This is great!

Have you thought of expanding this video format? I mean, using another modes besides 40x25, this should be really cool for encoding videos to 80x25 and get much more resolution video effect on fast XTs :D

I was thinking that would be awesome, but the player is trixter's. I'd like to him add 80x25 support too. If he wants to do that, I'd definitely mod the encoder to support it! Or maybe I could make my own player for that if he doesn't.
 
I actually based it off Trixter's lecture this time. ;) The quality is really close to his original encoder, which was unfortunately never released.

...and never will, since your efforts are 90% of the way there and MUCH easier to use than the original encoder, which required a series of targa files.

This is great news and I'll update pages and blog about it soon when time permits.

Have you thought of expanding this video format? I mean, using another modes besides 40x25, this should be really cool for encoding videos to 80x25 and get much more resolution video effect on fast XTs :D

This was abandoned in the design phase because of the CGA "snow" effect that happens when you write directly to screen RAM in 80x25. On clone systems, such as PCjr, Tandy, etc., this "snow" does not occur, so it would definitely look better on those systems.

If Mike decides to enhance his encoder to support that, then I am happy to add more format types to the video file header and release a new 8088 player that supports it. It would also be fairly trivial to create an 80x"50" mode where each character row displays the first four scanlines, then the next row starts. It's not a true 80x50 mode as only the top halfs of characters are displayed, but it would allow more flexibility in choosing characters and the resulting picture would be clearer. I can code that into the player too and alter the number of available frame types...

...which I'll be doing soon anyway because I'm working on the sequel, this time in graphics mode ;-)
 
I'll at least do 80x25 mode. That would be great if you modded your player for it, I'm guessing that's extremely easy too. Just changing a few numbers. The old machines may have trouble with this data rate though, not so much because of the CPU but the throughput of the disks. Frame rates would likely have to be lower. I wonder if 24 FPS would be low enough to not need to rebuffer. I'll work on this tonight, and write a makeshift Windows player using SDL to play the output on until Trixter gets a chance to modify 8088flex. :)

8088flex: HD edition!
 
Last edited:
Provide me an example file and I'll update the player :)

The TMV file format has an actual header, believe it or not:

Code:
'TMAV'     - 4 bytes, header signature
samplerate - 2 bytes, word value, playback sample rate
chunksize  - 2 bytes, word value, audio chunk size per frame
compmethod - 1 byte, specifies the compression method (currently only 0)
charcols   - 1 byte, number of text chars across (currently always 40)
charrows   - 1 byte, number of text chars down (currently always 25)
features   - bitfield, reserved for special handling:


76543210
||||||||
|||||||+--(f_Padding) 
||||||+---(f_Stereo) If set, audio data is in stereo format (LRLR etc.)
|||||+----reserved
||||+-----reserved
|||+------reserved
||+-------reserved
|+--------reserved
+---------reserved

If you change the charcols value to 80 in your output, my player will know to switch to the right video mode.
 
...which I'll be doing soon anyway because I'm working on the sequel, this time in graphics mode ;-)
I assume you're not using the whole framebuffer for that :p? I seem to recall you saying there simply isn't enough bandwidth to do 30fps in graphics mode on the 8088.

And also- how about some love for the Hercules Graphics Card :D... we can agree to disagree but I feel Hercules 1bpp depth looks much nicer than CGA's 4-horrendously chosen colors (Cyan, Purple, Pink, White?! I'll pass)...
 
I assume you're not using the whole framebuffer for that :p? I seem to recall you saying there simply isn't enough bandwidth to do 30fps in graphics mode on the 8088.

The entire framebuffer is used and visible. That doesn't mean I'm updating the entire framebuffer @ 30fps, of course.

And also- how about some love for the Hercules Graphics Card :D... we can agree to disagree but I feel Hercules 1bpp depth looks much nicer than CGA's 4-horrendously chosen colors (Cyan, Purple, Pink, White?! I'll pass)...

What I'm working on should be possible to port to Hercules, although videos will need to be created specifically for Hercules and won't play on CGA. However, my dual-monitor setup seems to choke when setting a Hercules mode -- only 4K of the RAM displays, and the rest of the display is that same 4K repeated. If I remove my IBM CGA card (stock), then it works. There is 32K in the space between b000 and b800 so this shouldn't be happening; I blame my mono card, which is a clone. I have a true Hercules I can put in there when the time comes.

BTW, CGA has more than 4 bad colors... I can choose from a palette of 16 bad colors ;-) (and more, if I decide to support composite)
 
I'll at least do 80x25 mode. That would be great if you modded your player for it, I'm guessing that's extremely easy too. Just changing a few numbers. The old machines may have trouble with this data rate though, not so much because of the CPU but the throughput of the disks. Frame rates would likely have to be lower. I wonder if 24 FPS would be low enough to not need to rebuffer.

I tinkered with video modes last year with 8088 flex. I have a solution to the disk bandwidth problem of course, and actually the limiting factor is more the IBM CGA card which adds wait-states and so is very slow. REP MOVSW IIRC achieves only about 170KB/s. But it is possible to bypass both the CPU and memory and DMA transfer direct from disk to the CGA card, in which case the 160x100 mode is achievable at about 16 fps (that test was made without sound mind).
 
160x100 = 16K = ~15fps = 240KB/s which is what I get doing a REP MOVSW from system memory. I think the CGA wait states are the actual bottleneck, so trying to perform DMA directly from disk wouldn't have much benefit. I think the buffering from system RAM is more predictable (less jitter) anyway, but I certainly won't stop anyone from writing their own player.
 
The old machines may have trouble with this data rate though, not so much because of the CPU but the throughput of the disks. Frame rates would likely have to be lower. I wonder if 24 FPS would be low enough to not need to rebuffer.

80x25x24fps is still under the datarate of the 60fps "pop.tmv" example I have on the website, and pop.tmv plays with only one rebuffering pause (using a jj_pearce card that supports DMA). Even with a super-slow MFM drive, it should play for a good 10 seconds before rebuffering, so it's still worth trying.
 
Alright... I modded the encoder to support 80x25 mode. The difference when staring at a still frame doesn't seem like anything spectacular, but when seeing it in motion it's definitely a big improvement in clarity. Tron disc scene and TNG intro shown via YouTube below. Trixter, you can download them here if you wish you mod your 8088flex player:

http://rubbermallet.org/tron80.zip
http://rubbermallet.org/tng80.zip

I think the default YT quality mode on an embed is 360, so change it to 480 when you play for better quality.

 
Something doesn't seem quite right; a lot of stuff that should be matching linedrawing characters is matching alphanumeric instead. I remember when that was happening with earlier revisions of your encoder, it was because of a scaling bug or something, but I thought you fixed it. Did you touch a part of the code this time maybe you shouldn't have?

Here is the first frame of your trondisc as clipped from youtube, and here is the same frame output by my encoder hacked for 80x25:

YZqd6Qr.png
G1KGUq9.png


Stuff to consider in your output: The letters surrounding the yellow ring where it turns orange; the lines are not nearly as clean as they should be; the "three small lines" character showing up everywhere.
 
Back
Top