Revert "pnm: remove nonsense code"

Breaks decoding pgms with 256 < maxval < 65535.

Found-by: Carl Eugen Hoyos <cehoyos@ag.or.at>.

This reverts commit a0348d0966a81a66f3a1bf061576b24d5296b933.
Revert "Avoid overflows when reading pgm files with maxval != 255 and != 65535."

The patch worked on little endian because pgm decoding was broken
but it was not correct in any way.

This reverts commit 7651c0e49b1f6e66120ef32570a87e3f09224574.
pnm: fix 255 < maxval < 65535 for pam with depth 1

Signed-off-by: Paul B Mahol <onemda@gmail.com>
pnm: do not set avctx->coded_frame

Signed-off-by: Paul B Mahol <onemda@gmail.com>
truemotion2: make code independent of sizeof(AVFrame)

Signed-off-by: Paul B Mahol <onemda@gmail.com>
targaenc: remove unused TargaContext

Signed-off-by: Paul B Mahol <onemda@gmail.com>