porting decoder from old colibri (just started)