Optimal linear labelling for the minimization of both source and channel distortion