Giter Club home page Giter Club logo

Comments (8)

lilohuang avatar lilohuang commented on May 28, 2024

Hi @a-storm, PyTurboJPEG is a wrapper of libjpeg-turbo (TurboJPEG API), and there is no public API to directly decode JPEG to DCT coefficients through TurboJPEG API. However, this might be done through the tjTransform function call to capture the raw DCT coefficients within the callback. Unfortunately, the implementation effort is high, I will try to investigate the possibility this year. Thanks for your feedback.

from pyturbojpeg.

a-storm avatar a-storm commented on May 28, 2024

Thank you for your respond! I'll try to explore tjTransform.

from pyturbojpeg.

xiaonengmiao avatar xiaonengmiao commented on May 28, 2024

Hi @lilohuang , according to turbo jpeg doc, there are two function: jpeg_read_coefficients() and jpeg_write_coefficients(), which could read the entire image into a set of virtual coefficient-block arrays, one array per component. The return value is a pointer to an array of virtual-array descriptors. Each virtual array can be accessed directly using the JPEG memory manager's access_virt_barray method (see Memory management, below, and also read structure.txt's discussion of virtual array handling). Or, for simple transcoding to a different JPEG file format, the array list can just be handed directly to jpeg_write_coefficients().

Is there any way I could call these two functions from this python wrapper? Thanks.

from pyturbojpeg.

lilohuang avatar lilohuang commented on May 28, 2024

@xiaonengmiao, unfortunately not, because jpeg_read_coefficients() and jpeg_write_coefficients(), are not TurboJPEG API, they're libjpeg-turbo low-level API, you need to write C program to access them. Thanks. PyTurboJPEG only provides python wrapper of TurboJPEG API.

from pyturbojpeg.

xiaonengmiao avatar xiaonengmiao commented on May 28, 2024

@xiaonengmiao, unfortunately not, because jpeg_read_coefficients() and jpeg_write_coefficients(), are not TurboJPEG API, they're libjpeg-turbo low-level API, you need to write C program to access them. Thanks. PyTurboJPEG only provides python wrapper of TurboJPEG API.

Understood, thanks anyway.

from pyturbojpeg.

nixenos avatar nixenos commented on May 28, 2024

@a-storm were you able to use the tjTransform to obtain/modify the DCT table? I wanted to hook into DCT table and replace the coefficients with ones calculated by my algorithm.

from pyturbojpeg.

a-storm avatar a-storm commented on May 28, 2024

@nixenos nope. I calculated them with scipy. share it please if you succeed.

from pyturbojpeg.

nixenos avatar nixenos commented on May 28, 2024

@lilohuang is calling tjTransform for replacing DCT coefficients supported by this library?
@a-storm sure, I'm planning to try it anyways, if it won't work I might need to switch my project to C++, which would be very unfortunate as I'm on a tight time schedule (it's for my masters thesis and I need to get it working soon hehe)

from pyturbojpeg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.