upmerged pull req #2974 to master - added more jpeg options to imgcodecs
fixed test compilation
#2992: update after review
Merge pull request #2992 from snikulov:upmerge_jpeg_tweak