rcanut / nhwcodec Goto Github PK
View Code? Open in Web Editor NEWNHW : A Next-Generation Image Compression Codec
License: Other
NHW : A Next-Generation Image Compression Codec
License: Other
compiling with gcc on Linux, one get the following error:
nhw_encoder.c: In function ‘write_compressed_file’:
nhw_encoder.c:2663:29: warning: passing argument 2 of ‘fwrite’ makes integer from pointer without a cast [-Wint-conversion]
fwrite(enc->nhw_char_res1,enc->nhw_char_res1_len,2,compressed);
^~~
In file included from nhw_encoder.c:46:0:
/usr/include/stdio.h:717:15: note: expected ‘size_t {aka long unsigned int}’ but argument is of type ‘short unsigned int *’
extern size_t fwrite (const void *__restrict __ptr, size_t __size,
^~~~~~
wavelet_filterbank.c: In function ‘wavelet_synthesis_high_quality_settings’:
wavelet_filterbank.c:617:24: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
enc->nhw_char_res1_len=res;
The fix is easy: nhw_char_res1_len field should be a 'size_t', not 'unsigned short *' at encoder/codec.h:145
Patch attached.
skal/
Can you recommend the some documents of this codec exclude the code. I want to make sure whether there are some ways get the better results than bpg codec. Or have you compare the result at same bpp using other codec, for example bpg(using PSNR、SSIM、MS-SSIM).
source image - https://i.ibb.co/JHRngPN/src.jpg
decoded image - https://i.ibb.co/3S2G73c/srcDEC.jpg
I want to suggets some changes in this program.
It shouldd work as a client to the "server", a library, which provides routines to en/decode image/s.
Main CLI (Command Line Interface) would be a simple program that would only deal with reading/writing files and processing arguments and processing images would be done by library, (more or less as it is in nhw-encoder) preferably in memory, and cli-client would only call necessary routines.
Check BALZ source and crush, and libcrush to see what I mean.
First - command line interface: use input and output instaead of automatic naming.
$ nhw-dec <file.nhw> <file.bmp>
You don't know what user wants and don't want to be smarter than them. They know what they do.
decode_image()
and parse_file
to use string instead od argv**
.
decode_image()
: instead of decode_image(image_buffer *im,decode_state *os,char *file_name)
it should rather go like this: decode_image(decode_state *os, image_buffer *im)
and there would be write_image(decode_state *os, image_buffer *im, char* file_name)
Process image in memory, and share state/context structure beteen functions. Have designated functions to read/write from file to/from memory rather than doing hundreds of disk reads/writes (with fread/fwrite). For reference check crush and libcrush linked above.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.