Trellis-based source and channel coding