English Amiga Board


Go Back   English Amiga Board > Main > Amiga scene

 
 
Thread Tools
Old 14 July 2020, 10:08   #41
chiark
Needs a life

chiark's Avatar
 
Join Date: Jan 2008
Location: England
Posts: 1,657
True. But doing a lot of pre-processing will be the answer

@robinsonb5, exactly my thought: using the blitter to fill part of a rasterised image as that'd get us down to low memory usage at the expense of a lot of filling. Picking a complex frame and timing it would be a simple check - will have a look...
@stevelord, I think the tile approach was used by quite a few implementations and if I recall correctly it was the BBC Model B implementation that started me looking at that path... That's on github I think?
chiark is offline  
Old 14 July 2020, 11:43   #42
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 50
Posts: 2,800
Quote:
Originally Posted by Yannick View Post
I’m storing all points per frame, inter frame compression is very poor as only two consecutive identical frames are detected and optimized.
Detecting changes in between frames could bring improvements, but the algorithm to detect and encode point movements between frames is not trivial at all.
Do you have any statistics available for the vector matix?
Just to understand how many maximum lines per frame we are talking about.
I don't think blitter filling for the frame is a stumbling block, but the polydraw.

Furthermore, scaling (and ratio tranform) must be avoided.
You have to decide in advance the resolution (I would opt for one at 60Hz in order to render the frames from the originals at 30FPS, to avoid temporal artifacts).

