  Necessary conditions for asymptotically optimal sliding-block or stationary
codes for source coding and rate-constrained simulation of memoryless sources
are presented and used to motivate a design technique for trellis-encoded
source coding and rate-constrained simulation. The code structure has intuitive
similarities to classic random coding arguments as well as to ``fake process''
methods and alphabet-constrained methods. Experimental evidence shows that the
approach provides comparable or superior performance in comparison with
previously published methods on common examples, sometimes by significant
margins.
