Comments (11)
The API is sort-of exposed. Have a look at dssim.h
from dssim.
I did have a look, but I'd rather not need to create a dssim_image, and let all video conversion handling happen in gstreamer, as it will be more optimized and offer more possible conversions.
from dssim.
I'm not sure if I understand.
You can't avoid creating dssim_image
structure, because you have to describe image dimensions and pixel layout to dssim.
dssim internally supports only pixels in floating point in range 0..1, and it can't operate on anything else.
I presume you have pixels in 8-bit YCbCr. You can use dssim_create_image_float_callback
to convert image on the fly row by row. This will avoid need for a full-screen buffer.
from dssim.
The idea is that gstreamer has all the necessary routines to convert between different formats, the most flexible solution for our use case would be an interface such as
double compare (uint8 * data, uint32 width, uint32 height);
, that would only handle data in the lab colorspace. This means on the gstreamer side we would only need to do one conversion (possibly none if our input data is already in the lab colorspace), and spare us the need for an extra memcpy.
from dssim.
dssim can't be calculated on uint8 pixels. The algorithm needs to apply very precise blur and square the values, and 8 bits is not enough for this.
from dssim.
It's just a fancy way to talk about a bitmap, one pixel would be 4 uint8 in
the lab colorspace if I'm not mistaken
On Thu, Jun 18, 2015 at 8:47 PM, Kornel [email protected] wrote:
dssim can't be calculated on uint8 pixels. The algorithm needs to apply
very precise blur and square the values, and 8 bits is not enough for this.β
Reply to this email directly or view it on GitHub
#12 (comment).
from dssim.
If your bitmap's pixels are struct {unsigned char l, a, b;}
in 0..255 range then dssim won't need to do colorspace conversion, but will still have to convert uint8
s to float
s. This was theoretically available via dssim_create_image()
with DSSIM_LAB
color, but buggy - fixed in 0dcfde5.
If your bitmap's pixels are struct {float l, a, b;}
in 0..1 range, then dssim can use it without conversion, but will still do memcpy
(but only row-by-row, which should fit in cache). This is available via dssim_create_image_float_callback()
.
It will do chroma subsampling by itself unless you disable it via dssim_set_color_handling
. There's no API to specify subsampled bitmap.
If you want to avoid memcpy
, then the only way would be for you to provide image as 3 separate bitmaps (dssim doesn't work on interleaved LAB pixels, but on "grayscale" bitmaps for each channel separately).
So the API would be:
dssim_create_image(float luma[], int width, int height, float a[], float b[], int chroma_width, int chroma_height);
from dssim.
OK, I'll go the easy way for now, however one would need to allow for making a dynamic library and ideally offer pkg-config files, would you be OK for an alternate build system using meson (https://github.com/mesonbuild/meson) ?
from dssim.
I haven't used meson, but I don't mind accepting it as an option.
from dssim.
I'm also planning to add a Rust API. If you use Rust/cargo then it'd be another solution.
from dssim.
Cool, I plan to wrap it in C as a gstreamer plugin, I've submitted a pull request @ #13 :)
from dssim.
Related Issues (20)
- Consider evaluating DSSIM using CLIC-2021 peceptual quality task HOT 6
- Controlling/limiting the CPU and Memory usage HOT 2
- NodeJS binding? HOT 2
- Add option to install directly from crates.io in README HOT 1
- Broken AVIF feature HOT 2
- Cannot be used for WASM because of multithreading? HOT 3
- Missing 'itertools::Itertools' for `zip_eq` in dssim-core when using wasm HOT 2
- Canβt compile with webp[-static] features
- Feature Request: Add an examples folder HOT 2
- Excessive memory consumption with multiple modified files in CLI HOT 1
- Feature request: set `scale_weights` in CLI HOT 7
- [Help] How to simply compare two JPEG images in memory HOT 3
- Question: Can a shared library be built? HOT 2
- Fails to build on armv5, armv7, armv7l and ppc HOT 5
- Why does the -o flag create 5 images in different sizes HOT 1
- version `GLIBC_2.18' not found HOT 1
- How do I install dssim.h into the prefix? HOT 3
- Ranking HOT 2
- Wasm HOT 3
- error in c HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dssim.