Reimplement decoder library