comparison mimic.c @ 6667:4a5c7112e35c libavcodec

The code now is pretty self explanatory about the header structure. Remove the big comment and add comments about the skipped fields.
author ramiro
date Tue, 22 Apr 2008 20:30:50 +0000
parents 1c76797e2216
children 28af02d712cf
comparison
equal deleted inserted replaced
6666:1c76797e2216 6667:4a5c7112e35c
280 int is_pframe; 280 int is_pframe;
281 int width, height; 281 int width, height;
282 int quality, num_coeffs; 282 int quality, num_coeffs;
283 int swap_buf_size = buf_size - MIMIC_HEADER_SIZE; 283 int swap_buf_size = buf_size - MIMIC_HEADER_SIZE;
284 284
285 /*
286 * Header structure:
287 * uint16_t I_dont_remember;
288 * uint16_t quality;
289 * uint16_t width;
290 * uint16_t height;
291 * uint32_t some_constant;
292 * uint32_t is_pframe;
293 * uint32_t num_coeffs;
294 */
295
296 if(buf_size < MIMIC_HEADER_SIZE) { 285 if(buf_size < MIMIC_HEADER_SIZE) {
297 av_log(avctx, AV_LOG_ERROR, "insufficient data\n"); 286 av_log(avctx, AV_LOG_ERROR, "insufficient data\n");
298 return -1; 287 return -1;
299 } 288 }
300 289
301 buf += 2; 290 buf += 2; /* some constant (always 256) */
302 quality = bytestream_get_le16(&buf); 291 quality = bytestream_get_le16(&buf);
303 width = bytestream_get_le16(&buf); 292 width = bytestream_get_le16(&buf);
304 height = bytestream_get_le16(&buf); 293 height = bytestream_get_le16(&buf);
305 buf += 4; 294 buf += 4; /* some constant */
306 is_pframe = bytestream_get_le32(&buf); 295 is_pframe = bytestream_get_le32(&buf);
307 num_coeffs = bytestream_get_le32(&buf); 296 num_coeffs = bytestream_get_le32(&buf);
308 297
309 if(!ctx->avctx) { 298 if(!ctx->avctx) {
310 int i; 299 int i;