Changeset 9991
- Timestamp:
- 07/26/08 00:40:42 (5 years ago)
- Location:
- src/linux/sl2312/linux-2.6.23
- Files:
-
- 6 edited
-
Makefile (modified) (1 diff)
-
arch/arm/Makefile (modified) (1 diff)
-
arch/arm/boot/compressed/LzmaDecode.c (modified) (19 diffs)
-
arch/arm/boot/compressed/LzmaDecode.h (modified) (3 diffs)
-
arch/arm/boot/compressed/Makefile (modified) (1 diff)
-
arch/arm/boot/compressed/misc_lzma.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/linux/sl2312/linux-2.6.23/Makefile
r9980 r9991 182 182 183 183 ARCH = $(SUBARCH) 184 CROSS_COMPILE = arm eb-linux-uclibc-184 CROSS_COMPILE = arm-linux-uclibc- 185 185 186 186 # Architecture as present in compile.h -
src/linux/sl2312/linux-2.6.23/arch/arm/Makefile
r9980 r9991 13 13 LDFLAGS_vmlinux :=-p --no-undefined -X 14 14 CPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET) 15 OBJCOPYFLAGS :=-O binary -R .note -R .comment -S 15 OBJCOPYFLAGS :=-O binary -R .note -R .note.gnu.build-id -R .comment -S 16 #OBJCOPYFLAGS :=-O binary -R .note -R .comment -S 16 17 GZFLAGS :=-9 17 18 #CFLAGS +=-pipe -
src/linux/sl2312/linux-2.6.23/arch/arm/boot/compressed/LzmaDecode.c
r9980 r9991 1 1 /* 2 LzmaDecode Size.c3 LZMA Decoder (optimized for Size version)2 LzmaDecode.c 3 LZMA Decoder 4 4 5 LZMA SDK 4. 40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)5 LZMA SDK 4.05 Copyright (c) 1999-2004 Igor Pavlov (2004-08-25) 6 6 http://www.7-zip.org/ 7 7 … … 22 22 #include "LzmaDecode.h" 23 23 24 #ifndef Byte 25 #define Byte unsigned char 26 #endif 27 24 28 #define kNumTopBits 24 25 29 #define kTopValue ((UInt32)1 << kNumTopBits) … … 31 35 typedef struct _CRangeDecoder 32 36 { 33 constByte *Buffer;34 constByte *BufferLim;37 Byte *Buffer; 38 Byte *BufferLim; 35 39 UInt32 Range; 36 40 UInt32 Code; 37 41 #ifdef _LZMA_IN_CB 38 ILzmaInCallback *InCallback;39 42 int Result; 40 43 #endif … … 47 50 { 48 51 #ifdef _LZMA_IN_CB 49 SizeTsize;50 rd->Result = r d->InCallback->Read(rd->InCallback,&rd->Buffer, &size);52 UInt32 size; 53 rd->Result = read_byte(&rd->Buffer, &size); 51 54 rd->BufferLim = rd->Buffer + size; 52 55 if (size == 0) … … 63 66 #define ReadByte (RangeDecoderReadByte(rd)) 64 67 65 void RangeDecoderInit(CRangeDecoder *rd 66 #ifndef _LZMA_IN_CB 67 , const Byte *stream, SizeT bufferSize 68 #endif 69 ) 68 void RangeDecoderInit(CRangeDecoder *rd) 70 69 { 71 70 int i; … … 92 91 UInt32 result = 0; 93 92 int i; 94 for (i = numTotalBits; i !=0; i--)93 for (i = numTotalBits; i > 0; i--) 95 94 { 96 95 /* UInt32 t; */ … … 160 159 RC_INIT_VAR 161 160 #endif 162 for(i = numLevels; i !=0; i--)161 for(i = numLevels; i > 0; i--) 163 162 { 164 163 #ifdef _LZMA_LOC_OPT … … 235 234 #ifdef _LZMA_LOC_OPT 236 235 { 237 CProb *prob = probs + 0x100 + (matchBit<< 8) + symbol;236 CProb *prob = probs + ((1 + matchBit) << 8) + symbol; 238 237 RC_GET_BIT2(prob, symbol, bit = 0, bit = 1) 239 238 } 240 239 #else 241 bit = RangeDecoderBitDecode(probs + 0x100 + (matchBit<< 8) + symbol, rd);240 bit = RangeDecoderBitDecode(probs + ((1 + matchBit) << 8) + symbol, rd); 242 241 symbol = (symbol << 1) | bit; 243 242 #endif … … 293 292 294 293 #define kNumStates 12 295 #define kNumLitStates 7296 294 297 295 #define kStartPosModelIndex 4 … … 324 322 #endif 325 323 326 int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsData, int size) 327 { 328 unsigned char prop0; 329 if (size < LZMA_PROPERTIES_SIZE) 330 return LZMA_RESULT_DATA_ERROR; 331 prop0 = propsData[0]; 332 if (prop0 >= (9 * 5 * 5)) 333 return LZMA_RESULT_DATA_ERROR; 334 { 335 for (propsRes->pb = 0; prop0 >= (9 * 5); propsRes->pb++, prop0 -= (9 * 5)); 336 for (propsRes->lp = 0; prop0 >= 9; propsRes->lp++, prop0 -= 9); 337 propsRes->lc = prop0; 338 /* 339 unsigned char remainder = (unsigned char)(prop0 / 9); 340 propsRes->lc = prop0 % 9; 341 propsRes->pb = remainder / 5; 342 propsRes->lp = remainder % 5; 343 */ 344 } 345 346 #ifdef _LZMA_OUT_READ 347 { 348 int i; 349 propsRes->DictionarySize = 0; 350 for (i = 0; i < 4; i++) 351 propsRes->DictionarySize += (UInt32)(propsData[1 + i]) << (i * 8); 352 if (propsRes->DictionarySize == 0) 353 propsRes->DictionarySize = 1; 354 } 355 #endif 324 #ifdef _LZMA_OUT_READ 325 326 typedef struct _LzmaVarState 327 { 328 CRangeDecoder RangeDecoder; 329 Byte *Dictionary; 330 UInt32 DictionarySize; 331 UInt32 DictionaryPos; 332 UInt32 GlobalPos; 333 UInt32 Reps[4]; 334 int lc; 335 int lp; 336 int pb; 337 int State; 338 int PreviousIsMatch; 339 int RemainLen; 340 } LzmaVarState; 341 342 int LzmaDecoderInit( 343 unsigned char *buffer, UInt32 bufferSize, 344 int lc, int lp, int pb, 345 unsigned char *dictionary, UInt32 dictionarySize, 346 ) 347 { 348 LzmaVarState *vs = (LzmaVarState *)buffer; 349 CProb *p = (CProb *)(buffer + sizeof(LzmaVarState)); 350 UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + lp)); 351 UInt32 i; 352 if (bufferSize < numProbs * sizeof(CProb) + sizeof(LzmaVarState)) 353 return LZMA_RESULT_NOT_ENOUGH_MEM; 354 vs->Dictionary = dictionary; 355 vs->DictionarySize = dictionarySize; 356 vs->DictionaryPos = 0; 357 vs->GlobalPos = 0; 358 vs->Reps[0] = vs->Reps[1] = vs->Reps[2] = vs->Reps[3] = 1; 359 vs->lc = lc; 360 vs->lp = lp; 361 vs->pb = pb; 362 vs->State = 0; 363 vs->PreviousIsMatch = 0; 364 vs->RemainLen = 0; 365 dictionary[dictionarySize - 1] = 0; 366 for (i = 0; i < numProbs; i++) 367 p[i] = kBitModelTotal >> 1; 368 RangeDecoderInit(&vs->RangeDecoder, 369 ); 356 370 return LZMA_RESULT_OK; 357 371 } 358 372 359 #define kLzmaStreamWasFinishedId (-1) 360 361 int LzmaDecode(CLzmaDecoderState *vs, 362 #ifdef _LZMA_IN_CB 363 ILzmaInCallback *InCallback, 364 #else 365 const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed, 366 #endif 367 unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed) 368 { 369 CProb *p = vs->Probs; 370 SizeT nowPos = 0; 371 Byte previousByte = 0; 372 UInt32 posStateMask = (1 << (vs->Properties.pb)) - 1; 373 UInt32 literalPosMask = (1 << (vs->Properties.lp)) - 1; 374 int lc = vs->Properties.lc; 375 CRangeDecoder rd; 376 377 #ifdef _LZMA_OUT_READ 378 373 int LzmaDecode(unsigned char *buffer, 374 unsigned char *outStream, UInt32 outSize, 375 UInt32 *outSizeProcessed) 376 { 377 LzmaVarState *vs = (LzmaVarState *)buffer; 378 CProb *p = (CProb *)(buffer + sizeof(LzmaVarState)); 379 CRangeDecoder rd = vs->RangeDecoder; 379 380 int state = vs->State; 381 int previousIsMatch = vs->PreviousIsMatch; 382 Byte previousByte; 380 383 UInt32 rep0 = vs->Reps[0], rep1 = vs->Reps[1], rep2 = vs->Reps[2], rep3 = vs->Reps[3]; 384 UInt32 nowPos = 0; 385 UInt32 posStateMask = (1 << (vs->pb)) - 1; 386 UInt32 literalPosMask = (1 << (vs->lp)) - 1; 387 int lc = vs->lc; 381 388 int len = vs->RemainLen; 382 389 UInt32 globalPos = vs->GlobalPos; 383 UInt32 distanceLimit = vs->DistanceLimit;384 390 385 391 Byte *dictionary = vs->Dictionary; 386 UInt32 dictionarySize = vs-> Properties.DictionarySize;392 UInt32 dictionarySize = vs->DictionarySize; 387 393 UInt32 dictionaryPos = vs->DictionaryPos; 388 394 389 Byte tempDictionary[4]; 390 391 rd.Range = vs->Range; 392 rd.Code = vs->Code; 393 #ifdef _LZMA_IN_CB 394 rd.InCallback = InCallback; 395 rd.Buffer = vs->Buffer; 396 rd.BufferLim = vs->BufferLim; 397 #else 398 rd.Buffer = inStream; 399 rd.BufferLim = inStream + inSize; 400 #endif 401 402 #ifndef _LZMA_IN_CB 403 *inSizeProcessed = 0; 404 #endif 405 *outSizeProcessed = 0; 406 if (len == kLzmaStreamWasFinishedId) 395 if (len == -1) 396 { 397 *outSizeProcessed = 0; 407 398 return LZMA_RESULT_OK; 408 409 if (dictionarySize == 0) 410 { 411 dictionary = tempDictionary; 412 dictionarySize = 1; 413 tempDictionary[0] = vs->TempDictionary[0]; 414 } 415 416 if (len == kLzmaNeedInitId) 417 { 418 { 419 UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp)); 420 UInt32 i; 421 for (i = 0; i < numProbs; i++) 422 p[i] = kBitModelTotal >> 1; 423 rep0 = rep1 = rep2 = rep3 = 1; 424 state = 0; 425 globalPos = 0; 426 distanceLimit = 0; 427 dictionaryPos = 0; 428 dictionary[dictionarySize - 1] = 0; 429 RangeDecoderInit(&rd 430 #ifndef _LZMA_IN_CB 431 , inStream, inSize 432 #endif 433 ); 434 #ifdef _LZMA_IN_CB 435 if (rd.Result != LZMA_RESULT_OK) 436 return rd.Result; 437 #endif 438 if (rd.ExtraBytes != 0) 439 return LZMA_RESULT_DATA_ERROR; 440 } 441 len = 0; 442 } 443 while(len != 0 && nowPos < outSize) 399 } 400 401 while(len > 0 && nowPos < outSize) 444 402 { 445 403 UInt32 pos = dictionaryPos - rep0; … … 455 413 else 456 414 previousByte = dictionary[dictionaryPos - 1]; 457 458 #ifdef _LZMA_IN_CB 459 rd.Result = LZMA_RESULT_OK; 460 #endif 461 rd.ExtraBytes = 0; 462 463 #else /* if !_LZMA_OUT_READ */ 464 415 #else 416 417 int LzmaDecode( 418 Byte *buffer, UInt32 bufferSize, 419 int lc, int lp, int pb, 420 unsigned char *outStream, UInt32 outSize, 421 UInt32 *outSizeProcessed) 422 { 423 UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + lp)); 424 CProb *p = (CProb *)buffer; 425 CRangeDecoder rd; 426 UInt32 i; 465 427 int state = 0; 428 int previousIsMatch = 0; 429 Byte previousByte = 0; 466 430 UInt32 rep0 = 1, rep1 = 1, rep2 = 1, rep3 = 1; 431 UInt32 nowPos = 0; 432 UInt32 posStateMask = (1 << pb) - 1; 433 UInt32 literalPosMask = (1 << lp) - 1; 467 434 int len = 0; 468 469 #ifndef _LZMA_IN_CB 470 *inSizeProcessed = 0; 471 #endif 435 if (bufferSize < numProbs * sizeof(CProb)) 436 return LZMA_RESULT_NOT_ENOUGH_MEM; 437 for (i = 0; i < numProbs; i++) 438 p[i] = kBitModelTotal >> 1; 439 RangeDecoderInit(&rd); 440 #endif 441 472 442 *outSizeProcessed = 0; 473 474 {475 UInt32 i;476 UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp));477 for (i = 0; i < numProbs; i++)478 p[i] = kBitModelTotal >> 1;479 }480 481 #ifdef _LZMA_IN_CB482 rd.InCallback = InCallback;483 #endif484 RangeDecoderInit(&rd485 #ifndef _LZMA_IN_CB486 , inStream, inSize487 #endif488 );489 490 #ifdef _LZMA_IN_CB491 if (rd.Result != LZMA_RESULT_OK)492 return rd.Result;493 #endif494 if (rd.ExtraBytes != 0)495 return LZMA_RESULT_DATA_ERROR;496 497 #endif /* _LZMA_OUT_READ */498 499 500 443 while(nowPos < outSize) 501 444 { … … 524 467 & literalPosMask) << lc) + (previousByte >> (8 - lc)))); 525 468 526 if (state >= kNumLitStates) 469 if (state < 4) state = 0; 470 else if (state < 10) state -= 3; 471 else state -= 6; 472 if (previousIsMatch) 527 473 { 528 474 Byte matchByte; … … 536 482 #endif 537 483 previousByte = LzmaLiteralDecodeMatch(probs, &rd, matchByte); 484 previousIsMatch = 0; 538 485 } 539 486 else … … 541 488 outStream[nowPos++] = previousByte; 542 489 #ifdef _LZMA_OUT_READ 543 if (distanceLimit < dictionarySize)544 distanceLimit++;545 546 490 dictionary[dictionaryPos] = previousByte; 547 491 if (++dictionaryPos == dictionarySize) 548 492 dictionaryPos = 0; 549 493 #endif 550 if (state < 4) state = 0;551 else if (state < 10) state -= 3;552 else state -= 6;553 494 } 554 495 else 555 496 { 497 previousIsMatch = 1; 556 498 if (RangeDecoderBitDecode(p + IsRep + state, &rd) == 1) 557 499 { … … 563 505 UInt32 pos; 564 506 #endif 565 566 #ifdef _LZMA_OUT_READ 567 if (distanceLimit == 0) 568 #else 569 if (nowPos == 0) 570 #endif 507 if ( 508 (nowPos 509 #ifdef _LZMA_OUT_READ 510 + globalPos 511 #endif 512 ) 513 == 0) 571 514 return LZMA_RESULT_DATA_ERROR; 572 573 515 state = state < 7 ? 9 : 11; 574 516 #ifdef _LZMA_OUT_READ … … 584 526 #endif 585 527 outStream[nowPos++] = previousByte; 586 587 #ifdef _LZMA_OUT_READ588 if (distanceLimit < dictionarySize)589 distanceLimit++;590 #endif591 528 continue; 592 529 } … … 643 580 else 644 581 rep0 = posSlot; 645 if (++rep0 == (UInt32)(0)) 646 { 647 /* it's for stream version */ 648 len = kLzmaStreamWasFinishedId; 649 break; 650 } 582 rep0++; 651 583 } 652 584 if (rep0 == (UInt32)(0)) 585 { 586 /* it's for stream version */ 587 len = -1; 588 break; 589 } 590 if (rep0 > nowPos 591 #ifdef _LZMA_OUT_READ 592 + globalPos 593 #endif 594 ) 595 { 596 return LZMA_RESULT_DATA_ERROR; 597 } 653 598 len += kMatchMinLen; 654 #ifdef _LZMA_OUT_READ655 if (rep0 > distanceLimit)656 #else657 if (rep0 > nowPos)658 #endif659 return LZMA_RESULT_DATA_ERROR;660 661 #ifdef _LZMA_OUT_READ662 if (dictionarySize - distanceLimit > (UInt32)len)663 distanceLimit += len;664 else665 distanceLimit = dictionarySize;666 #endif667 668 599 do 669 600 { … … 679 610 previousByte = outStream[nowPos - rep0]; 680 611 #endif 612 outStream[nowPos++] = previousByte; 681 613 len--; 682 outStream[nowPos++] = previousByte;683 614 } 684 while(len != 0 && nowPos < outSize); 685 } 686 } 687 615 while(len > 0 && nowPos < outSize); 616 } 617 } 688 618 689 619 #ifdef _LZMA_OUT_READ 690 vs->Range = rd.Range; 691 vs->Code = rd.Code; 620 vs->RangeDecoder = rd; 692 621 vs->DictionaryPos = dictionaryPos; 693 vs->GlobalPos = globalPos + (UInt32)nowPos; 694 vs->DistanceLimit = distanceLimit; 622 vs->GlobalPos = globalPos + nowPos; 695 623 vs->Reps[0] = rep0; 696 624 vs->Reps[1] = rep1; … … 698 626 vs->Reps[3] = rep3; 699 627 vs->State = state; 628 vs->PreviousIsMatch = previousIsMatch; 700 629 vs->RemainLen = len; 701 vs->TempDictionary[0] = tempDictionary[0]; 702 #endif 703 704 #ifdef _LZMA_IN_CB 705 vs->Buffer = rd.Buffer; 706 vs->BufferLim = rd.BufferLim; 707 #else 708 *inSizeProcessed = (SizeT)(rd.Buffer - inStream); 709 #endif 630 #endif 631 710 632 *outSizeProcessed = nowPos; 711 633 return LZMA_RESULT_OK; -
src/linux/sl2312/linux-2.6.23/arch/arm/boot/compressed/LzmaDecode.h
r9980 r9991 3 3 LZMA Decoder interface 4 4 5 LZMA SDK 4. 40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)5 LZMA SDK 4.05 Copyright (c) 1999-2004 Igor Pavlov (2004-08-25) 6 6 http://www.7-zip.org/ 7 7 … … 23 23 #define __LZMADECODE_H 24 24 25 #include "LzmaTypes.h"26 27 25 /* #define _LZMA_IN_CB */ 28 26 /* Use callback for input data */ … … 38 36 /* Enable local speed optimizations inside code */ 39 37 38 #ifndef UInt32 39 #ifdef _LZMA_UINT32_IS_ULONG 40 #define UInt32 unsigned long 41 #else 42 #define UInt32 unsigned int 43 #endif 44 #endif 45 40 46 #ifdef _LZMA_PROB32 41 47 #define CProb UInt32 42 48 #else 43 #define CProb UInt1649 #define CProb unsigned short 44 50 #endif 45 51 46 52 #define LZMA_RESULT_OK 0 47 53 #define LZMA_RESULT_DATA_ERROR 1 54 #define LZMA_RESULT_NOT_ENOUGH_MEM 2 48 55 49 #ifdef _LZMA_IN_CB50 typedef struct _ILzmaInCallback51 {52 int (*Read)(void *object, const unsigned char **buffer, SizeT *bufferSize);53 } ILzmaInCallback;54 #endif55 56 56 57 #define LZMA_BASE_SIZE 1846 57 58 #define LZMA_LIT_SIZE 768 58 59 59 #define LZMA_PROPERTIES_SIZE 5 60 61 typedef struct _CLzmaProperties 62 { 63 int lc; 64 int lp; 65 int pb; 66 #ifdef _LZMA_OUT_READ 67 UInt32 DictionarySize; 68 #endif 69 }CLzmaProperties; 70 71 int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsData, int size); 72 73 #define LzmaGetNumProbs(Properties) (LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((Properties)->lc + (Properties)->lp))) 74 75 #define kLzmaNeedInitId (-2) 76 77 typedef struct _CLzmaDecoderState 78 { 79 CLzmaProperties Properties; 80 CProb *Probs; 81 82 #ifdef _LZMA_IN_CB 83 const unsigned char *Buffer; 84 const unsigned char *BufferLim; 85 #endif 86 87 #ifdef _LZMA_OUT_READ 88 unsigned char *Dictionary; 89 UInt32 Range; 90 UInt32 Code; 91 UInt32 DictionaryPos; 92 UInt32 GlobalPos; 93 UInt32 DistanceLimit; 94 UInt32 Reps[4]; 95 int State; 96 int RemainLen; 97 unsigned char TempDictionary[4]; 98 #endif 99 } CLzmaDecoderState; 60 /* 61 bufferSize = (LZMA_BASE_SIZE + (LZMA_LIT_SIZE << (lc + lp)))* sizeof(CProb) 62 bufferSize += 100 in case of _LZMA_OUT_READ 63 by default CProb is unsigned short, 64 but if specify _LZMA_PROB_32, CProb will be UInt32(unsigned int) 65 */ 100 66 101 67 #ifdef _LZMA_OUT_READ 102 #define LzmaDecoderInit(vs) { (vs)->RemainLen = kLzmaNeedInitId; } 68 int LzmaDecoderInit( 69 unsigned char *buffer, UInt32 bufferSize, 70 int lc, int lp, int pb, 71 unsigned char *dictionary, UInt32 dictionarySize, 72 ); 103 73 #endif 104 74 105 int LzmaDecode(CLzmaDecoderState *vs, 106 #ifdef _LZMA_IN_CB 107 ILzmaInCallback *inCallback, 108 #else 109 const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed, 110 #endif 111 unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed); 75 int LzmaDecode( 76 unsigned char *buffer, 77 #ifndef _LZMA_OUT_READ 78 UInt32 bufferSize, 79 int lc, int lp, int pb, 80 #endif 81 unsigned char *outStream, UInt32 outSize, 82 UInt32 *outSizeProcessed); 112 83 113 84 #endif -
src/linux/sl2312/linux-2.6.23/arch/arm/boot/compressed/Makefile
r9980 r9991 78 78 targets := vmlinux vmlinux.lds piggy.lzma piggy.o font.o font.c \ 79 79 head.o misc_lzma.o print.o $(OBJS) 80 EXTRA_CFLAGS := -fpic -fno-builtin -O s80 EXTRA_CFLAGS := -fpic -fno-builtin -O2 81 81 EXTRA_AFLAGS := 82 82 -
src/linux/sl2312/linux-2.6.23/arch/arm/boot/compressed/misc_lzma.c
r9980 r9991 149 149 150 150 #define _LZMA_IN_CB 151 151 152 #include "LzmaDecode.h" 153 static __inline__ int read_byte(unsigned char **buffer, UInt32 *bufferSize); 152 154 #include "LzmaDecode.c" 153 154 static int read_byte(void *object, const unsigned char **buffer, SizeT *bufferSize);155 155 156 156 … … 162 162 163 163 unsigned int i; 164 CLzmaDecoderState state;165 164 unsigned int uncompressedSize = 0; 166 167 ILzmaInCallback callback; 168 callback.Read = read_byte; 165 unsigned char *workspace; 166 unsigned int lc,lp,pb; 169 167 170 168 // lzma args 171 169 i = get_byte(); 172 state.Properties.lc = i % 9, i = i / 9;173 state.Properties.lp = i % 5, state.Properties.pb = i / 5;170 lc = i % 9, i = i / 9; 171 lp = i % 5, pb = i / 5; 174 172 175 173 // skip dictionary size … … 181 179 (get_byte() << 16) + 182 180 (get_byte() << 24); 183 181 workspace = output_data + uncompressedSize; 184 182 // skip high order bytes 185 183 for (i = 0; i < 4; i++) 186 184 get_byte(); 187 // point it beyond uncompresedSize188 state.Probs = (CProb*) (output_data + uncompressedSize);189 185 // decompress kernel 190 if (LzmaDecode( &state, &callback, 191 (unsigned char*)output_data, uncompressedSize, &i) == LZMA_RESULT_OK) 186 // if (LzmaDecode(workspace, ~0, lc, lp, pb, 187 // (unsigned char*)LOADADDR, osize, &i) == LZMA_RESULT_OK) 188 if (LzmaDecode(workspace, ~0, lc,lp,pb,(unsigned char*)output_data, uncompressedSize, &i) == LZMA_RESULT_OK) 192 189 { 193 190 if ( i != uncompressedSize ) … … 203 200 204 201 static unsigned int icnt = 0; 205 static int read_byte(void *object, const unsigned char **buffer, SizeT*bufferSize)202 static __inline__ int read_byte(unsigned char **buffer, UInt32 *bufferSize) 206 203 { 207 204 static unsigned char val;
Note: See TracChangeset
for help on using the changeset viewer.