By trying exclusively on AGA (I have some ideas about some overlay and dithering effects) you could also explore medres-interlace (well, maybe I'm aiming too high )
However, the format must be increased from 8x8 bit to 9x8 or 10x9 (depends on the choice of resolution).
Of course there will be an increase from 850Kb to >900Kb in the first case or >1000Kb in the second case but it is to be verified, given the different positioning of the bits the same compression ratio is not guaranteed, especially for the huffman part.
ross is offline  
Old 14 July 2020, 12:37   #43
robinsonb5
Registered User
 
Join Date: Mar 2012
Location: Norfolk, UK
Posts: 818
I've been tinkering with this a little this morning - I've picked a couple of busy-looking frames and done a horizontal edge-detect to find the boundaries for blitter fill.

I'm assuming here that we'd want to use a separate buffer for even and odd frames, and would blitter-fill into separate destination buffers, leaving the source unchanged. We can avoid clearing buffers by just overwriting what's changed since two frames previously.

So taking this random pair of frames, two frames apart in the animation, and finding the differences between them, the second one can be encoded as a series of 1637 word writes over the top of the first one. In a horribly inefficient text-based format, in which the first number is the number of words to skip and the second is the literal word to be written, the second frame looks like this:

Code:
02 0001
00 8000
42 0001
00 4000
12 0001
00 8000
27 0000
13 0000
13 0000
00 0000
5c 0000
4e 000c
07 0018
13 0028
13 0024
10 0000
02 0012
09 0000
06 0000
12 0000
00 0000
12 0000
00 0000
11 0000
02 0000
10 0000
02 0000
10 0000
01 0088
00 0000
10 0000
01 0402
00 0000
10 0000
01 4000
00 8000
10 0000
00 8000
01 1000
0c 0140
03 0001
02 0400
0c 0140
03 0002
13 0004
02 0080
00 0000
0f 0004
02 0080
00 0000
0f 0008
02 0040
00 0000
0f 0008
02 0040
00 0000
0f 0010
02 0020
00 0000
0f 0010
02 0010
00 0000
0b 0000
03 0010
02 0008
00 4800
0f 0010
03 0800
0f 0020
03 0400
0f 0020
03 0400
0f 0040
03 0400
0e 0000
00 0080
03 0400
0c 0c00
01 0000
00 0100
03 0400
08 0000
05 0000
00 0200
03 0400
08 0000
05 0000
00 0400
0c 0000
05 0000
00 1000
04 0000
07 0000
05 0000
00 1000
03 0800
00 0000
0d 0000
00 2000
03 0400
00 0000
0d 0000
00 2000
03 0400
00 0000
0d 0000
00 4000
03 0200
00 0000
0d 0000
00 4000
04 0000
09 0900
03 0000
00 8000
03 0040
00 0000
09 0480
03 0000
00 8000
03 0040
00 0000
09 0280
03 0000
00 8000
03 0040
00 0018
00 0000
00 0000
0b 0000
00 8000
03 0040
00 0028
00 0000
00 0000
0b 0000
00 8000
03 0040
00 0050
00 0000
00 0000
00 0000
0a 0000
00 8000
03 0040
00 0060
00 0000
00 0000
0b 0000
00 8000
03 0040
00 00c0
00 0000
00 0000
0b 0001
04 0040
00 0600
00 0000
00 6000
0b 0001
04 0020
00 078c
00 0000
00 a001
00 4000
0a 0000
00 8000
03 0020
00 0480
00 0001
00 2001
00 8000
0a 0000
00 4000
03 0020
00 0500
00 0001
00 4743
00 1800
09 0000
00 000a
00 8000
03 0026
00 5a18
00 0001
00 4746
00 0000
04 0000
04 0000
00 0010
04 002c
00 81c0
00 0001
00 478a
00 000c
04 0000
04 0000
00 0010
04 0038
00 4100
00 0002
00 8792
00 0000
04 0000
04 0000
00 0020
04 0010
00 4800
00 0004
00 8624
00 0090
09 0000
00 0100
04 0010
00 a000
00 0009
00 0350
00 0140
09 0000
00 0400
04 0006
00 4000
00 000a
00 0220
00 0900
09 0000
00 0800
04 0120
00 4000
00 0014
00 0440
00 4400
09 0000
00 1000
04 0120
00 8000
00 0014
00 0880
00 9000
09 0000
00 1000
04 0221
01 0014
00 2202
00 2000
08 0000
01 4000
04 0441
01 0022
00 8989
00 a000
01 3000
06 0000
00 0200
05 0442
01 004a
00 1404
00 6000
06 0004
00 2000
00 0000
00 0400
05 0482
01 0094
00 0080
00 0000
06 0002
00 0400
00 0000
00 1000
05 0482
01 0080
00 1000
00 0000
08 0000
00 2000
05 0881
00 0000
00 0082
01 0000
08 0000
00 2000
05 0881
00 0000
00 0108
00 0000
00 0000
00 0000
07 0000
00 4000
05 1042
00 0000
00 0110
00 0000
00 0050
08 0000
00 8000
05 1642
00 0000
00 0240
00 0000
00 30c0
08 0001
06 0e82
00 0005
00 0480
00 0000
00 3180
00 0000
07 0004
06 0c04
00 0006
00 0900
00 0000
00 5600
00 0000
07 0010
06 3608
00 000c
00 1201
00 81b0
00 8981
00 8000
07 0010
06 2e04
00 1418
00 2404
00 4007
00 0a80
07 0000
00 0020
06 4804
00 4830
00 4809
00 0007
00 0054
07 0000
00 0040
05 0000
00 5004
00 5050
00 50b4
00 00c8
00 4400
00 8000
06 0000
00 0100
05 0000
00 9002
00 a0a0
00 9090
00 0008
00 4725
00 5000
06 0000
00 0800
05 0000
00 9003
00 2221
00 2140
00 0008
00 4880
00 0000
06 0000
00 1000
05 0000
00 a000
00 245c
00 4280
00 0010
00 9340
00 0000
06 0000
00 2000
05 0001
00 2030
00 1a80
00 8600
00 0070
00 a800
00 0000
06 0000
00 4000
05 0001
00 4050
00 3000
00 9400
00 004b
00 9000
00 0000
06 0000
00 8000
05 0001
00 8000
00 0000
00 1000
00 004c
00 2000
00 a000
06 0002
06 0000
00 00a0
00 1400
00 4500
00 0058
00 8000
07 0002
07 00c0
00 2801
00 0500
00 0041
00 0000
00 0000
06 0002
07 0000
00 30a1
01 0040
00 8000
00 0180
06 0002
07 0050
00 6109
00 3000
00 0080
00 2000
00 0180
01 0000
04 0002
07 0110
00 a210
00 8000
00 008d
00 1040
00 3180
01 0000
04 0004
07 0222
00 429a
00 0000
00 0110
00 0440
00 3180
01 0000
04 0004
06 0000
00 0442
00 808c
00 0000
00 0120
00 0000
00 f180
01 0000
04 0008
06 0000
00 0509
00 0414
00 0000
00 0220
00 0000
00 1980
00 0000
00 0000
00 0000
03 0008
06 0000
00 0022
00 0814
00 0000
00 0440
00 0000
00 1980
00 0000
00 0300
00 0000
03 0004
06 0000
00 0042
00 100c
00 0000
00 1080
00 0000
00 6d80
00 0000
00 3000
00 0000
03 0004
06 000c
00 0088
00 100c
00 0000
00 2103
00 0060
00 6880
00 0000
00 2800
00 0000
03 0004
06 0009
00 0110
00 2009
00 0000
00 8412
00 00c0
00 6480
00 0000
00 5000
00 0000
03 0004
06 0009
00 0120
00 4012
00 00c2
00 0842
00 0180
00 5480
00 000c
00 a000
00 0000
03 0004
06 0008
00 8140
00 8074
00 6080
00 2102
00 0300
00 3500
00 018e
00 580a
04 0004
06 0009
00 0180
00 8025
00 8100
00 8801
00 0600
00 2c80
00 0284
00 800a
00 6000
03 0004
06 0005
00 0001
00 0027
02 2a14
00 1c40
00 0c1d
00 0026
00 8000
03 0004
06 0005
00 0002
00 0022
00 2021
00 4000
00 8054
00 1080
00 2836
00 0022
04 0004
06 0005
00 0004
00 0044
00 8080
01 0280
00 1080
00 603c
00 0542
04 0004
06 0003
00 0008
00 004a
00 0100
01 0060
00 1080
00 0044
00 2484
04 0004
06 0003
00 0008
00 0094
00 0400
01 0024
00 4103
00 0048
00 dc08
04 0004
06 0000
00 0010
00 0098
00 1000
01 0014
00 a90a
00 008b
00 1320
00 0000
03 0004
06 0000
00 0010
00 0080
00 2000
01 0011
00 0494
00 0096
00 1640
02 c000
01 0008
06 0000
00 0010
00 0100
00 4000
01 0083
00 48a4
00 0138
00 2c80
00 0000
03 0008
06 0000
00 0013
00 0201
02 0080
00 481a
00 0216
00 8200
00 0000
03 0008
07 0020
00 0804
02 0200
00 502a
00 0409
00 0400
00 0000
03 0008
07 0020
00 1010
02 0400
00 9046
00 08d2
00 0800
00 0300
03 0008
07 0020
00 4040
01 0000
00 206a
00 9086
00 11a8
00 1280
04 0004
07 0024
00 0080
01 0000
00 4231
00 a10f
00 2060
00 2318
00 2800
03 0002
07 0018
00 0100
01 0000
00 9061
00 0109
00 4000
00 3b01
00 2000
03 0004
07 0000
00 0400
00 0000
00 0002
00 4002
00 0104
00 000c
00 201b
04 0010
07 0000
00 0800
00 0000
00 0008
00 80c8
00 6104
00 0531
00 0018
04 0040
07 0000
00 2000
00 0000
00 0021
00 01a0
00 a10e
00 0052
00 0030
03 0000
00 0080
07 0000
00 4000
00 0001
00 4080
00 2208
00 221c
00 0144
00 0420
03 0000
00 0200
07 0000
00 8000
00 0008
00 0000
00 0040
00 1234
00 0290
00 0420
03 0000
00 0400
07 0001
01 0040
00 0008
00 4200
00 1258
00 0040
00 0840
03 0000
00 1000
09 0100
00 0020
00 2430
00 12a8
00 0080
00 8400
03 0000
00 2000
08 0000
00 0211
00 0200
00 2830
00 09d0
00 0208
00 2000
03 0000
00 4000
08 0000
00 0840
00 81c0
00 4861
00 8800
00 0305
00 2000
03 0000
00 8000
07 0000
00 4000
00 2080
00 8040
00 5060
00 8000
00 0100
00 b800
03 0002
09 4001
00 0101
00 1180
00 6060
00 8000
00 0080
00 9000
03 0004
09 4008
00 0b02
00 1110
00 a048
00 8000
00 0880
00 2000
03 0004
09 4040
00 1508
00 0021
00 2048
00 4000
00 4045
00 0400
03 0004
09 2080
00 1980
00 4122
00 2048
00 4000
00 8000
00 a880
03 0004
09 1200
00 0043
00 0099
00 0040
00 0001
01 9000
03 0004
09 1401
00 c000
00 00c9
00 0080
00 0004
05 0008
09 0010
00 c000
00 00d4
00 0400
00 0020
05 0008
09 0021
00 2060
00 00d8
00 1000
00 0100
05 0008
09 0040
00 a000
00 0050
00 4050
00 0800
05 0010
09 0040
00 9000
00 0050
00 8300
00 2000
05 0010
09 0080
00 50c0
00 0050
00 8900
00 4000
05 0020
09 0130
00 3180
00 5086
00 0a01
06 0020
09 0100
00 1980
00 4914
00 0004
06 0040
09 0100
00 0d80
00 0450
00 6020
06 0040
0a 0900
00 08c1
00 8080
06 0080
0a c500
00 1003
00 0200
06 0080
09 0100
00 5500
00 400c
00 0400
06 0080
09 0080
00 1100
00 8048
00 1000
06 0100
09 0080
00 0902
00 0210
00 2000
03 0000
02 0100
09 0080
00 0508
00 0810
00 8000
01 0000
01 0000
02 0200
0a 0340
00 2021
01 0000
00 0000
04 0200
09 0040
00 0200
00 8042
01 0000
00 0000
04 0200
09 0040
00 0401
00 0084
00 0001
00 0200
00 0000
04 0100
09 0040
00 1008
00 0108
00 0002
00 0100
00 0000
01 0060
02 0080
09 0040
00 4020
00 0410
00 0004
00 0080
00 0088
01 0060
02 0040
09 0021
00 0040
00 0840
00 0008
00 0080
00 0204
04 0040
09 0024
00 0040
00 1080
00 0008
00 0080
00 0802
04 0020
09 0000
00 0c20
00 2100
00 0008
00 0080
00 2002
04 0020
09 0000
00 2440
00 4200
00 0008
00 0040
00 2001
04 0020
09 0000
00 8280
00 8200
00 0008
00 0040
00 4000
00 8000
01 0000
01 0010
08 0000
00 0002
00 0481
00 0400
00 0008
00 0020
00 4000
00 8000
01 0000
00 0011
00 0010
08 0000
00 0008
00 04e2
00 0800
00 0004
00 0020
00 4000
00 4000
01 0000
00 0020
00 2010
09 0010
00 0884
00 1000
00 0004
00 0020
00 4000
00 2000
01 0000
00 0040
00 1010
09 0010
00 1090
00 1000
00 0004
00 0020
00 4000
00 2000
01 0000
00 0080
00 0808
09 0014
00 00a0
00 2000
00 0004
00 0040
00 2000
00 2000
01 0000
00 0080
00 0410
09 0000
00 0000
00 8000
00 0008
00 0080
00 0800
00 2000
01 0000
00 0200
00 0410
09 0008
00 0402
01 0008
00 0200
00 0400
00 2000
01 0000
00 0400
00 0410
09 0010
00 0804
01 0010
00 0400
00 0200
00 4000
01 0000
00 0200
00 0408
09 0010
00 1020
01 0010
00 1000
00 0100
00 8000
01 0000
00 0200
00 0404
09 0010
00 4080
01 0008
00 4000
00 0080
00 4000
01 0000
00 0100
00 0404
08 0000
00 0020
00 8200
00 00c0
00 0008
00 8000
00 0100
00 4000
01 0000
00 0080
00 0202
08 0000
00 0022
00 0800
00 0140
00 0022
00 0000
00 0100
00 2000
01 0000
00 0080
00 0102
08 0000
00 0028
00 1000
00 0240
00 0000
00 0000
00 0100
00 1000
01 0000
00 0080
00 0082
08 0000
00 0030
00 4000
00 0280
01 0000
00 0200
00 0800
01 0000
00 0040
00 0101
08 0000
01 8000
02 0000
00 0200
00 0800
01 0000
00 0020
00 0201
07 0000
00 0000
00 0001
00 3000
02 0000
00 0200
00 0400
01 0000
00 0040
00 0800
00 8000
06 0000
00 0028
01 0400
02 0000
00 0400
00 0400
01 0000
00 0080
00 7000
00 4000
06 0000
00 2828
00 0000
00 00b0
02 0000
00 0400
00 0200
01 0000
00 0100
00 2000
00 2000
07 8508
00 0000
00 4410
00 0000
01 0000
00 0400
00 0200
01 0000
00 0200
00 2000
00 1000
07 8010
00 0030
00 800c
00 0000
01 0000
00 0400
00 0100
01 0000
00 0200
00 2000
00 0400
06 0000
00 0810
00 0042
00 4002
00 8000
01 0000
00 0400
00 0080
01 0000
00 0400
00 2000
00 0200
06 0000
00 0220
00 0082
00 2000
02 0000
00 0400
00 0068
01 0000
00 0400
00 2000
00 0100
06 0088
00 0060
00 0084
00 1c00
02 0000
00 0400
00 0068
01 0000
00 0800
00 2000
00 0080
06 0201
00 0000
00 0080
00 a000
02 0000
00 0400
00 0010
01 0000
00 0800
00 1000
00 0040
06 0400
00 4000
00 0080
00 a000
02 0000
00 0200
00 0020
01 0000
00 0800
00 0800
00 0010
06 0800
00 0800
00 0100
00 9000
02 0000
00 0200
00 0040
01 0000
00 0800
00 1000
00 0004
06 0800
01 0100
00 e200
02 0000
00 0200
00 0040
01 0000
00 0800
00 0800
07 1000
00 0040
00 0100
00 fc00
02 0000
00 0100
00 5080
01 0000
00 0800
00 0800
01 0400
04 0000
00 1000
00 0040
00 0200
00 6000
02 0000
00 0100
00 0080
01 0000
00 1001
00 8800
01 00a8
04 0000
00 2000
00 0040
00 0200
03 0000
00 0200
00 0080
01 0000
01 0800
01 0004
04 0000
00 4000
00 0080
00 0200
03 0000
00 0200
00 0100
01 0000
00 8000
00 0800
01 0001
01 0000
00 0000
01 0000
00 8000
00 0080
00 0400
03 0000
00 0200
00 0100
01 0002
00 0000
00 0800
01 0000
00 8000
00 0000
00 1200
00 0000
00 0001
01 0080
00 0400
03 0000
00 0200
00 0100
01 0008
00 0000
00 0800
02 2000
00 0080
01 0002
00 0024
01 0080
00 0400
03 0000
00 0200
00 0080
01 0010
00 0000
00 1000
02 1000
00 0100
00 0008
00 0020
02 0080
00 0400
03 0000
00 0200
00 0040
01 0010
00 0000
00 1000
02 0811
00 0400
00 0001
00 0080
02 0080
00 0400
03 0000
00 0400
00 0010
01 0010
00 0000
00 1000
03 5000
04 0080
00 0400
03 0000
00 0400
00 050d
01 0040
00 0000
00 1000
08 0080
00 0200
03 0000
00 0400
00 0480
00 4000
00 0080
01 2000
08 0080
00 0200
03 0000
00 0800
00 0440
00 8000
00 0080
01 8000
08 0080
00 0200
03 0000
00 0800
00 0410
00 8000
00 0002
01 8000
08 0100
00 0200
03 0000
00 0800
00 0208
00 2000
00 0002
00 0001
09 0100
00 0200
03 0000
00 1000
00 0202
00 1000
00 0006
00 8001
09 0100
00 0200
03 0000
00 1000
00 0201
00 2000
00 0000
00 8001
09 0100
00 0200
03 0000
00 2000
00 0100
01 000c
00 8001
09 0200
00 0100
03 0000
00 2000
00 0100
01 0019
00 0001
09 0200
00 0100
03 0000
00 2000
00 0080
01 0031
00 0001
09 0400
00 0100
03 0000
00 2000
00 0080
01 0062
00 0002
09 0400
00 0100
03 0000
00 2000
00 0080
01 0002
00 0002
09 0800
00 0100
03 0000
00 2000
00 0040
01 0002
00 0002
09 1000
00 0080
03 0000
00 2000
00 0040
01 0001
00 0002
09 1000
00 0080
03 0000
00 2000
00 0020
01 0001
00 0002
09 2000
00 0080
03 0000
00 2000
00 0020
01 0001
00 0004
09 2000
00 0080
03 0000
00 1000
00 0020
01 0001
00 0004
09 2000
00 0080
03 0000
00 0800
00 0020
01 0001
00 0004
09 2000
00 0080
03 0000
00 0080
00 0020
01 0002
00 0004
09 2000
00 0080
04 0040
00 0040
01 0002
00 0004
08 0000
00 2000
00 0080
04 0040
00 1000
01 0002
00 0004
08 0000
00 2000
00 0080
04 0040
00 1000
01 0002
00 0008
08 0000
00 4000
00 0080
04 0040
00 1000
01 0002
00 0008
08 0000
00 4000
00 0080
04 0020
00 0800
01 0004
00 0008
08 0000
00 4000
00 0080
04 0020
00 0800
01 0004
00 0008
08 0000
00 4000
00 0080
04 0020
00 0400
01 0004
00 0004
08 0000
00 4000
00 0080
04 0020
00 0400
01 0004
00 0004
08 0000
00 4000
00 0080
04 0020
00 0400
01 0004
00 0004
08 0000
00 4000
00 0080
04 0020
00 0400
01 0008
00 0002
08 0000
00 4000
00 0100
04 0020
00 0400
01 0008
00 0001
08 0000
00 4000
00 0100
04 0010
00 0200
01 0008
01 8000
07 0000
00 4000
00 0100
04 0010
00 0200
01 0008
01 2000
07 0000
00 8000
00 0100
04 0010
00 0200
01 0008
01 1000
07 0000
00 8000
00 0100
04 0010
00 0200
01 0008
01 1000
07 0000
00 8000
00 0200
04 0010
00 0200
01 0008
00 0000
00 2000
07 0000
00 8000
00 0200
04 0010
00 0200
01 0008
00 0000
00 4000
07 0000
00 8000
00 0200
04 0010
00 0200
01 0008
00 0001
08 0000
00 8000
00 0200
04 0010
00 0200
01 0008
00 0002
08 0000
00 8000
00 0100
04 0010
00 0100
01 0008
00 0004
08 0000
00 8000
00 0100
04 0010
00 0100
01 0008
00 0004
08 0000
00 8000
00 0100
04 0010
00 010c
01 0008
00 9002
08 0000
00 8000
00 0100
04 0010
00 c241
Once encoded more efficiently, and converted to binary, that strikes me as something that will compress pretty well.
Attached Thumbnails
Click image for larger version

Name:	batest.jpg
Views:	97
Size:	34.9 KB
ID:	68136  
robinsonb5 is offline  
Old 14 July 2020, 14:08   #44
sovenyimre
Registered User

 
Join Date: Jul 2020
Location: Hungary
Posts: 14
I had the same 16x16 block (and a faster 32x32) idea and already did it in amos. It stores and refresh only the frame movements.
File size 4mb stored as tome map+12mb as icon (fixed for black or white background) tiles....+4mb audio.
Slow at present state but it is a work in progress.
I will also do a color mode and try to detect movement in pixel quantity to reduce size.

https://electricblacksheep.itch.io/bad-apple
sovenyimre is offline  
Old 14 July 2020, 14:21   #45
chiark
Needs a life

chiark's Avatar
 
Join Date: Jan 2008
Location: England
Posts: 1,657
Fantastic both @robinsonB5 and sovenyimre!

To fit on 6,600 frames on 2 floppies the target is around 256 bytes a frame... Loving the innovation that is going on here, and on other platform approaches too.

2020 is already the year Amiga got a bad apple implementation thanks to SteveLord, it looks like it'll get a few more!
chiark is offline  
Old 14 July 2020, 14:53   #46
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL
Posts: 1,692
Years ago i've experimented a bit with ffmpeg and potrace trying to create silhouettes video and later vectorize it - script below:

Code:
@setlocal
@if not exist %cd%\pot (mkdir %cd%\pot)
@rem for %%1 in (*.avi *.mp4 *.webm *.mkv *.mpg *.m2v) do (ffmpeg.exe -y -i "%%1" -an -vf hqdn3d=luma_spatial=16:chroma_spatial=16:luma_tmp=8:chroma_tmp=8,decimate=cycle=2,decimate=cycle=2,colorkey=color=0x00D800:similarity=0.5:blend=0.1,alphaextract,format=pix_fmts=monow,removegrain=m0=4 -vsync 0 "%cd%\bmp\%%~n1_%%06d.bmp")
@rem ffmpeg -i %1 -an -vf hqdn3d=luma_spatial=16:chroma_spatial=16:luma_tmp=8:chroma_tmp=8,decimate=cycle=2,decimate=cycle=2,format=pix_fmts=rgb24,colorkey=color=0x00D800:similarity=0.5:blend=0.1,alphaextract,format=pix_fmts=monow,removegrain=m0=4 -vsync 0 "%cd%\bmp\%~n1_%%06d.bmp"
@rem pause


@rem http://potrace.sourceforge.net/#downloading
@rem for %%1 in (*.bmp) do ("potrace.exe" -b pdf -P A4 -k 0.5 -o "%cd%\pot\%%~n1.pdf" "%%1")
@rem for %%1 in (*.bmp) do ("potrace.exe" -s --flat -k 0.5 --tight --longcurve --opttolerance 0.2 --alphamax 1 --turdsize 2 -o "%cd%\pot\%%~n1.svg" -- "%%1")
@for %%1 in (*.bmp) do ("potrace.exe" -s --flat -k 0.5 --tight --longcurve --opttolerance 5 --alphamax 5 --turdsize 5 -o "%cd%\pot\%%~n1.svg" -- "%%1")
@pause
To extract silhouettes some additional video processing may be required.

Above script should work with videos like: [ Show youtube player ] without any modification.
pandy71 is offline  
Old 14 July 2020, 14:54   #47
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 50
Posts: 2,800
Quote:
Originally Posted by robinsonb5 View Post
So taking this random pair of frames, two frames apart in the animation, and finding the differences between them, the second one can be encoded as a series of 1637 word writes over the top of the first one. In a horribly inefficient text-based format, in which the first number is the number of words to skip and the second is the literal word to be written, the second frame looks like this:
Probably this is really an intense frame but 1600 words are too much.
Even if the average is 800 and pack it at 1/3 you have a requirement of 800*6000 = 4.8Mb.

You probably need to decrease the resolution and details to make the tiles change much less.
Well, many tests will be needed to find a compromise, however it is a road that it's worth being explored
ross is offline  
Old 14 July 2020, 15:34   #48
Yannick
Registered User

Yannick's Avatar
 
Join Date: Jul 2020
Location: France
Posts: 23
Quote:
Originally Posted by ross View Post
Do you have any statistics available for the vector matix?
Just to understand how many maximum lines per frame we are talking about.
I don't think blitter filling for the frame is a stumbling block, but the polydraw.

Furthermore, scaling (and ratio tranform) must be avoided.
You have to decide in advance the resolution (I would opt for one at 60Hz in order to render the frames from the originals at 30FPS, to avoid temporal artifacts).

By trying exclusively on AGA (I have some ideas about some overlay and dithering effects) you could also explore medres-interlace (well, maybe I'm aiming too high )
However, the format must be increased from 8x8 bit to 9x8 or 10x9 (depends on the choice of resolution).
Of course there will be an increase from 850Kb to >900Kb in the first case or >1000Kb in the second case but it is to be verified, given the different positioning of the bits the same compression ratio is not guaranteed, especially for the huffman part.
Some statistics from the shown video:
- All frames are rendered (6535 frames)
- Total of 570401 polygons
- Average points / polygon = 10.5
- Average points / frame = 13
- Max points / frame = 653
- Max points / polygon = 253
- Max polygon / frame = 93

I did some expiriments by reducing maximum number of points / polygon to 126 max, i doesn't reduce size nor quality a lot.

The maximum number of polygons / frame might be a good way to reduce complexity without too much impact on visible quality. Only 150 frames have more the 20 polygons.

Yannick
Yannick is offline  
Old 14 July 2020, 16:06   #49
robinsonb5
Registered User
 
Join Date: Mar 2012
Location: Norfolk, UK
Posts: 818
Quote:
Originally Posted by ross View Post
Probably this is really an intense frame but 1600 words are too much.
Even if the average is 800 and pack it at 1/3 you have a requirement of 800*6000 = 4.8Mb.
Agreed - however, if you look at the data, for very many of those words only one bit is set, so I'd expect a much more efficient encoding to be possible. Actually, I should see how many unique words are within that dataset.
robinsonb5 is offline  
Old 14 July 2020, 16:23   #50
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 50
Posts: 2,800
Quote:
Originally Posted by Yannick View Post
- Max points / frame = 653
- Max points / polygon = 253
- Max polygon / frame = 93
Interesting

If I find the time I do some tests with the blitter.
ross is offline  
Old 14 July 2020, 17:16   #51
Yannick
Registered User

Yannick's Avatar
 
Join Date: Jul 2020
Location: France
Posts: 23
Quote:
Originally Posted by ross View Post
Interesting

If I find the time I do some tests with the blitter.
Tell me what you can reach at 30fps, we can then optimize
Yannick is offline  
Old 15 July 2020, 00:37   #52
robinsonb5
Registered User
 
Join Date: Mar 2012
Location: Norfolk, UK
Posts: 818
A little bit more data:
If I output the whole animation in a simplistic binary format, 1 byte with the number of words to skip, 2 bytes with a literal word to write to memory, I end up with 12,626,385 bytes of data, which gzips to 3,634,175 bytes.

Here's where it gets interesting:
I only see 5878 unique values within that data, so it's using less than 10% of its encoding space.
If I analyze how many bits are set within each unique word, I get this:

0 bits set (i.e. a zero is written): 1158688 in total, 1 unique values
1 bits set: 2619397 in total, 16 unique values

Which means of that 12-meg dataset, nearly 11 meg represents writing one of just 17 values.

2 bits set: 337667 in total, 120 unique values
3 bits set: 72624 in total, 560 unique values
4 bits set: 14866 in total, 1797 unique values
5 bits set: 4200 in total, 2301 unique values
6 bits set: 1012 in total, 763 unique values
7 bits set: 280 in total, 259 unique values
8 bits set: 45 in total, 45 unique values
9 bits set: 11 in total, 11 unique values
10 bits set: 5 in total, 5 unique values

So... clearly scope for a much more efficient encoding.

Also, the source animation is 320x240@30fps. Presumably because of the frame rate we'd be targetting an NTSC screen resolution, so it would make sense to downsample to 320x200 - so that should reduce the size by about 16%, too.
robinsonb5 is offline  
Old 15 July 2020, 08:58   #53
Yannick
Registered User

Yannick's Avatar
 
Join Date: Jul 2020
Location: France
Posts: 23
After some optimization I came to this without compromising quality too much:
- Max points / frame = 535
- Max points / polygon = 126
- Max polygon / frame = 93

Only 151 frames (2.3%) have more than 200 points.
73.3 % have less than 100 points.

Data is now :
- 1084272 bytes uncompressed
- 808378 bytes compressed

Last edited by Yannick; 15 July 2020 at 09:04.
Yannick is offline  
Old 15 July 2020, 09:04   #54
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 50
Posts: 2,800
Quote:
Originally Posted by Yannick View Post
After some optimization I came to this without compromising quality too much:
- Max points / frame = 535
- Max points / polygon = 126
- Max polygon / frame = 93

Only 151 frames (2.3%) have more than 200 points.
73.3 % have less than 100 points.
Good, this allows you to remove the check for% x1111111 and the sum.
How much does the compression degrade with the coordinates in xyxyxy .. instead of xxx..yyy ..?
The index applied to all y extraction slow it.. (I'm short of Ax registers )
ross is offline  
Old 15 July 2020, 09:08   #55
Yannick
Registered User

Yannick's Avatar
 
Join Date: Jul 2020
Location: France
Posts: 23
Quote:
Originally Posted by ross View Post
Good, this allows you to remove the check for% x1111111 and the sum.
How much does the compression degrade with the coordinates in xyxyxy .. instead of xxx..yyy ..?
The index applied to all y extraction slow it.. (I'm short of Ax registers )
Yes the goal of limiting paths to 126 points is to allow removing the test and the sum.

The test shows that the gain of having X and Y data stored independently is now marginal:
- 1084272 bytes uncompressed
- 808378 bytes XXX, YYY data compressed
- 813405 bytes XYXYXY data compressed

You can go this way for decoding, I'll modify the data generation

Last edited by Yannick; 15 July 2020 at 09:16.
Yannick is offline  
Old 15 July 2020, 09:44   #56
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 50
Posts: 2,800
Quote:
Originally Posted by Yannick View Post
Yes the goal of limiting paths to 126 points is to allow removing the test and the sum.

The test shows that the gain of having X and Y data stored independently is now marginal:
- 1084272 bytes uncompressed
- 808378 bytes XXX, YYY data compressed
- 813405 bytes XYXYXY data compressed

You can go this way for decoding, I'll modify the data generation
Yes, acceptable.

But the main concern is to avoid the scaling.
x need to be absolutely 9 bit.

x,y in 16 bit, compressed, what file size do they give you?
ross is offline  
Old 15 July 2020, 09:58   #57
Yannick
Registered User

Yannick's Avatar
 
Join Date: Jul 2020
Location: France
Posts: 23
What resolution do you want to come up with.
Original video is 512*384, scaling it to 320 wide, gives 240 in height
Should we go for this 320*240 or decrease is further to 320*200?
That would fit in 9bits for x and 8bits for y, but this is not easy to handle at all.
I will try something with 9 bits for X and 7 bits for Y.
Y will need to be shifted by one bit to scale.
X will be used as is.

Let me check what it looks like.

/Yannick
Yannick is offline  
Old 15 July 2020, 10:17   #58
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 50
Posts: 2,800
Quote:
Originally Posted by Yannick View Post
What resolution do you want to come up with.
Original video is 512*384, scaling it to 320 wide, gives 240 in height
Should we go for this 320*240 or decrease is further to 320*200?
That would fit in 9bits for x and 8bits for y, but this is not easy to handle at all.
I will try something with 9 bits for X and 7 bits for Y.
Y will need to be shifted by one bit to scale.
X will be used as is.

Let me check what it looks like.

/Yannick
Well, final resolution is secondary.
Could also be some overscan resolution and not a standard one.
Main idea is to use 9x8 bit or 10x9 (yes not easy..)

If we go for a 60Hz resolution then the most suitable is lores NTSC (or for us PAL60 ).
A 10% overscan give 352x220 (9x8), that are good values.
So a 0.6875 scale for x and 0.5729 for y.

In any case first I have to see something moving on the screen, later in the day I will try.
ross is offline  
Old 15 July 2020, 11:31   #59
Yannick
Registered User

Yannick's Avatar
 
Join Date: Jul 2020
Location: France
Posts: 23
I've made it with 9x7bit on a single 16bit word per point.
The result is good.
X is the high 9 bits, and it scaled from 0 to 319.
Y is the lowest 7 bits, and is scaled from 0 to 127, that shall be shifted by 2 for a scale of 0 to 254.

End resolution can be modified with this concept to go up to 512 in X and 254 in Y.
Yannick is offline  
Old 15 July 2020, 11:33   #60
chip
Amiga Demoscene Archive !
 
Join Date: Oct 2012
Location: Italy
Age: 45
Posts: 1,900
We are looking at the born of Bad Apple for Amiga ..... that's fantastic !

Thanks to all involved
chip is online now  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is Amiga the only system without a Bad Apple demo? Glen M support.Demos 11 17 July 2020 18:07
Bad Apple - Amiga shadow animation voyager Nostalgia & memories 36 19 January 2020 11:02
Bad Apple mod Zarchos request.Modules 5 07 May 2017 04:35
SWIV unsupported version or bad dump? BarryB project.WHDLoad 13 08 January 2017 12:04
Last Ninja Apple 2GS version longplay laffer Retrogaming General Discussion 4 04 June 2008 17:50

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 17:21.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.09759 seconds with 14 queries