[FFmpeg-devel] a64 encoder

Ivo ivop
Sat Jan 17 12:32:00 CET 2009


On Saturday 17 January 2009 10:45, Bitbreaker/METALVOTZE wrote:
> things simple :-) For e.g. i could compress the colorram, as only 4 bits
> are used, by simply putting 2 nibbles together , thus saving  0x200
> bytes on a frame. But in fact it is faster to load  additional 0x200
> bytes than letting teh c64 shift things back with half loading time.
>
> ldx $de00
> txa
> lsr
> lsr
> lsr
> lsr
> sta dest,y
> iny
> txa
> sta dest,y
> ...
>
> 4+2+2+2+2+2+5+2+2+5 = 28 cycles
> versus:
>
> lda $de00
> sta dest,y
> iny
> lda $de01
> sta dest,5
> iny
>
> 4+5+2+4+5+2 = 22 cycles

Assuming you make use of extensive loop-unrolling to avoid the extra cycles 
of comparison and branching, you could reduce the filesize and keep the 
same speed by using:

ldx $de00
lda highnib,x
sta dest
lda lownib,x
sta dest+1

4+5+4+5+4 = 22 cycles

lownib and highnib are two 256-byte lookup-tables.

--Ivo




More information about the ffmpeg-devel mailing list