The hardware encode is based on GDCL Source Code's work.