I know that the Media SDK is not intended for use with still JPEGs. But based on the "mediasdkjpeg-man.pdf" and the available samples I was able to create a working transcoder :
sts = _mfxDECODE->DecodeFrameAsync(&mfxIBS, &_decSurface, &outSurface, &syncDecode);
sts = _mfxVPP->RunFrameVPPAsync(outSurface, &_encSurface[0], NULL, &syncVpp);
sts = _mfxENCODE->EncodeFrameAsync(&encodeCtrl, &_encSurface[0], &mfxOBS, &syncEncode);
sts = _mfxSession.SyncOperation(syncEncode, MSDK_WAIT_INTERVAL);
As mfxVPP->Init takes quite long (~800 ms) I use Reset (...) for all the pipeline steps when processing the next image. As long as the image and resize dimensions stay equal everything works fast and pretty. If the dimensions are different I get an UNDEFINED BEHAVIOR error back from SyncOperation and no surface is delivered. The problem is caused by the VPP step. I tested DECODE and ENCODE, they are able to work with Reset and changed image dimensions.
For my application this is absolutely a show-stopper. Is there a workarround ?
Here my session init sequnce. I get back version 1.27 :
initPar.Version.Major = 1;
initPar.Version.Minor = 0;
initPar.GPUCopy = 0;
initPar.Implementation = MFX_IMPL_SOFTWARE;mfxStatus sts = _mfxSession.InitEx(initPar);
sts = _mfxSession.QueryVersion(&_mfxVersion);
sts = _mfxSession.QueryIMPL(&impl);
sts = _mfxSession.Init(impl, &_mfxVersion);