* \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
| 154 | * \param cquant chroma quantization table to use |
| 155 | */ |
| 156 | void 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 | } |
no outgoing calls
no test coverage detected