Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

JPEG Resize

vardar
Beginner
487 Views
Hello all,
does it possible to resize a decoded raw video frame so that it will be half of its dimensions.
I have a piece of code which encodes to JPEG without changing the original dimensions.

I will be glad, if you can give me a sample code to accomplish this task.
Many Thanks.

Here is my code;
...
CJPEGEncoder my_encoder;
JERRCODE jerr;
IppiSize dimensions;
dimensions.height = out->GetHeight(); // out is type of VideoData*
dimensions.width = out->GetWidth();
Ipp8u* pSrcs[3] = {(Ipp8u*)out->GetPlanePointer(0),
(Ipp8u*)out->GetPlanePointer(1),
(Ipp8u*)out->GetPlanePointer(2)};
Ipp32s pSrcSteps[3] = { out->GetPlanePitch(0),
out->GetPlanePitch(1),
out->GetPlanePitch(2)};
jerr = my_encoder.CJPEGEncoder::SetSource(pSrcs, pSrcSteps, dimensions, 3, JC_YCBCR, JS_422);
if (jerr != JPEG_OK) {
printf(" f1 ");
}
jerr = my_encoder.CJPEGEncoder::SetParams(JPEG_BASELINE, JC_YCBCR, JS_422, 0, 0, tParam->quality);
if (jerr != JPEG_OK) {
printf(" f2 ");
}
...
0 Kudos
4 Replies
Sergey_Ryadno
New Contributor I
487 Views
Hi, it not cleare for me from you post, do you need resize during encode or decode process?
0 Kudos
Vladimir_Dudnik
Employee
487 Views

With UIC picnic application we demonstrate how to use JPEG ability to produce 1:2, 1:4 and 1:8 downsampled images at decoding stage.

Regards,
Vladimir

0 Kudos
vardar
Beginner
487 Views
Let me make it clear.
Above "out" is type ofVideoData pointer whichpoints to a decoded MPEG4 frame.
And its original resolution is 4 CIF.
I want to encode this frame as JPEG but as 2 CIF for example.
many thanks
0 Kudos
Vladimir_Dudnik
Employee
487 Views
Then there is nothing JPEG encoder can help you. You will just need to do resize before JPEG encoding

Regards,
Vladimir
0 Kudos
Reply