[cmp] update Bled to latest

* This should increase the write speed when writing compressed images...
This commit is contained in:
Pete Batard 2020-02-04 12:09:47 +00:00
parent 177c85c4fe
commit 50d119ba0b
No known key found for this signature in database
GPG Key ID: 38E0CF5E69EDD671
7 changed files with 21 additions and 24 deletions

View File

@ -67,7 +67,7 @@
#define RETVAL_OBSOLETE_INPUT (dbg("%d", __LINE__), -7)
/* Other housekeeping constants */
#define IOBUF_SIZE 4096
#define IOBUF_SIZE BB_BUFSIZE
/* This is what we know about each Huffman coding group */
struct group_data {

View File

@ -49,7 +49,7 @@ typedef struct huft_t {
enum {
/* gunzip_window size--must be a power of two, and
* at least 32K for zip's deflate method */
GUNZIP_WSIZE = 0x8000,
GUNZIP_WSIZE = BB_BUFSIZE,
/* If BMAX needs to be larger than 16, then h and x[] should be ulg. */
BMAX = 16, /* maximum bit length of any code (16 for explode) */
N_MAX = 288, /* maximum number of codes in any set */
@ -128,9 +128,7 @@ typedef struct state_t {
#define gunzip_bb (S()gunzip_bb )
#define gunzip_bk (S()gunzip_bk )
#define to_read (S()to_read )
// #define bytebuffer_max (S()bytebuffer_max )
// Both gunzip and unzip can use constant buffer size now (16k):
#define bytebuffer_max 0x4000
#define bytebuffer_max BB_BUFSIZE
#define bytebuffer (S()bytebuffer )
#define bytebuffer_offset (S()bytebuffer_offset )
#define bytebuffer_size (S()bytebuffer_size )

View File

@ -29,10 +29,10 @@
/* Default input buffer size */
#define IBUFSIZ 2048
#define IBUFSIZ BB_BUFSIZE
/* Default output buffer size */
#define OBUFSIZ 2048
#define OBUFSIZ BB_BUFSIZE
/* Defines for third byte of header */
#define BIT_MASK 0x1f /* Mask for 'number of compresssion bits' */

View File

@ -33,7 +33,7 @@ typedef struct {
/* Had provisions for variable buffer, but we don't need it here */
/* int buffer_size; */
#define RC_BUFFER_SIZE 0x10000
#define RC_BUFFER_SIZE BB_BUFSIZE
uint32_t code;
uint32_t range;

View File

@ -1,7 +1,7 @@
/*
* unxz implementation for Bled/busybox
*
* Copyright © 2014-2015 Pete Batard <pete@akeo.ie>
* Copyright © 2014-2020 Pete Batard <pete@akeo.ie>
* Based on xz-embedded © Lasse Collin <lasse.collin@tukaani.org> - Public Domain
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
@ -14,6 +14,8 @@
// We get XZ_OPTIONS_ERROR in xz_dec_stream if this is not defined
#define XZ_DEC_ANY_CHECK
#define XZ_BUFSIZE BB_BUFSIZE
#include "xz_dec_bcj.c"
#include "xz_dec_lzma2.c"
#include "xz_dec_stream.c"
@ -49,26 +51,26 @@ IF_DESKTOP(long long) int FAST_FUNC unpack_xz_stream(transformer_state_t *xstate
if (!s)
bb_error_msg_and_err("memory allocation error");
in = xmalloc(BUFSIZ);
out = xmalloc(BUFSIZ);
in = xmalloc(XZ_BUFSIZE);
out = xmalloc(XZ_BUFSIZE);
b.in = in;
b.in_pos = 0;
b.in_size = 0;
b.out = out;
b.out_pos = 0;
b.out_size = BUFSIZ;
b.out_size = XZ_BUFSIZE;
while (true) {
if (b.in_pos == b.in_size) {
b.in_size = safe_read(xstate->src_fd, in, BUFSIZ);
b.in_size = safe_read(xstate->src_fd, in, XZ_BUFSIZE);
if ((int)b.in_size < 0)
bb_error_msg_and_err("read error (errno: %d)", errno);
b.in_pos = 0;
}
ret = xz_dec_run(s, &b);
if (b.out_pos == BUFSIZ) {
if (b.out_pos == XZ_BUFSIZE) {
nwrote = transformer_write(xstate, b.out, b.out_pos);
if (nwrote == -ENOSPC) {
ret = XZ_BUF_FULL;

View File

@ -2,7 +2,7 @@
* Library header for busybox/Bled
*
* Rewritten for Bled (Base Library for Easy Decompression)
* Copyright © 2014-2015 Pete Batard <pete@akeo.ie>
* Copyright © 2014-2020 Pete Batard <pete@akeo.ie>
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
@ -39,10 +39,7 @@
#include <sys/types.h>
#include <io.h>
#ifdef BUFSIZ
#undef BUFSIZ
#endif
#define BUFSIZ 65536
#define BB_BUFSIZE 0x40000
#define IF_DESKTOP(x) x
#define IF_NOT_DESKTOP(x)

View File

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 232, 326
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 3.9.1599"
CAPTION "Rufus 3.9.1600"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -394,8 +394,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,9,1599,0
PRODUCTVERSION 3,9,1599,0
FILEVERSION 3,9,1600,0
PRODUCTVERSION 3,9,1600,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -413,13 +413,13 @@ BEGIN
VALUE "Comments", "https://rufus.ie"
VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.9.1599"
VALUE "FileVersion", "3.9.1600"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2020 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
VALUE "OriginalFilename", "rufus-3.9.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.9.1599"
VALUE "ProductVersion", "3.9.1600"
END
END
BLOCK "VarFileInfo"