Given an alphabet $A$ and a distribution $P:A\rightarrow \mathbb{R}$, as well as a loss function $L:A \times A \rightarrow \mathbb{R}$, I want to find a lossy (possibly non-invertible) coding $C:A\rightarrow \{0,1\}^n$ minimizing
$\mathbb{E}[A, C^*(C(A))]$
where $C^*(b)$ is the maximum-likelihood decoding of $b$, i.e.
$\arg\max_{A~:~C(A)=b} P(A)$
Is it known how this coding relates to $P$ and $L$?
Is there an optimal algorithm known for creating such a coding? (Huffman or the like?)
How does this question relate to the source coding theorem and the channel coding theorem?

