Lines Matching refs:stream
174 static void print_SOF(const unsigned char *stream) in print_SOF() argument
187 precision = stream[2]; in print_SOF()
188 height = be16_to_cpu(stream+3); in print_SOF()
189 width = be16_to_cpu(stream+5); in print_SOF()
190 nr_components = stream[7]; in print_SOF()
199 static int parse_DQT(struct jdec_private *priv, const unsigned char *stream) in parse_DQT() argument
205 dqt_block_end = stream + be16_to_cpu(stream); in parse_DQT()
206 stream += 2; /* Skip length */ in parse_DQT()
208 while (stream < dqt_block_end) in parse_DQT()
210 qi = *stream++; in parse_DQT()
217 memcpy(priv->Q_tables[qi&0x0F], stream, 64); in parse_DQT()
219 stream += 64; in parse_DQT()
225 static int parse_SOF(struct jdec_private *priv, const unsigned char *stream) in parse_SOF() argument
232 print_SOF(stream); in parse_SOF()
234 height = be16_to_cpu(stream+3); in parse_SOF()
235 width = be16_to_cpu(stream+5); in parse_SOF()
236 nr_components = stream[7]; in parse_SOF()
239 if (stream[2] != 8) in parse_SOF()
250 stream += 8; in parse_SOF()
252 cid = *stream++; in parse_SOF()
253 sampling_factor = *stream++; in parse_SOF()
254 Q_table = *stream++; in parse_SOF()
274 static int parse_SOS(struct jdec_private *priv, const unsigned char *stream) in parse_SOS() argument
277 unsigned int nr_components = stream[2]; in parse_SOS()
283 stream += 3; in parse_SOS()
285 cid = *stream++; in parse_SOS()
286 table = *stream++; in parse_SOS()
301 priv->stream = stream+3; in parse_SOS()
306 int tinyjpeg_parse_SOS(struct jdec_private *priv, const unsigned char *stream) in tinyjpeg_parse_SOS() argument
308 return parse_SOS(priv, stream); in tinyjpeg_parse_SOS()
312 static int parse_DHT(struct jdec_private *priv, const unsigned char *stream) in parse_DHT() argument
318 length = be16_to_cpu(stream) - 2; in parse_DHT()
319 stream += 2; /* Skip length */ in parse_DHT()
324 index = *stream++; in parse_DHT()
329 memcpy(priv->HTAC[index & 0xf].bits, stream, 16); in parse_DHT()
332 memcpy(priv->HTDC[index & 0xf].bits, stream, 16); in parse_DHT()
337 count += *stream++; in parse_DHT()
349 memcpy(priv->HTAC[index & 0xf].values, stream, count); in parse_DHT()
353 memcpy(priv->HTDC[index & 0xf].values, stream, count); in parse_DHT()
360 stream += count; in parse_DHT()
365 static int parse_DRI(struct jdec_private *priv, const unsigned char *stream) in parse_DRI() argument
371 length = be16_to_cpu(stream); in parse_DRI()
378 priv->restart_interval = be16_to_cpu(stream+2); in parse_DRI()
389 static int findEOI(struct jdec_private *priv,const unsigned char *stream) in findEOI() argument
391 …while (!(*stream == 0xff && *(stream+1) == 0xd9 )&& stream<=priv->stream_end) //searching for the… in findEOI()
393 stream++; in findEOI()
396 priv->stream_scan=stream; in findEOI()
400 static int findSOI(struct jdec_private *priv,const unsigned char *stream) in findSOI() argument
402 while (!(*stream == 0xff && *(stream+1) == 0xd8 ) ) //searching for the start of image marker in findSOI()
404 if(stream<=priv->stream_end) in findSOI()
406 stream++; in findSOI()
412 priv->stream=stream+2; in findSOI()
416 static int parse_JFIF(struct jdec_private *priv, const unsigned char *stream) in parse_JFIF() argument
425 next_image_found = findSOI(priv,stream); in parse_JFIF()
426 stream=priv->stream; in parse_JFIF()
428 while (!sos_marker_found && stream<=priv->stream_end) in parse_JFIF()
430 while((*stream == 0xff)) in parse_JFIF()
431 stream++; in parse_JFIF()
433 marker = *stream++; in parse_JFIF()
434 chuck_len = be16_to_cpu(stream); in parse_JFIF()
435 next_chunck = stream + chuck_len; in parse_JFIF()
439 if (parse_SOF(priv, stream) < 0) in parse_JFIF()
443 if (parse_DQT(priv, stream) < 0) in parse_JFIF()
448 if (parse_SOS(priv, stream) < 0) in parse_JFIF()
453 if (parse_DHT(priv, stream) < 0) in parse_JFIF()
458 if (parse_DRI(priv, stream) < 0) in parse_JFIF()
466 stream = next_chunck; in parse_JFIF()
491 findEOI(priv,stream); in parse_JFIF()
549 priv->stream = priv->stream_begin; in tinyjpeg_parse_header()
550 ret = parse_JFIF(priv, priv->stream); in tinyjpeg_parse_header()
776 slice_param.slice_data_size = (priv->stream_scan - priv->stream); in tinyjpeg_decode()
800 priv->stream_scan - priv->stream, in tinyjpeg_decode()
802 (void*)priv->stream, // jpeg_clip, in tinyjpeg_decode()
848 parse_JFIF(priv,priv->stream); in tinyjpeg_decode()