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

ippiSet & 32s_C3R?

xorvax
Beginner
481 Views
I need to use ippiSet function for 32s_C3R, because of ippiFFTFwd_RToPack_8u32s_C3RSfs butit's defined only for8u_C3R, 16s_C3R and32f_C3R .?

0 Kudos
2 Replies
seiji-torigoe
Beginner
481 Views
IppiSet_32s was not found.
However, you can write the value yourself.

---- VC sample ----
#include "ipp.h"
int main(int argc, char* argv[])
{
Ipp32s * pImg;
Ipp32s * pTmp;
int ImgW, ImgH, Step, y, x;

ImgW = 3; ImgH = 3;
pImg = ippiMalloc_32s_C3(ImgW, ImgH, &Step);

Ipp32s value = 1;
for ( y = 0; y < ImgH; y++ )
{
pTmp = pImg + y * Step / sizeof(Ipp32s);
for ( x = 0; x < ImgW; x++ )
{
*pTmp = value; printf("%d, ", *pTmp); pTmp++;
*pTmp = value; printf("%d, ", *pTmp); pTmp++;
*pTmp = value; printf("%d ", *pTmp); pTmp++;
} printf(" ");
} printf(" ");

value = 100;
ippsSet_32s(value, pImg, Step / sizeof(Ipp32s) * ImgH);
for ( y = 0; y < ImgH; y++ )
{
pTmp = pImg + y * Step / sizeof(Ipp32s);
for ( x = 0; x < ImgW; x++ )
{
*pTmp = value; printf("%d, ", *pTmp); pTmp++;
*pTmp = value; printf("%d, ", *pTmp); pTmp++;
*pTmp = value; printf("%d ", *pTmp); pTmp++;
} printf(" ");
} printf(" ");

ippiFree(pImg);

return 0;
}

---- Delphi sample ----
function ippiMalloc_32s_C3(
widthPixels, heightPixels: Integer;
pStepBytes: PInteger): Pointer;
stdcall; external 'ippi20.dll';

procedure ippiFree(
ptr: Pointer);
stdcall; external 'ippi20.dll';

function ippsSet_32s(
val: Integer; pDst: PInteger;
len: Integer): Integer;
stdcall; external 'ipps20.dll';

procedure TForm1.Button1Click(Sender: TObject);
var pImg, pTmp: PInteger;
var ImgW, ImgH, Step, y, x, value: Integer;
var s: String;
begin
ImgW := 3; ImgH := 3;
pImg := ippiMalloc_32s_C3(ImgW, ImgH, @Step);

value := 1; s := '';
for y := 0 to ImgH - 1 do begin
Integer(pTmp) := Integer(pImg) + y * Step;
for x := 0 to ImgW - 1 do begin
pTmp^ := value; s := s + IntToStr(pTmp^) + ', '; Inc(pTmp);
pTmp^ := value; s := s + IntToStr(pTmp^) + ', '; Inc(pTmp);
pTmp^ := value; s := s + IntToStr(pTmp^) + ' '; Inc(pTmp);
end; s := s + #13#10;
end;
ShowMessage(s);

value := 100;
ippsSet_32s(value, pImg, Step div SizeOf(Integer) * ImgH);

s := '';
for y := 0 to ImgH - 1 do begin
Integer(pTmp) := Integer(pImg) + y * Step;
for x := 0 to ImgW - 1 do begin
s := s + IntToStr(pTmp^) + ', '; Inc(pTmp);
s := s + IntToStr(pTmp^) + ', '; Inc(pTmp);
s := s + IntToStr(pTmp^) + ' '; Inc(pTmp);
end; s := s + #13#10;
end;
ShowMessage(s);

ippiFree(pImg);
end;
0 Kudos
Vladimir_Dudnik
Employee
481 Views
Thanks for the help,
yes, that's correct. If thereno appropriate 2-D functions it is possible to use 1-D functions on row-by-row basis.
Regards,
Vladimir
0 Kudos
Reply