Skip to content
This repository has been archived by the owner on Jul 29, 2023. It is now read-only.

Commit

Permalink
Revert "Use threading for PPMd8 decoders (#33)"
Browse files Browse the repository at this point in the history
This reverts commit aa6298d.
  • Loading branch information
miurahr committed Aug 9, 2021
1 parent fedffc6 commit c2ef4e7
Show file tree
Hide file tree
Showing 19 changed files with 289 additions and 716 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run-tox-tests.yml
Expand Up @@ -34,7 +34,7 @@ jobs:
PYTEST_ADDOPTS: "--cov-config=pyproject.toml --cov --cov-append --benchmark-skip"
- name: Send coverage to coveralls
run: |
coveralls --service=github
coveralls
env:
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: py-${{ matrix.python-version }}-${{ matrix.os }}
Expand Down Expand Up @@ -76,6 +76,6 @@ jobs:
- name: Tell Coveralls that the parallel build is finished
run: |
pip3 install --upgrade coveralls
coveralls --finish --service=github
coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 14 additions & 22 deletions CMakeLists.txt
Expand Up @@ -11,7 +11,6 @@ set(PY_VERSION 3.8)
# Configuration for python-ext
set(Python_FIND_STRATEGY VERSION)
set(Python_FIND_IMPLEMENTATIONS CPython)
#set(Python_FIND_IMPLEMENTATIONS PyPy)
find_package(Python ${PY_VERSION}.0...${PY_VERSION}.99 COMPONENTS Interpreter Development)
set(PY_EXT_FILE _ppmd)
set(PY_EXT_DIR src/pyppmd/c)
Expand All @@ -37,7 +36,6 @@ add_custom_target(

# ##################################################################################################
# For pytest
# if(Python_FIND_IMPLEMENTATIONS PyPy)
file(
WRITE ${CMAKE_CURRENT_BINARY_DIR}/pytest_runner.cpp
"
Expand Down Expand Up @@ -92,27 +90,21 @@ add_custom_target(

# ##################################################################################################
# for build test and analytics
include_directories(lib lib2)
include_directories(lib)
add_library(
pyppmd
lib/Arch.h
lib/Interface.h
lib/Ppmd.h
lib/Ppmd7.c
lib/Ppmd7.h
lib/Ppmd7Dec.c
lib/Ppmd7Enc.c
lib/Ppmd8.c
lib/Ppmd8.h
lib/Ppmd8Dec.c
lib/Ppmd8Enc.c
lib2/Buffer.c
lib2/Buffer.h
lib2/threading.c
lib2/threading.h
lib2/Ppmd8Tdecoder.c
lib2/Ppmd8Tdecoder.h
src/ext/_ppmdmodule.c)
pyppmd
lib/Arch.h
lib/Interface.h
lib/Ppmd.h
lib/Ppmd7.c
lib/Ppmd7.h
lib/Ppmd7Dec.c
lib/Ppmd7Enc.c
lib/Ppmd8.c
lib/Ppmd8.h
lib/Ppmd8Dec.c
lib/Ppmd8Enc.c
src/ext/_ppmdmodule.c)
target_include_directories(pyppmd PRIVATE ${Python_INCLUDE_DIRS})
target_link_libraries(pyppmd PRIVATE ${Python_LIBRARIES})
# ##################################################################################################
2 changes: 0 additions & 2 deletions Changelog.rst
Expand Up @@ -12,11 +12,9 @@ Added

Changed
-------
* PPMd8(Var.I) decompression is done in seperate thread(#33)

Fixed
-----
* When memory_size is less than data file, it crashed with SIGFPE(div by zero)(#28,#33)
* CMake: support CFFI extension generation(#30)
* CMake: support debug flag for extension development(#27)
* CMake: support pytest_runner on windows
Expand Down
1 change: 0 additions & 1 deletion LICENSE.rst
Expand Up @@ -65,7 +65,6 @@ under BSD 3-Clause license.

BSD 3-Clause License

Copyright (c) 2016 Tino Reichard
Copyright (c) 2020-2021, Ma Lin,
All rights reserved.

Expand Down
4 changes: 1 addition & 3 deletions MANIFEST.in
Expand Up @@ -10,8 +10,6 @@ recursive-include docs Makefile
recursive-include lib *.h
recursive-include lib *.c
recursive-include lib *.txt
recursive-include lib2 *.h
recursive-include lib2 *.c

recursive-include src *.py
recursive-include src *.pyi
Expand All @@ -26,4 +24,4 @@ recursive-include utils *.txt

exclude .gitignore
exclude .gitattributes
prune .github
prune .github
21 changes: 15 additions & 6 deletions README.rst
Expand Up @@ -24,7 +24,6 @@ Introduction
``pyppmd`` module provides classes and functions for compressing and decompressing text data,
using PPM(Prediction by partial matching) compression algorithm which has several variations of implementations.
PPMd is the implementation by Dmitry Shkarin.
PyPPMD use Igor Pavlov's range coder introduced in 7-zip.

The API is similar to Python's bz2/lzma/zlib module.

Expand All @@ -34,18 +33,28 @@ Some parts of th codes are derived from ``7-zip``, ``pyzstd`` and ``ppmd-cffi``.
Development status
------------------

A development status is considered as ``Beta``.
A development status is considered as ``Alpha``.
There is an known issue for decompressor when data size is larger than memory_size parameter.
It is considered to be usable within limited conditions.


Copyright and License
---------------------
Copyright
---------

Some part of this library uses codes from following software.

* ppmd-cffi Copyright (C) 2020-2021 Hiroshi Miura
* pyzstd Copyright (C) 2020-2021 Ma Lin
* 7-Zip Copyright (C) 1999-2017 Igor Pavlov


License
-------

Copyright (C) 2020-2021 Hiroshi Miura

Copyright (C) 2020-2021 Ma Lin

Copyright (c) 2016 Tino Reichar

Copyright (C) 1999-2017 Igor Pavlov

This library is free software; you can redistribute it and/or
Expand Down
14 changes: 14 additions & 0 deletions lib/Interface.h
Expand Up @@ -10,6 +10,18 @@
* Streaming
****************************/

typedef struct PPMD_inBuffer_s {
const void* src; /**< start of input buffer */
size_t size; /**< size of input buffer */
size_t pos; /**< position where reading stopped. Will be updated. Necessarily 0 <= pos <= size */
} PPMD_inBuffer;

typedef struct PPMD_outBuffer_s {
void* dst; /**< start of output buffer */
size_t size; /**< size of output buffer */
size_t pos; /**< position where writing stopped. Will be updated. Necessarily 0 <= pos <= size */
} PPMD_outBuffer;

/* The following interfaces use first parameter as pointer to structure */

typedef struct IByteIn IByteIn;
Expand All @@ -19,13 +31,15 @@ struct IByteIn
};
#define IByteIn_Read(p) (p)->Read(p)


typedef struct IByteOut IByteOut;
struct IByteOut
{
void (*Write)(const IByteOut *p, Byte b);
};
#define IByteOut_Write(p, b) (p)->Write(p, b)


typedef struct ISzAlloc ISzAlloc;
typedef const ISzAlloc * ISzAllocPtr;

Expand Down
22 changes: 0 additions & 22 deletions lib2/Buffer.c

This file was deleted.

38 changes: 0 additions & 38 deletions lib2/Buffer.h

This file was deleted.

0 comments on commit c2ef4e7

Please sign in to comment.