Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf5b8d60aa | ||
|
|
8d6c1cd0ea | ||
|
|
efe921aff5 | ||
|
|
de3a853228 | ||
|
|
77e20ad55c | ||
|
|
ffa5c8bf64 | ||
|
|
ba47ccb680 | ||
|
|
e97b1bee52 | ||
|
|
24f43183fd | ||
|
|
0628cf9249 | ||
|
|
da879a098f | ||
|
|
eb010ec7f5 | ||
|
|
70fd411418 | ||
|
|
e2f1251c70 | ||
|
|
06ad11340d | ||
|
|
5c34457f2d | ||
|
|
7cdcba4a35 | ||
|
|
b30be14b3e |
64
README.md
64
README.md
@@ -1,45 +1,55 @@
|
||||
# MultiPar
|
||||
|
||||
### v1.3.3.2 is public
|
||||
### v1.3.3.3 is public
|
||||
|
||||
This is a small fix version to improve performance of GPU acceleration.
|
||||
It will become faster on AMD Radeon graphics boards.
|
||||
It may be slightly faster on Nvidia GeForce graphics boards.
|
||||
There is no difference in CPU calculation.
|
||||
Because this isn't tested so much, there may be a bug, failure, or mistake.
|
||||
If you see a problem, please report the incident.
|
||||
I will try to solve as possible as I can.
|
||||
I fixed a few rare bugs in this version.
|
||||
While most users were not affected by those problems,
|
||||
those who saw the matter would better use new version.
|
||||
If there is a problem still, I will fix as possible as I can.
|
||||
I updated some help documents about Batch script.
|
||||
I mentioned the location of help files in ReadMe text.
|
||||
|
||||
I changed 3 points in my OpenCL implementation.
|
||||
It's possible to test them by `lc` option at command-line.
|
||||
Thanks [cavalia88, Slava46, and Anime Tosho for many tests and wonderful idea](https://github.com/Yutaka-Sawada/MultiPar/issues/107).
|
||||
OpenCL perfomance is varied in every graphics boards.
|
||||
If you have a fast graphics board, enabling "GPU acceleration" would be faster.
|
||||
If it's not so fast (or is slow) on your PC, just un-check the feature.
|
||||
1) Data transfur between PC's RAM and GPU's VRAM
|
||||
2) Calculation over GPU
|
||||
3) Calculate 2 blocks at once to reduce number of table lookup
|
||||
New version supports a PC with max 8 OpenCL devices.
|
||||
Thanks [Yi Gu for reporting bug in a rare environment](https://github.com/Yutaka-Sawada/MultiPar/issues/110).
|
||||
I didn't think a user put so many OpenCL devices on a PC.
|
||||
It will detect a Graphics board correctly.
|
||||
|
||||
I improved source file splitting feature at creating PAR2 files.
|
||||
Thanks [AreteOne for reporting bug and suggestion of improvment](https://github.com/Yutaka-Sawada/MultiPar/issues/117).
|
||||
When file extension is a number, it didn't handle properly.
|
||||
If someone saw strange behavior at file splitting ago, it should have been solved in this version.
|
||||
|
||||
I fixed a bug in verifying external files.
|
||||
It might not find the last slice in a source file, when the file data is redundant.
|
||||
Thanks [dle-fr for reporting bug and testing many times](https://github.com/Yutaka-Sawada/MultiPar/issues/130).
|
||||
This solution may improve verification of damaged files, too.
|
||||
When source files are mostly random data like commpressed archive, there was no problem.
|
||||
|
||||
|
||||
[ Changes from 1.3.3.1 to 1.3.3.2 ]
|
||||
[ Changes from 1.3.3.2 to 1.3.3.3 ]
|
||||
|
||||
Installer update
|
||||
- Inno Setup was updated from v6.2.2 to v6.3.1.
|
||||
|
||||
PAR2 client update
|
||||
- Improvement
|
||||
- GPU acceleration will work well on AMD graphics boards.
|
||||
- Bug fix
|
||||
- Fixed a bug in GPU acceleration, when there are many OpenCL devices.
|
||||
- Failure of splitting source files with numerical extension was fixed.
|
||||
- Faulty prediction of the last block in a file with repeated data was fixed.
|
||||
|
||||
|
||||
[ Hash value ]
|
||||
|
||||
MultiPar1332.zip
|
||||
MD5: 5F2848ED7F65C632D1FED42A39B66F95
|
||||
SHA1: CFA2CC6D217704BE2AF9DEDE15B117E9DC26A25B
|
||||
MultiPar1333.zip
|
||||
MD5: 01A201CA340C33053E6D7D2604D54019
|
||||
SHA1: F7C30A7BDEB4152820C9CFF8D0E3DA719F69D7C6
|
||||
|
||||
MultiPar1332_setup.exe
|
||||
MD5: 338F9D0842762338DC83921BBE546AF8
|
||||
SHA1: 2A11FD544D49AA7B952214733C9D8E53F647592E
|
||||
MultiPar1333_setup.exe
|
||||
MD5: 33F9E441F5C1B2C00040E9BAFA7CC1A9
|
||||
SHA1: 6CEBED8CECC9AAC5E8070CD5E8D1EDF7BBBC523A
|
||||
To install under "Program Files" or "Program Files (x86)" directory,
|
||||
you must select "Install for all users" at the first dialog.
|
||||
|
||||
Old versions and source code packages are available at
|
||||
[GitHub](https://github.com/Yutaka-Sawada/MultiPar/releases) or
|
||||
[OneDrive](https://1drv.ms/u/s!AtGhNMUyvbWOaSo1n_R8awJ_hg0).
|
||||
[OneDrive](https://1drv.ms/f/c/8eb5bd32c534a1d1/QtGhNMUyvbUggI5pAAAAAAAAKjWf9HxrAn-GDQ).
|
||||
|
||||
Binary file not shown.
@@ -25,7 +25,13 @@ Be careful to use those special features.
|
||||
|
||||
[ System requirement ]
|
||||
|
||||
MultiPar requires a PC with Windows Vista or later (Windows 7, 8, 10).
|
||||
MultiPar requires a PC with Windows Vista or later (Windows 7, 8, 10, 11).
|
||||
|
||||
[ Usage manual or Help documents ]
|
||||
|
||||
There are some usage manual or help documents in "help" folder.
|
||||
English pages exists in "help/0409" folder.
|
||||
You may open the manual by pushing "F1-key", while using MultiPar.
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
@@ -54,7 +54,13 @@ QuickPar など他の PAR クライアントはコメント機能に対応して
|
||||
|
||||
[ 動作環境 ]
|
||||
|
||||
Windows Vista かそれ以降 (Windows 7, 8, 10) のパソコンが必要です。
|
||||
Windows Vista かそれ以降 (Windows 7, 8, 10, 11) のパソコンが必要です。
|
||||
|
||||
[ 使い方や解説文章 ]
|
||||
|
||||
ほとんど英語ですが、help フォルダーの中に使い方や解説文章が入ってます。
|
||||
日本語のページは help\0411 フォルダーの中にあります。
|
||||
MultiPar の使用中に、F1-key を押すと、マニュアルが表示されます。
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
Release note of v1.3.3 tree
|
||||
|
||||
par2j's "lc" option was changed to support more threads.
|
||||
Windows Vista will be removed from supported OS.
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
[ Changes from 1.3.3.2 to 1.3.3.3 ] (2024/06/15)
|
||||
|
||||
Installer update
|
||||
Inno Setup was updated from v6.2.2 to v6.3.1.
|
||||
|
||||
PAR2 client update
|
||||
Bug fix
|
||||
Fixed a bug in GPU acceleration, when there are many OpenCL devices.
|
||||
Failure of splitting source files with numerical extension was fixed.
|
||||
Faulty prediction of the last block in a file with repeated data was fixed.
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
[ Changes from 1.3.3.1 to 1.3.3.2 ] (2024/01/10)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
v1.3.3 の更新情報 (2024/01/10)
|
||||
v1.3.3 の更新情報 (2024/06/15)
|
||||
|
||||
まだ動作実験中ですので、不安な人は前のバージョンを使ってください。
|
||||
Windows Vista を動作対象の OS から外す予定です。
|
||||
|
||||
[ 1.3.2 から 1.3.3 への変更点 ]
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ textarea{width:100%;}
|
||||
|
||||
<p> 
|
||||
Because MultiPar consists of PAR clients and GUI,
|
||||
it is possible to use a PAR client on Command prompt.
|
||||
it is possible to use a PAR client on Command Prompt.
|
||||
Read a manual of command line for the details of command and option.
|
||||
It's available by batch file (or command script).
|
||||
</p>
|
||||
@@ -27,13 +27,57 @@ Modify the options for PAR2 files, and set the path of <tt>par2j.exe</tt>.
|
||||
Write absolute path like;<br>
|
||||
<code>SET par2_path="C:\something directory\MultiPar\par2j.exe"</code><br>
|
||||
Read manuals (<tt>Command_***.txt</tt>) to know the detail of options.
|
||||
Read Windows OS 's help for Command prompt's usage.
|
||||
Read Windows OS 's help for Command Prompt's usage.
|
||||
</p>
|
||||
<p> 
|
||||
Save a sample script to a file like <tt>batch.bat</tt> or <tt>batch.cmd</tt>.
|
||||
To specify path of files or folders, Drag & Drop them on the batch file.
|
||||
When you put a shortcut icon of the batch file in "SendTo" menu,
|
||||
you can call the batch file by selecting files then Righ-Click & SendTo.
|
||||
There are some ways to specify a file or folder.<br>
|
||||
<ol>
|
||||
<li>Type everytime by keyboard on Command Prompt
|
||||
<p> 
|
||||
If you use the batch file at Command Prompt, change directory to the batch file at first.
|
||||
Next, type <tt>batch.bat "path of the file or folder"</tt>.
|
||||
If there is no space in the path, no need to cover by <tt>""</tt>.
|
||||
The path may be absolute path or relative path from the batch file.
|
||||
Normally absolute path would be safe.
|
||||
</p>
|
||||
<p> 
|
||||
If you want to specify multiple files or folders,
|
||||
type <tt>batch.bat "path of the first file or folder" "path of second file or folder" "path of third file or folder"</tt>.
|
||||
You may add some pathes after a script filename.
|
||||
</p>
|
||||
</li>
|
||||
<li>Drag & Drop a file or folder by mouse
|
||||
<p> 
|
||||
On Windows Explorer, drag a file or folder and drop it on your batch file.
|
||||
If you put the batch file on Desktop, it will be easy to Drag & Drop.
|
||||
</p>
|
||||
<p> 
|
||||
If you want to specify multiple files or folders,
|
||||
select them at once on Windows Explorer, and Drag & Drop the group on the batch file.
|
||||
While dragging, number of items may be shown.
|
||||
</p>
|
||||
</li>
|
||||
<li>Select SendTo at Windows Explorer's right click menu
|
||||
<p> 
|
||||
At first, create Short-cut icon of your batch file.
|
||||
Name it to be something easy to understand like "Create PAR2".
|
||||
Then, put the Short-cut icon in your <tt>SendTo</tt> folder.
|
||||
You can open the <tt>SendTo</tt> folder by typing <tt>shell:sendto</tt> on path-box of Windows Explorer.
|
||||
</p>
|
||||
<p> 
|
||||
After you select a file or folder on Windows Explorer, click mouse's right button.
|
||||
Select "SendTo" item on the right-click menu.
|
||||
As your created Short-cut item will exist in the SendTo sub-menu, select the Short-cut icon.
|
||||
</p>
|
||||
<p> 
|
||||
If you want to specify multiple files or folders,
|
||||
select them at once on Windows Explorer.
|
||||
While mouse cursor over there, click mouse's right button.
|
||||
Later action is same as single item.
|
||||
</p>
|
||||
</li>
|
||||
</ol>
|
||||
</p>
|
||||
<p> 
|
||||
If you want to confirm the result of scripting,
|
||||
|
||||
@@ -51,7 +51,7 @@ There are command-line manuals in "<tt>help</tt>" folder.
|
||||
</table>
|
||||
|
||||
<hr>
|
||||
<small>last update 2023/11/11 for version 1.3.3.1</small>
|
||||
<small>last update 2024/04/13 for version 1.3.3.3</small>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -31,7 +31,14 @@ Be careful to use those special features.
|
||||
|
||||
<h3>System requirement</h3>
|
||||
<p> 
|
||||
MultiPar requires a PC with Windows Vista or later (Windows 7, 8, 10).
|
||||
MultiPar requires a PC with Windows Vista or later (Windows 7, 8, 10, 11).
|
||||
</p>
|
||||
|
||||
<h3>Usage manual or Help documents</h3>
|
||||
<p> 
|
||||
There are some usage manual or help documents in "help" folder.
|
||||
English pages exists in "help/0409" folder.
|
||||
You may open the manual by pushing "F1-key", while using MultiPar.
|
||||
</p>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
</table>
|
||||
|
||||
<hr>
|
||||
<small><EFBFBD>ŏI<EFBFBD>X<EFBFBD>V 2023/11/11 (<28>o<EFBFBD>[<5B>W<EFBFBD><57><EFBFBD><EFBFBD> 1.3.3.1)</small>
|
||||
<small><EFBFBD>ŏI<EFBFBD>X<EFBFBD>V 2024/04/13 (<28>o<EFBFBD>[<5B>W<EFBFBD><57><EFBFBD><EFBFBD> 1.3.3.3)</small>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -25,7 +25,14 @@ QuickPar
|
||||
|
||||
<h3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></h3>
|
||||
<p> 
|
||||
Windows Vista <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȍ~ (Windows 7, 8, 10) <20>̃p<CC83>\<5C>R<EFBFBD><52><EFBFBD><EFBFBD><EFBFBD>K<EFBFBD>v<EFBFBD>ł<EFBFBD><C582>B
|
||||
Windows Vista <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȍ~ (Windows 7, 8, 10, 11) <20>̃p<CC83>\<5C>R<EFBFBD><52><EFBFBD><EFBFBD><EFBFBD>K<EFBFBD>v<EFBFBD>ł<EFBFBD><C582>B
|
||||
</p>
|
||||
|
||||
<h3><EFBFBD>g<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></h3>
|
||||
<p> 
|
||||
<EFBFBD>قƂ<EFBFBD><EFBFBD>ljp<EFBFBD><EFBFBD><EFBFBD>ł<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ahelp <20>t<EFBFBD>H<EFBFBD><48><EFBFBD>_<EFBFBD>[<5B>̒<EFBFBD><CC92>Ɏg<C98E><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͂<EFBFBD><CD82><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ă܂<C482><DC82>B
|
||||
<EFBFBD><EFBFBD><EFBFBD>{<7B><><EFBFBD>̃y<CC83>[<5B>W<EFBFBD><57> help\0411 <20>t<EFBFBD>H<EFBFBD><48><EFBFBD>_<EFBFBD>[<5B>̒<EFBFBD><CC92>ɂ<EFBFBD><C982><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
|
||||
MultiPar <20>̎g<CC8E>p<EFBFBD><70><EFBFBD>ɁAF1-key <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƁA<C681>}<7D>j<EFBFBD><6A><EFBFBD>A<EFBFBD><41><EFBFBD><EFBFBD><EFBFBD>\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
|
||||
</p>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[ MultiPar GUI - version 1.3.3.0 or later ]
|
||||
[ MultiPar GUI - version 1.3.3.3 or later ]
|
||||
|
||||
Usage: MultiPar.exe [command] [/base path] [/list path] [files]
|
||||
|
||||
@@ -99,6 +99,11 @@ write a line of "RecoveryFileLimit=1" under "[Option]" section.
|
||||
It's same as an option:
|
||||
"Variable (limited to size of largest data file)" on QuickPar.
|
||||
|
||||
If you want to limit size of Recovery Files by a specific value,
|
||||
write a line of "RecoveryFileLimit=2" under "[Option]" section.
|
||||
"Limit Size to" value is enabled, even when "Split Files" isn't checked.
|
||||
This setting is useful, if you don't want to split source files.
|
||||
|
||||
If you want to enable "Most Resent Used List",
|
||||
write this line "MRUMax=5" under "[Path]" section.
|
||||
You may change the number of items after "MRUMax=".
|
||||
|
||||
BIN
alpha/par2j.exe
BIN
alpha/par2j.exe
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
// create.c
|
||||
// Copyright : 2023-12-12 Yutaka Sawada
|
||||
// Copyright : 2024-02-09 Yutaka Sawada
|
||||
// License : GPL
|
||||
|
||||
#ifndef _UNICODE
|
||||
@@ -1829,10 +1829,12 @@ int split_files(
|
||||
}
|
||||
if (ext_len > 0){ // 全て数字の拡張子を持つソース・ファイルがあるなら
|
||||
//printf_cp("\n risky name = %s \n", file_name);
|
||||
wcscpy(file_path, file_name); // 比較用に拡張子を取り除く
|
||||
file_path[name_len] = 0;
|
||||
for (num2 = 0; num2 < file_num; num2++){
|
||||
if (num2 == num)
|
||||
continue;
|
||||
if (_wcsnicmp(list_buf + files[num2].name, file_name, name_len) == 0){
|
||||
if (_wcsicmp(list_buf + files[num2].name, file_path) == 0){
|
||||
//printf_cp(" match name = %s \n", list_buf + files[num2].name);
|
||||
num8 = (files[num2].size + (__int64)split_size - 1) / split_size;
|
||||
split_max = (int)num8;
|
||||
@@ -1843,7 +1845,7 @@ int split_files(
|
||||
if (((split_max < 1000) && (ext_len >= 5)) || ((split_max < 10000) && (ext_len >= 6)))
|
||||
continue; // 拡張子の桁数が異なる
|
||||
// 上書きする危険性があるのでエラーにする
|
||||
printf_cp("split bad file, %s\n", file_name);
|
||||
printf_cp("split bad file, %s\n", list_buf + files[num2].name);
|
||||
*cur_num = -1;
|
||||
*cur_id = 0;
|
||||
return 1;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// lib_opencl.c
|
||||
// Copyright : 2023-12-26 Yutaka Sawada
|
||||
// Copyright : 2024-01-21 Yutaka Sawada
|
||||
// License : GPL
|
||||
|
||||
#ifndef _WIN32_WINNT
|
||||
@@ -75,7 +75,7 @@ typedef cl_int (CL_API_CALL *API_clEnqueueNDRangeKernel)(cl_command_queue, cl_ke
|
||||
extern unsigned int cpu_flag; // declared in common2.h
|
||||
extern int cpu_num;
|
||||
|
||||
#define MAX_DEVICE 3
|
||||
#define MAX_DEVICE 8
|
||||
|
||||
HMODULE hLibOpenCL = NULL;
|
||||
|
||||
@@ -235,6 +235,8 @@ int init_OpenCL(unsigned int unit_size, int *src_max)
|
||||
ret = fn_clGetPlatformIDs(MAX_DEVICE, platform_id, &num_platforms);
|
||||
if (ret != CL_SUCCESS)
|
||||
return (ret << 8) | 10;
|
||||
if (num_platforms > MAX_DEVICE)
|
||||
num_platforms = MAX_DEVICE;
|
||||
if (OpenCL_method & 0x200){ // 選択する順序と初期値を変える
|
||||
gpu_power = INT_MIN;
|
||||
} else {
|
||||
@@ -254,6 +256,8 @@ int init_OpenCL(unsigned int unit_size, int *src_max)
|
||||
// 環境内の OpenCL 対応機器の数
|
||||
if (fn_clGetDeviceIDs(platform_id[i], CL_DEVICE_TYPE_GPU, MAX_DEVICE, device_id, &num_devices) != CL_SUCCESS)
|
||||
continue;
|
||||
if (num_devices > MAX_DEVICE)
|
||||
num_devices = MAX_DEVICE;
|
||||
|
||||
for (j = 0; j < (int)num_devices; j++){
|
||||
// デバイスが利用可能か確かめる
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
1 RT_STRING ".\\source.cl"
|
||||
|
||||
1 VERSIONINFO
|
||||
FILEVERSION 1,3,3,2
|
||||
FILEVERSION 1,3,3,3
|
||||
PRODUCTVERSION 1,3,3,0
|
||||
FILEOS 0x40004
|
||||
FILETYPE 0x1
|
||||
@@ -13,7 +13,7 @@ BLOCK "StringFileInfo"
|
||||
VALUE "FileDescription", "PAR2 client"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2024 Yutaka Sawada"
|
||||
VALUE "ProductName", "par2j"
|
||||
VALUE "FileVersion", "1.3.3.2"
|
||||
VALUE "FileVersion", "1.3.3.3"
|
||||
VALUE "ProductVersion", "1.3.3.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// verify.c
|
||||
// Copyright : 2022-10-14 Yutaka Sawada
|
||||
// Copyright : 2024-06-09 Yutaka Sawada
|
||||
// License : GPL
|
||||
|
||||
#ifndef _UNICODE
|
||||
@@ -1253,21 +1253,22 @@ static int search_block_slide(
|
||||
slice_ctx *sc)
|
||||
{
|
||||
unsigned char *buf, hash[16], hash2[16], err_mag, *short_use;
|
||||
int i, j, find_num, find_flag, find_next, find_last, short_next;
|
||||
int i, j, find_num, find_flag, find_next, find_last, short_next, short2_next, tmp_next;
|
||||
int block_count, short_count, tiny_count, tiny_skip, num, i1, i2, i3, i4;
|
||||
int *order, *index, index_shift;
|
||||
unsigned int len, off, end_off, err_off;
|
||||
unsigned int prev_crc, fail_count, rear_off, overlap_count;
|
||||
unsigned int crc, *crcs, *short_crcs;
|
||||
unsigned int time_last, time_slide;
|
||||
__int64 file_off, file_next, short_off, fail_off;
|
||||
__int64 file_off, file_next, short_off, short2_off, tmp_off, fail_off;
|
||||
|
||||
if (file_size + 1 < last_off + (__int64)(sc->min_size))
|
||||
return 0; // 小さすぎるファイルは調べない
|
||||
find_num = 0; // このファイル内で何ブロック見つけたか
|
||||
find_next = -1; // 次に見つかると予想したブロックの番号
|
||||
find_last = -1; // 最後に見つけたブロックの番号 (-1=不明)
|
||||
short_next = -1;
|
||||
short_next = -1; // 予想される末尾ブロックの番号
|
||||
short2_next = -1;
|
||||
fail_count = 0; // CRC は一致したけど MD5 が違った回数
|
||||
fail_off = 0;
|
||||
rear_off = 0;
|
||||
@@ -1278,24 +1279,32 @@ static int search_block_slide(
|
||||
find_last = find_next - 1; // 最後に見つけたブロックの番号
|
||||
if ((last_off >= files[num1].size) || (last_off + block_size > file_size + 1))
|
||||
find_next = -1; // 予想位置がファイル・サイズを超えると駄目
|
||||
if ((last_size < block_size) && (files[num1].b_num >= 2) && // 末尾の半端なブロックの番号と想定位置
|
||||
(last_off < files[num1].size) && (files[num1].size <= file_size + 1)){
|
||||
short_next = files[num1].b_off + files[num1].b_num - 1; // 末尾ブロックの番号
|
||||
if (find_next == short_next)
|
||||
if ((last_size < block_size) && (last_off < files[num1].size)){ // 末尾の半端なブロックの番号と想定位置
|
||||
tmp_next = files[num1].b_off + files[num1].b_num - 1; // 末尾ブロックの番号
|
||||
if (find_next == tmp_next)
|
||||
find_next = -1; // 予想が重複したら末尾ブロックとして探す
|
||||
short_off = files[num1].size - last_size;
|
||||
// ファイルサイズが1ブロック未満でも、同じサイズならエラー訂正を試みる
|
||||
} else if ((last_off == 0) && (file_size == files[num1].size) && (file_size < (__int64)block_size)){
|
||||
short_off = 0;
|
||||
short_next = files[num1].b_off;
|
||||
if ((files[num1].b_num >= 2) && (files[num1].size <= file_size + 1)){ // 本来の位置を調べる
|
||||
short_next = tmp_next;
|
||||
short_off = files[num1].size - last_size;
|
||||
} else if ((last_off == 0) && (file_size == last_size)){ // ファイルが1ブロック未満でも、同じサイズならエラー訂正を試みる
|
||||
short_next = tmp_next;
|
||||
short_off = 0;
|
||||
}
|
||||
if (last_size < file_size){ // 末尾を調べる
|
||||
short2_next = tmp_next;
|
||||
short2_off = file_size - last_size;
|
||||
}
|
||||
}
|
||||
if (file_size > files[num1].size){
|
||||
rear_off = (unsigned int)((file_size - files[num1].size) % (__int64)block_size);
|
||||
} else if (file_size < files[num1].size){
|
||||
rear_off = block_size - (unsigned int)((files[num1].size - file_size) % (__int64)block_size);
|
||||
}
|
||||
//printf("file = %d, find_next = %d, find_last = %d\n", num1, find_next, find_last);
|
||||
//printf("short_off = %I64d, short_next = %d, rear_off = %d\n", short_off, short_next, rear_off);
|
||||
/* printf("file = %d, find_next = %d, find_last = %d, rear_off = %d\n", num1, find_next, find_last, rear_off);
|
||||
if (short_next >= 0)
|
||||
printf("short_off = %I64d, short_next = %d\n", short_off, short_next);
|
||||
if (short2_next >= 0)
|
||||
printf("short2_off = %I64d, short2_next = %d\n", short2_off, short2_next);*/
|
||||
}
|
||||
file_off = last_off; // 検査開始位置から調べる
|
||||
buf = sc->buf;
|
||||
@@ -1374,8 +1383,11 @@ static int search_block_slide(
|
||||
if (last_off < file_off + last_size)
|
||||
last_off = file_off + last_size; // 一番大きな半端なブロックの終端
|
||||
find_next = -2; // 小さなファイルが見つかった = ブロック検出の予想が外れた
|
||||
if (i == short_next)
|
||||
short_next = -1; // 末尾ブロックは検出済み
|
||||
if (i == short_next){ // この末尾ブロックは検出済み
|
||||
short_next = -1;
|
||||
} else if (i == short2_next){
|
||||
short2_next = -1;
|
||||
}
|
||||
|
||||
// 経過表示
|
||||
if (GetTickCount() - time_last >= UPDATE_TIME){
|
||||
@@ -1416,7 +1428,7 @@ static int search_block_slide(
|
||||
|
||||
// ブロック・サイズごとに探す
|
||||
if (((block_count > 0) && ((file_off + (__int64)block_size <= file_size)
|
||||
|| (find_next >= 0))) || (short_next >= 0)){ // ブロックの位置を予想して探す
|
||||
|| (find_next >= 0))) || (short_next >= 0) || (short2_next >= 0)){ // ブロックの位置を予想して探す
|
||||
// 前からスライドさせながらチェックサムを比較する
|
||||
//printf("slide search from %I64d, file %d, next = %d\n", file_off, num1, find_next);
|
||||
off = 0; // buf 内でのオフセット
|
||||
@@ -1445,8 +1457,13 @@ static int search_block_slide(
|
||||
while (off < end_off){
|
||||
find_flag = -2;
|
||||
// 次の番号のブロックがその位置にあるかを先に調べる (発見済みでも)
|
||||
if ((short_next >= 0) && (file_off + off == short_off)){ // 半端なブロックなら
|
||||
i = short_next;
|
||||
if (((short_next >= 0) && (file_off + off == short_off)) ||
|
||||
((short2_next >= 0) && (file_off + off == short2_off))){ // 半端なブロックなら
|
||||
if ((short_next >= 0) && (file_off + off == short_off)){
|
||||
i = short_next;
|
||||
} else {
|
||||
i = short2_next;
|
||||
}
|
||||
num = s_blk[i].file;
|
||||
if ((short_use[num] & 4) == 0){ // パディング部分を取り除いた CRC-32 を逆算する
|
||||
short_crcs[num] = crc_reverse_zero(s_blk[i].crc, block_size - s_blk[i].size);
|
||||
@@ -1456,7 +1473,8 @@ static int search_block_slide(
|
||||
find_flag = correct_error(buf + off, s_blk[i].size, s_blk[i].hash, short_crcs[num], &err_off, &err_mag);
|
||||
if (find_flag == 0)
|
||||
find_flag = 2;
|
||||
} else if ((find_next >= 0) && (file_off + off == last_off)){ // フルサイズのブロックなら
|
||||
}
|
||||
if ((find_flag < 0) && (find_next >= 0) && (file_off + off == last_off)){ // フルサイズのブロックなら
|
||||
i = find_next;
|
||||
if (crc == s_blk[i].crc){
|
||||
data_md5(buf + off, block_size, hash);
|
||||
@@ -1661,20 +1679,81 @@ static int search_block_slide(
|
||||
find_next = i + 1;
|
||||
if ((find_next >= source_num) || (s_blk[find_next].file != num)){
|
||||
// 最後までいった、またはファイルが異なる
|
||||
short_next = -1;
|
||||
find_next = -1;
|
||||
if ((short_next >= 0) && ((s_blk[short_next].exist & 0x1000) != 0))
|
||||
short_next = -1;
|
||||
if ((short2_next >= 0) && ((s_blk[short2_next].exist & 0x1000) != 0))
|
||||
short2_next = -1;
|
||||
} else if (s_blk[find_next].size < block_size){ // 半端なブロックは別に調べる
|
||||
short_next = find_next;
|
||||
short_off = file_off + off + block_size;
|
||||
//printf("short_off = %I64d, short_next = %d, file = %d\n", short_off, short_next, num);
|
||||
if (file_off + off + block_size + s_blk[find_next].size <= file_size){ // ファイル内に収まってる時だけ
|
||||
tmp_next = find_next;
|
||||
tmp_off = file_off + off + block_size;
|
||||
if (find_flag <= 3){ // 順当な位置で見つけた場合
|
||||
if ((tmp_next == short_next) && (tmp_off == short_off)){
|
||||
// 予測済みのと一致するなら何もしない
|
||||
} else if ((short_next >= 0) && (short2_next < 0)){ // 予測と異なるけど、別のが空いてるなら、そっちに記録する
|
||||
//printf("short2_off = %I64d, short2_next = %d, file = %d\n", tmp_off, tmp_next, num);
|
||||
short2_next = tmp_next;
|
||||
short2_off = tmp_off;
|
||||
} else {
|
||||
if ((short_next >= 0) && (tmp_next == short2_next) && (tmp_off == short2_off)){ // 既に予測済みのと一致するなら入れ替える
|
||||
short2_next = short_next;
|
||||
short2_off = short_off;
|
||||
//printf("exchange short2_off = %I64d, short2_next = %d\n", short2_off, short2_next);
|
||||
}
|
||||
//printf("short_off = %I64d, short_next = %d, file = %d\n", tmp_off, tmp_next, num);
|
||||
short_next = tmp_next;
|
||||
short_off = tmp_off;
|
||||
}
|
||||
} else if ((short_next < 0) &&
|
||||
(((__int64)block_size * (__int64)(tmp_next - files[num].b_off) == tmp_off) ||
|
||||
(tmp_off + s_blk[tmp_next].size == file_size))){
|
||||
// 検出ブロックが順当でなくても、末尾ブロックの開始位置や末端がファイル・サイズに一致すれば
|
||||
//printf("short_off = %I64d, short_next = %d, file = %d\n", tmp_off, tmp_next, num);
|
||||
short_next = tmp_next;
|
||||
short_off = tmp_off;
|
||||
} else {
|
||||
//printf("short2_off = %I64d, short2_next = %d, file = %d\n", tmp_off, tmp_next, num);
|
||||
short2_next = tmp_next;
|
||||
short2_off = tmp_off;
|
||||
}
|
||||
}
|
||||
find_next = -1;
|
||||
} else {
|
||||
short_next = files[num].b_off + files[num].b_num - 1; // 末尾ブロックの番号
|
||||
if (s_blk[short_next].size < block_size){ // 半端なブロックは別に調べる
|
||||
short_off = file_off + off + (__int64)(short_next - i) * (__int64)block_size;
|
||||
//printf("short_off = %I64d, short_next = %d, file = %d\n", short_off, short_next, num);
|
||||
} else {
|
||||
short_next = -1;
|
||||
tmp_next = files[num].b_off + files[num].b_num - 1; // 末尾ブロックの番号
|
||||
if (s_blk[tmp_next].size < block_size){ // 半端なブロックは別に調べる
|
||||
tmp_off = file_off + off + (__int64)(tmp_next - i) * (__int64)block_size;
|
||||
if (tmp_off + s_blk[tmp_next].size <= file_size){ // ファイル内に収まってる時だけ
|
||||
if (find_flag <= 3){ // 順当な位置で見つけた場合
|
||||
if ((tmp_next == short_next) && (tmp_off == short_off)){
|
||||
// 予測済みのと一致するなら何もしない
|
||||
} else if ((short_next >= 0) && (short2_next < 0)){ // 予測と異なるけど、別のが空いてるなら、そっちに記録する
|
||||
//printf("far short2_off = %I64d, short2_next = %d, file = %d\n", tmp_off, tmp_next, num);
|
||||
short2_next = tmp_next;
|
||||
short2_off = tmp_off;
|
||||
} else {
|
||||
if ((short_next >= 0) && (tmp_next == short2_next) && (tmp_off == short2_off)){ // 既に予測済みのと一致するなら入れ替える
|
||||
short2_next = short_next;
|
||||
short2_off = short_off;
|
||||
//printf("exchange short2_off = %I64d, short2_next = %d\n", short2_off, short2_next);
|
||||
}
|
||||
//printf("far short_off = %I64d, short_next = %d, file = %d\n", tmp_off, tmp_next, num);
|
||||
short_next = tmp_next;
|
||||
short_off = tmp_off;
|
||||
}
|
||||
} else if ((short_next < 0) &&
|
||||
(((__int64)block_size * (__int64)(tmp_next - files[num].b_off) == tmp_off) ||
|
||||
(tmp_off + s_blk[tmp_next].size == file_size))){
|
||||
// 検出ブロックが順当でなくても、末尾ブロックの開始位置や末端がファイル・サイズに一致すれば
|
||||
//printf("far short_off = %I64d, short_next = %d, file = %d\n", tmp_off, tmp_next, num);
|
||||
short_next = tmp_next;
|
||||
short_off = tmp_off;
|
||||
} else if ((short2_next != tmp_next) || (short2_off != tmp_off)){
|
||||
//printf("far short2_off = %I64d, short2_next = %d, file = %d\n", tmp_off, tmp_next, num);
|
||||
short2_next = tmp_next;
|
||||
short2_off = tmp_off;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
tiny_skip = 0; // 小さなファイルをブロック直後に一回だけ探す
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#define FILE_VERSION "1.3.3.2" // ファイルのバージョン番号
|
||||
#define FILE_VERSION "1.3.3.3" // ファイルのバージョン番号
|
||||
#define PRODUCT_VERSION "1.3.3" // 製品のバージョン番号
|
||||
|
||||
Reference in New Issue
Block a user