MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / rtjpeg_decode_init

Function rtjpeg_decode_init

libavcodec/rtjpeg.c:156–173  ·  view source on GitHub ↗

* \brief initialize an RTJpegContext, may be called multiple times * \param c context to initialize * \param dsp specifies the idct to use for decoding * \param width width of image, will be rounded down to the nearest multiple * of 16 for decoding * \param height height of image, will be rounded down to the nearest multiple * of 16 for decoding * \param lquant lum

Source from the content-addressed store, hash-verified

154 * \param cquant chroma quantization table to use
155 */
156void rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp,
157 int width, int height,
158 const uint32_t *lquant, const uint32_t *cquant) {
159 int i;
160 c->dsp = dsp;
161 for (i = 0; i < 64; i++) {
162 int z = ff_zigzag_direct[i];
163 int p = c->dsp->idct_permutation[i];
164 z = ((z << 3) | (z >> 3)) & 63; // rtjpeg uses a transposed variant
165
166 // permute the scan and quantization tables for the chosen idct
167 c->scan[i] = c->dsp->idct_permutation[z];
168 c->lquant[p] = lquant[i];
169 c->cquant[p] = cquant[i];
170 }
171 c->w = width;
172 c->h = height;
173}

Callers 2

codec_reinitFunction · 0.85
decode_frameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected