本文整理汇总了C++中Compressor::Decompose方法的典型用法代码示例。如果您正苦于以下问题:C++ Compressor::Decompose方法的具体用法?C++ Compressor::Decompose怎么用?C++ Compressor::Decompose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Compressor
的用法示例。
在下文中一共展示了Compressor::Decompose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wname
//.........这里部分代码省略.........
ostringstream sigmapfile;
ostringstream cdatafile;
sigmapfile << oss.str() << ".sig" << "." << i;
cdatafile << oss.str() << "." << i;
cout << "cdatafile = " << cdatafile.str() << endl;
cout << "sigmapfile = " << sigmapfile.str() << endl;
cdatafps[i] = fopen(cdatafile.str().c_str(), "w");
assert(cdatafps[i] != NULL);
sigfps[i] = fopen(sigmapfile.str().c_str(), "w");
assert(sigfps[i] != NULL);
}
TIMER_START(t0);
double time_compress = 0.0;
double time_brick = 0.0;
DecTime = 0.0;
BrickTime = 0.0;
for (int z=0; z<nz; z+= bz) {
for (int y=0; y<ny; y+= by) {
for (int x=0; x<nx; x+= bx) {
//cout << "Compress " << x << " " << y << " " << z << endl;
fetch_brick(data, nx, ny, nz, x, y, z, brick, bx, by, bz, swapbytes);
cerr << "Processing " << z << " " << y << " " << x << endl;
TIMER_START(t1);
cmp->Decompose(brick, cvector, dst_arr_lens, sigmaps, n+1);
if (Compressor::GetErrCode() != 0) exit(1);
TIMER_STOP(t1, DecTime);
float *cvectorptr = cvector;
for (int i=0; i<n+1; i++) {
//
// write the coefficients
//
int rc = fwrite(
cvectorptr, sizeof(cvectorptr[0]),
dst_arr_lens[i], cdatafps[i]
);
assert (rc == dst_arr_lens[i]);
cvectorptr += dst_arr_lens[i];
//
// write the maps
//
const unsigned char *map;
size_t maplen;
sigmaps[i]->GetMap(&map, &maplen);
rc = fwrite(
(const void *) &maplen, sizeof(maplen), 1, sigfps[i]
);
assert (rc == 1);
// write the map
rc = fwrite(map, sizeof(map[0]), maplen, sigfps[i]);
assert (rc == maplen);