comparison parser.c @ 1681:27a272442d6b libavcodec

fill codec info
author bellard
date Fri, 12 Dec 2003 16:55:12 +0000
parents 6c82ef97d3e6
children 13169235c306
comparison
equal deleted inserted replaced
1680:6bd7a01eca9c 1681:27a272442d6b
291 pc->width = avctx->width = (buf[0] << 4) | (buf[1] >> 4); 291 pc->width = avctx->width = (buf[0] << 4) | (buf[1] >> 4);
292 pc->height = avctx->height = ((buf[1] & 0x0f) << 8) | buf[2]; 292 pc->height = avctx->height = ((buf[1] & 0x0f) << 8) | buf[2];
293 frame_rate_index = buf[3] & 0xf; 293 frame_rate_index = buf[3] & 0xf;
294 pc->frame_rate = avctx->frame_rate = frame_rate_tab[frame_rate_index]; 294 pc->frame_rate = avctx->frame_rate = frame_rate_tab[frame_rate_index];
295 avctx->frame_rate_base = MPEG1_FRAME_RATE_BASE; 295 avctx->frame_rate_base = MPEG1_FRAME_RATE_BASE;
296 avctx->codec_id = CODEC_ID_MPEG1VIDEO;
297 avctx->sub_id = 1;
296 } 298 }
297 break; 299 break;
298 case EXT_START_CODE: 300 case EXT_START_CODE:
299 if (bytes_left >= 1) { 301 if (bytes_left >= 1) {
300 ext_type = (buf[0] >> 4); 302 ext_type = (buf[0] >> 4);
309 311
310 avctx->width = pc->width | (horiz_size_ext << 12); 312 avctx->width = pc->width | (horiz_size_ext << 12);
311 avctx->height = pc->height | (vert_size_ext << 12); 313 avctx->height = pc->height | (vert_size_ext << 12);
312 avctx->frame_rate = pc->frame_rate * (frame_rate_ext_n + 1); 314 avctx->frame_rate = pc->frame_rate * (frame_rate_ext_n + 1);
313 avctx->frame_rate_base = MPEG1_FRAME_RATE_BASE * (frame_rate_ext_d + 1); 315 avctx->frame_rate_base = MPEG1_FRAME_RATE_BASE * (frame_rate_ext_d + 1);
316 avctx->codec_id = CODEC_ID_MPEG2VIDEO;
314 avctx->sub_id = 2; /* forces MPEG2 */ 317 avctx->sub_id = 2; /* forces MPEG2 */
315 } 318 }
316 break; 319 break;
317 case 0x8: /* picture coding extension */ 320 case 0x8: /* picture coding extension */
318 if (bytes_left >= 5) { 321 if (bytes_left >= 5) {