| 2931 | |
| 2932 | |
| 2933 | static void |
| 2934 | displayInfo(const char* inFileName, const fileInfo_t* info, int displayLevel) |
| 2935 | { |
| 2936 | unsigned const unit = info->compressedSize < (1 MB) ? (1 KB) : (1 MB); |
| 2937 | const char* const unitStr = info->compressedSize < (1 MB) ? "KB" : "MB"; |
| 2938 | double const windowSizeUnit = (double)info->windowSize / unit; |
| 2939 | double const compressedSizeUnit = (double)info->compressedSize / unit; |
| 2940 | double const decompressedSizeUnit = (double)info->decompressedSize / unit; |
| 2941 | double const ratio = (info->compressedSize == 0) ? 0 : ((double)info->decompressedSize)/info->compressedSize; |
| 2942 | const char* const checkString = (info->usesCheck ? "XXH64" : "None"); |
| 2943 | if (displayLevel <= 2) { |
| 2944 | if (!info->decompUnavailable) { |
| 2945 | DISPLAYOUT("%6d %5d %7.2f %2s %9.2f %2s %5.3f %5s %s\n", |
| 2946 | info->numSkippableFrames + info->numActualFrames, |
| 2947 | info->numSkippableFrames, |
| 2948 | compressedSizeUnit, unitStr, decompressedSizeUnit, unitStr, |
| 2949 | ratio, checkString, inFileName); |
| 2950 | } else { |
| 2951 | DISPLAYOUT("%6d %5d %7.2f %2s %5s %s\n", |
| 2952 | info->numSkippableFrames + info->numActualFrames, |
| 2953 | info->numSkippableFrames, |
| 2954 | compressedSizeUnit, unitStr, |
| 2955 | checkString, inFileName); |
| 2956 | } |
| 2957 | } else { |
| 2958 | DISPLAYOUT("%s \n", inFileName); |
| 2959 | DISPLAYOUT("# Zstandard Frames: %d\n", info->numActualFrames); |
| 2960 | if (info->numSkippableFrames) |
| 2961 | DISPLAYOUT("# Skippable Frames: %d\n", info->numSkippableFrames); |
| 2962 | DISPLAYOUT("Window Size: %.2f %2s (%llu B)\n", |
| 2963 | windowSizeUnit, unitStr, |
| 2964 | (unsigned long long)info->windowSize); |
| 2965 | DISPLAYOUT("Compressed Size: %.2f %2s (%llu B)\n", |
| 2966 | compressedSizeUnit, unitStr, |
| 2967 | (unsigned long long)info->compressedSize); |
| 2968 | if (!info->decompUnavailable) { |
| 2969 | DISPLAYOUT("Decompressed Size: %.2f %2s (%llu B)\n", |
| 2970 | decompressedSizeUnit, unitStr, |
| 2971 | (unsigned long long)info->decompressedSize); |
| 2972 | DISPLAYOUT("Ratio: %.4f\n", ratio); |
| 2973 | } |
| 2974 | DISPLAYOUT("Check: %s\n", checkString); |
| 2975 | DISPLAYOUT("\n"); |
| 2976 | } |
| 2977 | } |
| 2978 | |
| 2979 | static fileInfo_t FIO_addFInfo(fileInfo_t fi1, fileInfo_t fi2) |
| 2980 | { |