optimize decompress jpg data

it may be unnecessary copy jpg bytes one by one when decompress jpg data
optimize decompress jpg data and fix warnings
Merge pull request #8062 from zhongfq/v3

optimize decompress jpg data