7 Commits
Author SHA1 Message Date
Tianjie Xu f80524611d Fix the unintialized value reported by msan
Intialize option_index in case it's not set by getopt_long.

Bug: 140493925
Test: blaze test pass
Change-Id: I0f93ef9e3061df2ef7813630d58972e1e0ea8286
2019-09-12 16:07:30 -07:00
Tianjie Xu 77833b6477 Allow bsdiff to accept multiple compressors
We modified the patch writer to have the capability to produce the smallest
patch if multiple compressors are given. This type is supported for bsdf2
format only.

Example usage:
bsdiff --format=bsdf2 --type=bz2:brotli <src_file> <tgt_file> <patch_file>

Test: diff & patch an apk file

Change-Id: Icd4322f21975b82c5ee09f8feb9321f52c9813a4
2018-03-13 19:10:13 -07:00
Tianjie Xu 2e70b558e7 Rename the variable 'quality' to 'brotli_quality'
Right now the quality is only used in the brotli compressor. And it
would be ambiguous if we add another compressor in the future; since the
compressors may have different interpretion on the quality value.

Test: unit tests pass; run bsdiff
Change-Id: I23af06a135b2b47df5209171f7db0773ac02a326
2018-03-02 16:47:09 -08:00
Alex Deymo e790a3b766 Add flags to bsdiff main to generate the Endsley format.
This patch adds a format flag option in bsdiff main program to
support generating a patch in Endsley format from the command line.
This is helpful to generate patches for performance analysis of the
different settings and patch formats.

Bug: 71854816
Test: Ran bsdiff with --format=endsley

Change-Id: Iba4a3beb4b4cbb82ea1bd5b64d229b1aad871b37
2018-02-16 01:15:07 +01:00
Alex Deymo 4fd22ea8b7 Include missing copyright notices
Bug: None
Test: Still builds

Change-Id: If46080a84e3dc121c157310ff73846d16f6b8857
2018-02-15 16:16:04 +01:00
Alex Deymo 383f677d7e Allow to set the minimum required match length.
The minimum required match length plays an important role in the
current algorithm. This algorithm requires that the current match
has at least 8 mismatches over a region where we find a new match,
therefore imposing a minimum match length of at least 8 bytes.
This patch allows to increase this minium value to avoid using small
matches that only match a very small region. A larger value can
improve the patch size, depending on the data, but a too large value
will cause the algorithm to miss matches that were otherwise benefical.

Bug: 73107113
Test: Added unittests. Ran it with different minlen values.

Change-Id: Iac594fc1cd7ecd5cfdc676bdb6ebe7c626de6dcd
2018-02-12 17:20:51 +01:00
Tianjie Xu 1f1cdb2b6b Add an argument parser in bsdiff
Add a parser of format, type and quality in the bsdiff main function.
This allow the bsdiff binary to choose between the BSDFF40|BSDF2 patch
format and compress the patch with desired algorithms.

Bug: 34220646
Test: unittest pass; generate brotli compressed patches with bsdiff
binary
Change-Id: Ia4f7941e4eca7e6047e2749315127d1cf4a988ee
2018-01-18 12:32:09 -08:00