Skip to content

Commit 05bb67c

Browse files
committed
1.7.2 Release
统一打印realsr/realcugan保存图片所用的时间
1 parent c660e5b commit 05bb67c

File tree

4 files changed

+22
-15
lines changed

4 files changed

+22
-15
lines changed

RealCUGAN-NCNN-Android-CLI/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ android {
99

1010
ndk {
1111
moduleName "ncnn"
12-
abiFilters "armeabi-v7a", "arm64-v8a", "x86"
12+
abiFilters "arm64-v8a" //, "armeabi-v7a", "x86"
1313
}
1414
minSdkVersion 24
1515
}

RealCUGAN-NCNN-Android-CLI/app/src/main/jni/main.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,9 @@ void* save(void* args)
365365
if (v.id == -233)
366366
break;
367367

368+
fprintf(stderr, "save result...\n");
369+
float begin = clock();
370+
368371
// free input pixel data
369372
{
370373
unsigned char* pixeldata = (unsigned char*)v.inimage.data;
@@ -408,6 +411,9 @@ void* save(void* args)
408411
}
409412
if (success)
410413
{
414+
float end = clock();
415+
fprintf(stderr, "save result use time: %.3f\n", (end - begin) / CLOCKS_PER_SEC);
416+
411417
if (verbose)
412418
{
413419
#if _WIN32
@@ -420,9 +426,9 @@ void* save(void* args)
420426
else
421427
{
422428
#if _WIN32
423-
fwprintf(stderr, L"encode image %ls failed\n", v.outpath.c_str());
429+
fwprintf(stderr, L"save result failed: %ls\n", v.outpath.c_str());
424430
#else
425-
fprintf(stderr, "encode image %s failed\n", v.outpath.c_str());
431+
fprintf(stderr, "save result failed: %s\n", v.outpath.c_str());
426432
#endif
427433
}
428434
}

RealSR-NCNN-Android-CLI/app/src/main/jni/main.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,8 @@ void* save(void* args)
369369
if (v.id == -233)
370370
break;
371371

372+
fprintf(stderr, "save result...\n");
373+
float begin = clock();
372374
// free input pixel data
373375
{
374376
unsigned char* pixeldata = (unsigned char*)v.inimage.data;
@@ -386,8 +388,6 @@ void* save(void* args)
386388
}
387389
}
388390

389-
float begin = clock();
390-
391391
int success = 0;
392392

393393
path_t ext = get_file_extension(v.outpath);
@@ -412,25 +412,26 @@ void* save(void* args)
412412
success = stbi_write_jpg(v.outpath.c_str(), v.outimage.w, v.outimage.h, v.outimage.elempack, v.outimage.data, 100);
413413
#endif
414414
}
415-
if (success) {
415+
if (success)
416+
{
416417
float end = clock();
417-
fprintf(stderr, "save use time: %.2f\n",
418-
(end - begin) / CLOCKS_PER_SEC);
418+
fprintf(stderr, "save result use time: %.3f\n", (end - begin) / CLOCKS_PER_SEC);
419419

420-
if (verbose) {
420+
if (verbose)
421+
{
421422
#if _WIN32
422-
fwprintf(stderr, L"%ls -> %ls done\n", v.inpath.c_str(), v.outpath.c_str());
423+
fwprintf(stdout, L"%ls -> %ls done\n", v.inpath.c_str(), v.outpath.c_str());
423424
#else
424-
fprintf(stderr, "%s -> %s done\n", v.inpath.c_str(), v.outpath.c_str());
425+
fprintf(stdout, "%s -> %s done\n", v.inpath.c_str(), v.outpath.c_str());
425426
#endif
426427
}
427428
}
428429
else
429430
{
430431
#if _WIN32
431-
fwprintf(stderr, L"encode image %ls failed\n", v.outpath.c_str());
432+
fwprintf(stderr, L"save result failed: %ls\n", v.outpath.c_str());
432433
#else
433-
fprintf(stderr, "encode image %s failed\n", v.outpath.c_str());
434+
fprintf(stderr, "save result failed: %s\n", v.outpath.c_str());
434435
#endif
435436
}
436437
}

RealSR-NCNN-Android-GUI/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ android {
99
applicationId "com.tumuyan.ncnn.realsr"
1010
minSdk 24
1111
targetSdk 28
12-
versionCode 14
13-
versionName "1.7.1"
12+
versionCode 15
13+
versionName "1.7.2"
1414

1515
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1616
}

0 commit comments

Comments
 (0)