Shaping codes can be obtained from optimal unequal cost coding algorithms due to Lempel, Even, and Cohn (1973) in the variable-length-to-block case and to Varn (1971) in the block-to-variable-length case. The former is related to ad hoc approaches to shaping previously described while the latter is novel in the shaping context.
展开▼