summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh MacDonald <josh.macdonald@gmail.com>2015-11-13 20:54:34 -0800
committerJosh MacDonald <josh.macdonald@gmail.com>2015-11-13 20:54:34 -0800
commit97a6543f64e84821b638a60c88c814c2bdcdfc60 (patch)
treea2bcec150a317cf90b8239118a2b0815a73bd6f9
parent336f37f35beee264c22f7ce9baca1300bc292aa5 (diff)
Experimental change in srcwin_move_point
-rw-r--r--xdelta3/Makefile.am6
-rw-r--r--xdelta3/xdelta3.c16
2 files changed, 16 insertions, 6 deletions
diff --git a/xdelta3/Makefile.am b/xdelta3/Makefile.am
index 662ff02..6ab3a42 100644
--- a/xdelta3/Makefile.am
+++ b/xdelta3/Makefile.am
@@ -59,7 +59,7 @@ endif
59#common_CFLAGS += -O2 59#common_CFLAGS += -O2
60 60
61# For additional debugging, add -DXD3_DEBUG=1, 2, 3, ... 61# For additional debugging, add -DXD3_DEBUG=1, 2, 3, ...
62xdelta3_CFLAGS = $(C_WFLAGS) $(common_CFLAGS) -DXD3_DEBUG=0 62xdelta3_CFLAGS = $(C_WFLAGS) $(common_CFLAGS) -DXD3_DEBUG=1
63xdelta3_LDADD = -lm 63xdelta3_LDADD = -lm
64 64
65xdelta3decode_CFLAGS = \ 65xdelta3decode_CFLAGS = \
@@ -75,9 +75,9 @@ xdelta3decode_CFLAGS = \
75 -DVCDIFF_TOOLS=0 75 -DVCDIFF_TOOLS=0
76 76
77xdelta3regtest_CXXFLAGS = \ 77xdelta3regtest_CXXFLAGS = \
78 $(CXX_WFLAGS) $(common_CFLAGS) -DNOT_MAIN=1 -DXD3_DEBUG=1 78 $(CXX_WFLAGS) $(common_CFLAGS) -DNOT_MAIN=1 -DXD3_DEBUG=2
79xdelta3regtest_CFLAGS = \ 79xdelta3regtest_CFLAGS = \
80 $(C_WFLAGS) $(common_CFLAGS) -DNOT_MAIN=1 -DXD3_DEBUG=1 80 $(C_WFLAGS) $(common_CFLAGS) -DNOT_MAIN=1 -DXD3_DEBUG=2
81xdelta3regtest_LDADD = -lm 81xdelta3regtest_LDADD = -lm
82 82
83man1_MANS = xdelta3.1 83man1_MANS = xdelta3.1
diff --git a/xdelta3/xdelta3.c b/xdelta3/xdelta3.c
index 985aa7f..74889f2 100644
--- a/xdelta3/xdelta3.c
+++ b/xdelta3/xdelta3.c
@@ -4344,6 +4344,7 @@ static int
4344xd3_srcwin_move_point (xd3_stream *stream, usize_t *next_move_point) 4344xd3_srcwin_move_point (xd3_stream *stream, usize_t *next_move_point)
4345{ 4345{
4346 xoff_t logical_input_cksum_pos; 4346 xoff_t logical_input_cksum_pos;
4347 xoff_t absolute_input_pos;
4347 xoff_t source_size; 4348 xoff_t source_size;
4348 4349
4349 if (stream->src->eof_known) 4350 if (stream->src->eof_known)
@@ -4358,11 +4359,20 @@ xd3_srcwin_move_point (xd3_stream *stream, usize_t *next_move_point)
4358 } 4359 }
4359 } 4360 }
4360 4361
4362 absolute_input_pos = stream->total_in + stream->input_position;
4363
4361 /* Begin by advancing at twice the input rate, up to half the 4364 /* Begin by advancing at twice the input rate, up to half the
4362 * maximum window size. */ 4365 * maximum window size. */
4363 logical_input_cksum_pos = xd3_min((stream->total_in + stream->input_position) * 2, 4366#if 1
4364 (stream->total_in + stream->input_position) + 4367 if (absolute_input_pos < stream->src->max_winsize) {
4365 (stream->src->max_winsize / 2)); 4368 logical_input_cksum_pos = stream->src->max_winsize;
4369 } else {
4370 logical_input_cksum_pos = absolute_input_pos + stream->src->max_winsize / 2;
4371 }
4372#else
4373 logical_input_cksum_pos = xd3_min(absolute_input_pos * 2,
4374 absolute_input_pos + (stream->src->max_winsize / 2));
4375#endif
4366 4376
4367 /* If srcwin_cksum_pos is already greater, wait until the difference 4377 /* If srcwin_cksum_pos is already greater, wait until the difference
4368 * is met. */ 4378 * is met. */