avcodec/pngdec: split frame decoding in its own function.

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