[FFmpeg-devel] a64 encoder 7th round

Michael Niedermayer michaelni
Sat Jan 31 14:38:41 CET 2009


On Sat, Jan 31, 2009 at 01:59:48PM +0100, Bitbreaker/METALVOTZE wrote:
> 
> >>> now a few questions, i hope iam not too annoying
> >>> the low nibble is either 15 or 8 if i did RTFS correctly
> >>> do you have 64 byte left for a LUT?
> >>> if so you can do some code equivalent to
> >>>
> >>> x= read_net();
> >>> dst[0]=lut[x  ];
> >>> dst[1]=lut[x+1];
> >>> dst[2]=lut[x+2];
> >>> dst[3]=lut[x+3];
> >>> x= read_net();
> >>> dst[4]=lut[x  ];
> >>> dst[5]=lut[x+1];
> >>> dst[6]=lut[x+2];
> >>> dst[7]=lut[x+3];
> >>> ...
> >>>
> >>>   
> >>>       
> >> Gotta see tomorrow if that works...
> >>     
> Hmm, i am afraid, a lookup from the table is as expensive as reading a 
> byte from the network :-) So over all you end up at the same speed again.

but its lower bitrate, so if its not worse in any other way you at least
have smaller files, and not by a insignificant amount smaller
was there a disadvantage in thr 5col mode over 4col except filesize ?


> 
>    [setup as always]
>    ...
>   
>    ldx $de00
>    lda lut+0,x
>    sta dest,y
>    iny
>    lda lut+0,x
>    sta dest,y
>    iny
>    lda lut+2,x
>    sta dest,y
>    iny
>    lda lut+3,x
>    sta dest,y
>    iny
> 
> that is 12 cycles per reconstructed byte in the inner loop.

i see 4+5+2=11 per byte output + some overhead per each 4 byte group
but this can be improved, you dont need to write 4 consecutive bytes
you can write (0,64,128,192), (1,65,129,193), ...
code should be:

ldx $de00
lda lut+0,x
sta dest,y
lda lut+1,x
sta dest+64,y
lda lut+2,x
sta dest+128,y
lda lut+3,x
sta dest+192,y
iny

this safes 3 iny per 4 bytes written, thus 2*3/4=1.5 cycles faster
the same trick might be useable for the generic copy from network as well
maybe?


> 263 big LUT is possible in size, but the index will be too small for 
> that :-)

i dont think it will be too small, we just need 0..255 index
and from that 8 bytes that is 0..7 with index 0 and 255..262 with
index 255

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090131/f585082f/attachment.pgp>



More information about the ffmpeg-devel mailing list