[FFmpeg-devel] A64 encoder

Tobias Bindhammer tobias.bindhammer
Tue Jul 6 15:07:56 CEST 2010


> please split muxer and codec into seperate patches so patches are smaller

Here we go.

> breaks ABI

fixed.

> i think this is not the correct terminology for C

using a 'neutral' name now ;-P

> this heuristic is simply poor
> if you had no success in implemening some error diffusion dither that considers
> neighboring blocks and previous frames than i would suggest you at least try
> some kind of a refinement pass after above

i worked on this issue already some time ago, but did not find a 
suitable solution on this so far. If i reduce too bright or too dark 
colors already before doing the elbg, the elbg might still lift or lower 
some pixels again what would then make them appear in the opposite color 
and will of course look rather ugly in result. That is why i cut off the 
luminances after the elbg yet and assume that usually no too harsh 
contrast appears in such a small area like a 8x8 block. Over all this 
assumption is the only way on how i can at all display 5 colors instead 
of 4. I know that this assumption fails in very small details with 
strong contrast, like white font on black background for example. In 
normal movie situation however it is not much of a problem and the wider 
luminance range adds more to the quality, by adding more depth and 
detail, than this (indeed poor) tradeoff destroys qualitywise. In fact, 
taking the surrounding blocks into regard might also help on avoiding a 
blocky result (imagine the white font on black background again, 
reducing the white to a light grey will give a better visual result than 
changing the surrounding black to a dark grey, and such creating very 
visible blocks), but so far i have no idea on how to implement that. So 
seems, like we have to stick to the poor variant so far. The good thing: 
the format of a encoded frame can in any case stay the same, and it is 
just about the codec to improve quality further in this issue.

Also i did some other changes to enhance quality but did not merge those 
changes into this version yet, as i wanted to get the basic codec into 
ffmpeg first. Those enhancements inklude things like interlace, taking 
care of correct luma distance between the 5 colors (as distances are not 
linear) and so on. Also i implemented your suggestions of using a LUT 
for the colorram to save some bytes in the encoded frames.

> {} also try patcheck please

fixed for the if/else cases.

> the encoders private struct belongs in the .c file unless the encoder is
> split accross several files

Here, as well as in the muxer i prepared things already for expansion, 
as the plan is to have several a64-formats and encodings.

> the encoders private context is off limits for the muxer
> it breaks stream copy but thats not the only reason

Fixed to a static value so far, as it is not used yet. But i'd be happy 
if you can give me a hint on how to access such a value like the 
lifetime, as i plan to use it somewhen for the c64-videoplayer.

> a bunch of put_byte() seems simpler

See above, the header might grow and contain more information in future, 
that is why i chose this way of implementation. Hope that's okay?

Regards,

Toby

-- 
Dipl. Ing. Tobias Bindhammer
Institut f?r Verteilte Systeme
Oberer Eselsberg          Phone: + 49 731/502-4235
Universit?t Ulm           Fax  : + 49 731/502-4142
D-89069 Ulm               mailto:tobias.bindhammer at uni-ulm.de
http://www-vs.informatik.uni-ulm.de/~bindhammer/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: a64_10_codec.diff
Type: text/x-diff
Size: 14302 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100706/cc3fd1c6/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: a64_10_doc.diff
Type: text/x-diff
Size: 547 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100706/cc3fd1c6/attachment-0001.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: a64_10_muxer.diff
Type: text/x-diff
Size: 3166 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100706/cc3fd1c6/attachment-0002.diff>



More information about the ffmpeg-devel mailing list