j2kdec: merge get_tlm() from jpeg2000

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
j2kdec: random non functional changed from jpeg2000

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