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

Function create_default_qtables

libavformat/rtpdec_jpeg.c:192–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192static void create_default_qtables(uint8_t *qtables, uint8_t q)
193{
194 int factor = q;
195 int i;
196 uint16_t S;
197
198 factor = av_clip(q, 1, 99);
199
200 if (q < 50)
201 S = 5000 / factor;
202 else
203 S = 200 - factor * 2;
204
205 for (i = 0; i < 128; i++) {
206 int val = (default_quantizers[i] * S + 50) / 100;
207
208 /* Limit the quantizers to 1 <= q <= 255. */
209 val = av_clip(val, 1, 255);
210 qtables[i] = val;
211 }
212}
213
214static int jpeg_parse_packet(AVFormatContext *ctx, PayloadContext *jpeg,
215 AVStream *st, AVPacket *pkt, uint32_t *timestamp,

Callers 1

jpeg_parse_packetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected