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

from DCT8x8Fwd to DCTFwd

Youcef_K_
Beginner
267 Views

hi,

There is an interesting example here above of using DCT8x8Fwd with 16u data :

http://software.intel.com/sites/products/documentation/doclib/ipp_sa/71/ipp_manual/index.htm#IPPI/ippi_ch2/ch2_regions_of_interest_in_intel_ipp.htm#ch2_regions_of_interest_in_intel_ipp

I'm trying to obtain the same result but with 32f using DCTFwd. Here is my code for initialisation, getting buffer size and then running transform :

int main(){

IppiDCTFwdSpec_32f* pDCTSpecFwd = NULL;
int pBufferSize = 0; IppiSize roi = {8,8};
IppStatus statusAlloc = ippiDCTFwdInitAlloc_32f(&pDCTSpecFwd, roi, ippAlgHintFast);
if(statusAlloc != ippStsNoErr)
        std::cout << "Failure when allocating the DCT context structure" << std::endl;
IppStatus statusBuffer = ippiDCTFwdGetBufSize_32f(pDCTSpecFwd, &pBufferSize);
if(statusBuffer != ippStsNoErr)
        std::cout << "Failure when allocating the DCT buffer" << std::endl;
ipp8u *buffer = ippsMalloc_8u(pBufferSize);

Ipp32f x[64] = {0};
Ipp32f Tx[64] = {0}; // DCT result
int i;
for( i=0; i<8; ++i ) {
      ippiSet_32f_C1R( (Ipp32f)i, x+8*i+i, 8*sizeof(Ipp32f), roi );
      --roi.width;
      --roi.height;
}
status = ippiDCTFwd_32f_C1R(x, 8*sizeof(Ipp32f), Tx, N*sizeof(Ipp32f), pDCTSpec, pBuffer);

}

The main runs correctly but unfortunately i haven't obtain same result as the exemple

Maybe i have done something wrong?

thanks for any help.

0 Kudos
3 Replies
SergeyKostrov
Valued Contributor II
267 Views
>>There is an interesting example here above of using DCT8x8Fwd with 16u data : >> >>software.intel.com/sites/products/documentation/doclib/ipp_sa/71/... It points to a topic about Regions of Interest in Intel IPP. Is that correct? I have a working example with ippsDCTFwd_32f and ippsDCTInv_32f functions and let me know if you're interested to get it.
0 Kudos
Youcef_K_
Beginner
267 Views

Hi Sergey,

Sorry for the mistake, the right topic is here above :

http://software.intel.com/sites/products/documentation/doclib/ipp_sa/71/ipp_manual/IPPI/ippi_ch10/functn_DCT8x8Fwd.htm

Yes,I would be very grateful if you can provide me with your working example...

0 Kudos
SergeyKostrov
Valued Contributor II
267 Views
... IppStatus st = ippStsNoErr; const int LEN = 64; Ipp32f fInpS[LEN] = { // Input data set ( signal ) 11, 12, 13, 14, 15, 16, 17, 18, 21, 22, 23, 24, 25, 26, 27, 28, 31, 32, 33, 34, 35, 36, 37, 38, 41, 42, 43, 44, 45, 46, 47, 48, 51, 52, 53, 54, 55, 56, 57, 58, 61, 62, 63, 64, 65, 66, 67, 68, 71, 72, 73, 74, 75, 76, 77, 78, 81, 82, 83, 84, 85, 86, 87, 88, }; Ipp32f fOut[LEN] = { 0.0f }; // Calculated DCT for Input data set ( signal ) Ipp32f fInpR[LEN] = { 0.0f }; // Reconstructed Input data set ( signal ) IppsDCTFwdSpec_32f *pFwdSpec = NULL; IppsDCTInvSpec_32f *pInvSpec = NULL; while( RTtrue ) { // Initializes DCT structure ( for Forward computations ) st = ::ippsDCTFwdInitAlloc_32f( &pFwdSpec, LEN, ippAlgHintNone ); if( st != ippStsNoErr ) // Initializes DCT structure ( for Inverse computations ) break; st = ::ippsDCTInvInitAlloc_32f( &pInvSpec, LEN, ippAlgHintNone ); if( st != ippStsNoErr ) break; st = ::ippsDCTFwd_32f( fInpS, fOut, pFwdSpec, 0 ); // Does Forward DCT ( No Scaling / Last parameter is 0 ) if( st != ippStsNoErr ) break; st = ::ippsDCTInv_32f( fOut, fInpR, pInvSpec, 0 ); // Does Inverse DCT ( No Scaling / Last parameter is 0 ) if( st != ippStsNoErr ) break; break; } if( pFwdSpec != NULL ) { st = ::ippsDCTFwdFree_32f( pFwdSpec ); pFwdSpec = NULL; } if( pInvSpec != NULL ) { st = ::ippsDCTInvFree_32f( pInvSpec ); pInvSpec = NULL; } printf( "DCT processing for a data set completed\n" ); ...
0 Kudos
Reply