jpeg decode optimizations