Questions tagged [dct]

Discrete Cosine Transform (DCT).

A discrete cosine transform (DCT) expresses a sequence of finitely many data points in terms of a sum of cosine functions oscillating at different frequencies. DCT's are important to numerous applications in science and engineering, from lossy compression of audio (e.g. MP3) and images (e.g. JPEG) (where small high-frequency components can be discarded), to spectral methods for the numerical solution of partial differential equations.

More information on Wikipedia: Discrete cosine transform .

277 questions
2
votes
1 answer

DCT2 of png using jTransforms

What I'm trying to do is to compute 2D DCT of an image in Java and then save the result back to file. Read file: coverImage = readImg(coverPath); private BufferedImage readImg(String path) { BufferedImage destination = null; try…
Kyle
  • 184
  • 2
  • 13
2
votes
1 answer

MATLAB dct2/idct2 vs. dctmtx

There are two alternative methods to compute DCT and its inverse in MATLAB. One is dct2/idct2 and the other is the transformation matrix computed by dctmtx. Why is there an alternative way based on matrix multiplications making use of dctmtx?
rcp
  • 111
  • 1
  • 2
  • 3
1
vote
3 answers

How Huffman Encoding construct the image(jpeg) from dct coefficients?

I have a 512x512 image and I tried to recompress it. Here's the steps for recompressing an image to jpeg file 1) convert rgb to YCrCb 2) perform down sampling on Cr and Cb 2) convert YCrCb to DCT and Quantized according to chosen…
Frank Smith
  • 1,717
  • 4
  • 18
  • 32
1
vote
1 answer

Intel based hardware speed ups for DCT?

We are writing an image processing algorithm targeting some Intel hardware. Generally we prefer generic C implementations, but we have identified an algorithm that at its core does a ton of Discrete Cosine Transforms (DCT's) that works extremely…
John
  • 5,735
  • 3
  • 46
  • 62
1
vote
1 answer

Trying to implement The inverse of a dct 8*8 matrix

I have managed to calculate the dct of an 8*8 matrix and I am having trouble doing the inverse. Can anyone have a look at this code and tell me what I am doing now. I should be getting the exact same values as before but im getting different values.…
user427641
  • 97
  • 3
  • 10
1
vote
1 answer

vDSP and Discrete Cosine Transform

I am new to FFT, DCT and the like. Recently I was looking into the documentation for the vDSP library from Apple and was unable to find a DCT implementation. I was wondering if anyone knows of a way to calculate the DCT using one of the FFT…
damnabit
  • 61
  • 4
1
vote
1 answer

Lua - Ability to encode JPEG using DCT (discrete cosine transform)

I’m looking to find a library and/or guide that would allow me to encode an image with DCT (discrete cosine transform ) so I can place it in a basic 1.0 pdf file. (FYI I’m using https://git.catseye.tc/pdf.lua/ to create the pdf. I’ve search the…
nodecentral
  • 446
  • 3
  • 16
1
vote
0 answers

How to increase fft time resolution also frequency resolution at the same time?

I'm a newbie learning FFT, I'm writing fft using swift vDSP to process audio from the microphone. My goal is to fine-tune the calculation to 0.1 Hz on the audio whose frequency changes every 0.1 seconds. For example, there will be a very strong…
pekkabear
  • 55
  • 5
1
vote
0 answers

JPEG Specification Questions: Walking through my current understanding to hopefully find what is wrong

I want to make a JPEG where for each of the 3 components (Y, Cb, Cr), you encode a 8x8 block one after another, and then move to the next 8x8 block in the image. E.X. A 16x16 image exists. write header (is there anything special I need to mark? I…
Light916
  • 11
  • 1
1
vote
0 answers

jpeg python 8x8 window DCT and quantisation process

I am trying to build a simple jpeg compression process in python using but DCT and quantisation but not the Huffman coding. This is what I have done so far (compress and uncompress the same image): import cv2 as cv from scipy.fftpack import dct,…
markman8
  • 31
  • 4
1
vote
1 answer

Is there a function in matlab to calculate higher level of DCT's like DCT-III,IV?

I have recently started working with DCT. I have started with DCT-II, and there is dct() & dct2() in MATLAB that helps in the calculated of 1-D and 2-D DCT-II respectively. I wanted to know if there are some other functions that help in the…
1
vote
0 answers

Is there a problem with DCT or quantization when encoding JPEG files?

When I make my own BMP to JPEG encoder, I found that the resulting JPEG image was very different from the original. After comparing RGB images to YUV images, I found that the two images were exactly the same. Instead of optimizing DCT…
TIger_zh
  • 11
  • 2
1
vote
1 answer

Is this dct (FFTW.jl) behavior in julia normal?

I'm trying to do some exercises of Compressed Sensing on Julia, but i realize that the discrete cosine transformation (using FFTW.jl) of an identity matrix doesn't looks as the result of other programming languages (aka. Mathematica and Matlab). For…
1
vote
1 answer

SciPy discrete cosine transform (DCT) power in non-existing frequencies

I try to transform a simple cosine signal using the Discrete Cosine Transform (DCT) scipy.fft.dct, however it seems there is an issue as there is power in frequencies that should not exist. Suppose a domain from zero to one, both endpoints included,…
phil
  • 11
  • 2
1
vote
0 answers

glsl reinterpret mat2x4 as mat4x2

I was trying to implement a 8x8 dct method in compute. The current implementation looks like this: void dct_8(in mat2x4 data, out vec4 res0246, out vec4 res1357) { res0246 = dct8_matrix_even*(data[0] + data[1].wzyx); res1357 =…
shangjiaxuan
  • 205
  • 1
  • 10