avcodec/mjpegdec: set upscale_h/upscale_v using generic code instead of hardcoding a list

Some code is left to handle corner cases

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