Experiment: msx1 1bit video player

By samsaga2

Resident (44)

samsaga2's picture

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 or register to post comments

By x-nen Aivalahostia

Paladin (826)

x-nen Aivalahostia's picture

20-03-2018, 18:22

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

By ray2day

Champion (418)

ray2day's picture

20-03-2018, 18:32

Nice easter bunny

By santiontanon

Champion (505)

santiontanon's picture

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

By DamnedAngel

Resident (60)

DamnedAngel's picture

20-03-2018, 18:48

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

By PingPong

Prophet (3071)

PingPong's picture

20-03-2018, 20:54

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

By NYYRIKKI

Enlighted (4903)

NYYRIKKI's picture

20-03-2018, 21:03

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

By samsaga2

Resident (44)

samsaga2's picture

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

By syn

Paragon (1794)

syn's picture

21-03-2018, 12:27

looks very nice !

By NYYRIKKI

Enlighted (4903)

NYYRIKKI's picture

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

My MSX profile