• Stars
    star
    109
  • Rank 319,077 (Top 7 %)
  • Language
    C
  • License
    Other
  • Created almost 12 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

lzmaSDK is an iOS port of the decoding logic from the LZMA SDK provided with 7zip
This directory contains the LZMA SDK customized for an embedded system (iPhone/iOS)
Only the file extraction logic was included, all code related to creating
compressed streams was removed. CRC validation was removed to
improve performance. In addition, large file support was added so that iOS
is able to decompress files as large as 650 megs using memory mapped IO.
This code is based on lzma release 9.22 beta.

Note that when incorporating the code into a new project, copy only the
LZMASDK directory in the Classes subdir into your iOS project. All of the
other files in this example iOS app exist just to illustrate how to use
the SDK code in the LZMASDK directory.

The code was modified as follows:

Embedded version does not need exe branch predictors.

Bra.c
Bcj2.c
Bra86.c

File List:

7zBuf.c
7zCrc.c
7zFile.c
7zStream.c
LzHash.h
LzmaDec.h
7zBuf.h
7zCrc.h
7zFile.h
7zVersion.h
CpuArch.h
LzmaDec.c
Types.h

Removed:

(XZ file format support)
Xz.*

MtCoder.c

Ppmd7Enc.c

Sha256.*

lzma Search (encode) functions

rm LzFind*

rm Threads.*

rm Bra*

rm Bcj2.*

rm lzmaEnc* lzma2Enc.*

The 7z.h and 7zIn.c files were modified to support memory mapping the dictionary
cache file so that large files can be decompressed without having to break archives
up into blocks. While splitting into blocks makes it possible to create an archive
with lots of little files in different blocks, it makes compression much worse.
Large file support makes it possible to get maximum compression by putting all
the files into 1 block, but the downside is that the decode process is slower
due to the use of memory mapped IO writes. See the k7zUnpackMapDictionaryInMemoryMaxNumBytes
define in 7z.h if you want to change the size at which memory mapped IO kicks in,
currently archives larger than 1 meg will use memory mapped IO.

To update to a new version of the LZMA SDK, use the update.tcl to copy over those
files that were used in this version. Note that updating is not trivial since files
that have been modified would need to be merged.

The example iOS application shows how to decode a small file and how some very large
files can be decoded without using up all the memory in an iOS application. Previously,
an archive with a dictionary around 30 to 40 megs would crash an iOS device, with
the mmap logic files as large as 650 megs can be decoded without going over the
virtual memory limits on iOS. Note that this large file support depends on how large
a memory space a single process can map under iOS, so keeping a very large single
archive under 400 megs is likely to be a good idea.

See LICENSE.txt for license details.

More Repositories

1

AVAnimator

AVAnimator is an iOS library that makes it easy to implement non-trivial animated/video content in iOS
Objective-C
182
star
2

MetalBT709Decoder

Proper rendering of BT.709 encoded H.264 image using Metal
Objective-C
32
star
3

H264SeamlessLooping

Demo of seamless looping of HD video content using VideoToolbox
Objective-C
25
star
4

MetalHuffman

A GPU huffman decoder for iOS on top of Metal
Objective-C
24
star
5

AlphaOverVideo

iOS alpha channel video player library implemented on top of Metal
Objective-C
19
star
6

Fireworks

Fireworks is an AVAnimator demo that displays apha channel fireworks animations
C
15
star
7

AVRenderExample

AVRenderExample is an AVAnimator demo of offline video composition
C
14
star
8

MvidMovieMaker

MvidMovieMaker
C
10
star
9

H264AlphaPlayer

Demo of iOS client that plays alpha channel video using h264 hardware and OpenGL
C
10
star
10

SunSpot

SunSpot is an iOS 8 app that demonstrates playback with AVKit with a 1080p video
Objective-C
10
star
11

KittyBoom

KittyBoom is an AVAnimator demo that shows encoding an alpha channel video using two H.264 videos
C
9
star
12

AVSync

AVSync is an AVAnimator example that demonstrates audio/video sync
C
8
star
13

MetalPrefixSum

A GPU based parallel prefix sum implementation that operates on byte values. Supports both inclusive scan and exclusive scan.
Objective-C
8
star
14

MarioJump

MarioJump compares decoded alpha channel vs green screen video quality
Objective-C
6
star
15

StreetFighter

StreetFighter is an AVAnimator demo of AV sync, composition, and seamless looping
C
6
star
16

AdaptiveLosslessPrediction

C++ impl of Adaptive Lossless Prediction based Image Compression (paper by Jovanovic and Lorentz)
C
4
star
17

SeedsCombined

Two examples of image segmentation based on OpenCV for Xcode on MacOSX
C++
3
star
18

ARMTimingTests

ARM ASM timing framework for iOS
Objective-C
3
star
19

SKRepeatShader

SpriteKit impl of repeated tile rendering using a shader
Objective-C
3
star
20

LZ4Decompression

Decompression Speed test for iOS devices
C
3
star
21

SKShaderBWWindow

Example of SpriteKit shader that works with OpenGL or Metal
Objective-C
2
star
22

CarSpin

CarSpin is an AVAnimator example of decoding an alpha channel video encoded with mixed h.264 frames
C
2
star
23

DivQuantCluster

Clustering using divisive split and k-means
C
2
star
24

GvmCpp

C++ impl of GVM clustering
C
1
star
25

MetalElias

A Metal implementation of Elias gamma encoding/decoding
Objective-C
1
star
26

RGBAShader

Example of OpenGLES shader using a 256 entry lookup table
Objective-C
1
star
27

CoreImageMetalFilter

A simple iOS example in Objective-C that demonstrates a Metal compute kernel CoreImage filter
Objective-C
1
star
28

LadybugZap

AVAnimator demo of seamless looping, GIF decoding, and CoreAnimation integration
C
1
star
29

SKEffectNodeFiltered

Example of SKEffectNode with a CIFilter
Objective-C
1
star
30

MetalRice

A GPU based rice decoder for iOS on top of Metal
Objective-C++
1
star
31

PNGExampleXcode

Example Xcode project that builds libpng and implements read/write of PNG image file
C
1
star
32

ClusteringSegmentation

A unsupervised image segmentation approach using clustering with OpenCV
C++
1
star