Experiment: msx1 1bit video player

Por samsaga2

Resident (62)

Imagen del samsaga2

20-03-2018, 18:10

I have converted a video to two colors, I have compressed it and I have put it in a rom. This simple video loop takes more than 200kb.

Download rom
Source code

Login sesión o register para postear comentarios

Por x-nen Aivalahostia

Paragon (1546)

Imagen del x-nen Aivalahostia

20-03-2018, 18:22

Wow!!! l looks great!! Congratulations for your work!!

Por ray2day

Paladin (743)

Imagen del ray2day

20-03-2018, 18:32

Nice easter bunny

Por santiontanon

Paragon (1809)

Imagen del santiontanon

20-03-2018, 18:42

Nice! Not sure if it would help, but taking a quick peek at the code, I see you encode each frame separately. One optimization could be to only encode the differences with respect to the previous frame (as is done in mpg, and other video encoding formats). Not sure how much would it help in this case, given that the video is very "pixelated", and thus almost every pixel changes at every frame. But worth a try Smile

Por DamnedAngel

Champion (266)

Imagen del DamnedAngel

20-03-2018, 18:48

Seems not to be working on WebMSX. Am I missing something?

Por PingPong

Enlighted (4140)

Imagen del PingPong

20-03-2018, 20:54

What abput so e optimization or unrolling to keep the frame rate as high possible,.?

Por NYYRIKKI

Enlighted (6067)

Imagen del NYYRIKKI

20-03-2018, 21:03

I think first and last frame are same... One of them should be removed.

Por samsaga2

Resident (62)

Imagen del samsaga2

21-03-2018, 12:19

santiontanon wrote:

Nice! Not sure if it would help, but taking a quick peek at the code, I see you encode each frame separately. One optimization could be to only encode the differences with respect to the previous frame (as is done in mpg, and other video encoding formats). Not sure how much would it help in this case, given that the video is very "pixelated", and thus almost every pixel changes at every frame. But worth a try Smile

It's only a test, it has no real utility. I could scratch some bytes transfering only the changing pixels from the previous frame but I prefer to maintain the code simple. Anyway, the videos takes too much space, with or without encoding differences.

DamnedAngel wrote:

Seems not to be working on WebMSX. Am I missing something?

I think WebMSX it's detecting wrongly the memory mapper of the cartridge.

PingPong wrote:

What abput so e optimization or unrolling to keep the frame rate as high possible,.?

There are three bottlenecks. The first is the uncompression routine, the second is the cpu->vdp transfer rate and the third is the video size (compression is mandatory). There is no much code to unroll and the uncompression routine it's small and well optimized (or so I think). I discarded using colors for those three reasons.

I've made a turbor version with double buffer and a new video. It works a lot better.
Download turbor version

Por syn

Prophet (2123)

Imagen del syn

21-03-2018, 12:27

looks very nice !

Por NYYRIKKI

Enlighted (6067)

Imagen del NYYRIKKI

21-03-2018, 15:42

samsaga2 wrote:

I've made a turbor version with double buffer and a new video. It works a lot better.
Download turbor version

Because MSX2 and up has so much VRAM, I suggest to use triple buffer because then you don't have to think or wait anything ever... Idea is this...

Main routine:
- Fill 1st VRAM buffer
- Ready page = 1
- Fill 2nd VRAM buffer
- Ready page = 2
- Fill 3rd VRAM buffer
- Ready page = 3
- goto first step

Interrupt handler:
- Visible page = Ready page
- RET

Por mohai

Paladin (1007)

Imagen del mohai

07-06-2018, 04:33

Nice experiment ! Smile
MSX1 version does not look very smooth.
Decompressing, filling VRAM and synchronizing should not be easy. Is there any way to use double buffer in MSX-1?
As the example is only 4 KB, maybe there is a way to make double buffering even in 16 Kb.
Any way to add sound?