avcodec/mjpegdec: move shift_output() to its own function

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/mjpegdec: support >8bit in mjpeg_decode_scan_progressive_ac()

Fixes Ticket2812

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