Ported r2814 from ZXing

Original commit message: "Issue 1693 Aztec encoder improvements"