hevc: optimize residual coding(cherry picked from commit 70692a44708157b4dfa50e402e446bfa2b27f55e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
hevc: fix pcm with different chroma luma bit widths(cherry picked from commit 6a444516f338424d062c0ef2806714036283603b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>