MCPcopy Create free account
hub / github.com/creatale/node-dv / ExpandCCS

Function ExpandCCS

deps/opencv/modules/core/src/dxt.cpp:1375–1415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1373
1374
1375static void
1376ExpandCCS( uchar* _ptr, int n, int elem_size )
1377{
1378 int i;
1379 if( elem_size == (int)sizeof(float) )
1380 {
1381 float* p = (float*)_ptr;
1382 for( i = 1; i < (n+1)/2; i++ )
1383 {
1384 p[(n-i)*2] = p[i*2-1];
1385 p[(n-i)*2+1] = -p[i*2];
1386 }
1387 if( (n & 1) == 0 )
1388 {
1389 p[n] = p[n-1];
1390 p[n+1] = 0.f;
1391 n--;
1392 }
1393 for( i = n-1; i > 0; i-- )
1394 p[i+1] = p[i];
1395 p[1] = 0.f;
1396 }
1397 else
1398 {
1399 double* p = (double*)_ptr;
1400 for( i = 1; i < (n+1)/2; i++ )
1401 {
1402 p[(n-i)*2] = p[i*2-1];
1403 p[(n-i)*2+1] = -p[i*2];
1404 }
1405 if( (n & 1) == 0 )
1406 {
1407 p[n] = p[n-1];
1408 p[n+1] = 0.f;
1409 n--;
1410 }
1411 for( i = n-1; i > 0; i-- )
1412 p[i+1] = p[i];
1413 p[1] = 0.f;
1414 }
1415}
1416
1417
1418typedef void (*DFTFunc)(

Callers 1

dftMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected