comparison h263dec.c @ 553:18ad513d92fe libavcodec

direct rendering method 1 support
author michaelni
date Sun, 14 Jul 2002 18:37:35 +0000
parents 8f8f4885d874
children 762c67fd4078
comparison
equal deleted inserted replaced
552:26971b5a271d 553:18ad513d92fe
87 default: 87 default:
88 return -1; 88 return -1;
89 } 89 }
90 s->codec_id= avctx->codec->id; 90 s->codec_id= avctx->codec->id;
91 avctx->mbskip_table= s->mbskip_table; 91 avctx->mbskip_table= s->mbskip_table;
92 92
93 /* for h263, we allocate the images after having read the header */ 93 /* for h263, we allocate the images after having read the header */
94 if (avctx->codec->id != CODEC_ID_H263 && avctx->codec->id != CODEC_ID_MPEG4) 94 if (avctx->codec->id != CODEC_ID_H263 && avctx->codec->id != CODEC_ID_MPEG4)
95 if (MPV_common_init(s) < 0) 95 if (MPV_common_init(s) < 0)
96 return -1; 96 return -1;
97 97
153 ret = intel_h263_decode_picture_header(s); 153 ret = intel_h263_decode_picture_header(s);
154 } else { 154 } else {
155 ret = h263_decode_picture_header(s); 155 ret = h263_decode_picture_header(s);
156 } 156 }
157 157
158
158 /* After H263 & mpeg4 header decode we have the height, width,*/ 159 /* After H263 & mpeg4 header decode we have the height, width,*/
159 /* and other parameters. So then we could init the picture */ 160 /* and other parameters. So then we could init the picture */
160 /* FIXME: By the way H263 decoder is evolving it should have */ 161 /* FIXME: By the way H263 decoder is evolving it should have */
161 /* an H263EncContext */ 162 /* an H263EncContext */
163 if (s->width != avctx->width || s->height != avctx->height) {
164 /* H.263 could change picture size any time */
165 MPV_common_end(s);
166 s->context_initialized=0;
167 }
162 if (!s->context_initialized) { 168 if (!s->context_initialized) {
163 avctx->width = s->width; 169 avctx->width = s->width;
164 avctx->height = s->height; 170 avctx->height = s->height;
165 avctx->aspect_ratio_info= s->aspect_ratio_info; 171 avctx->aspect_ratio_info= s->aspect_ratio_info;
166 if (MPV_common_init(s) < 0)
167 return -1;
168 } else if (s->width != avctx->width || s->height != avctx->height) {
169 /* H.263 could change picture size any time */
170 MPV_common_end(s);
171 if (MPV_common_init(s) < 0) 172 if (MPV_common_init(s) < 0)
172 return -1; 173 return -1;
173 } 174 }
174 175
175 if(ret==FRAME_SKIPED) return buf_size; 176 if(ret==FRAME_SKIPED) return buf_size;
188 return buf_size; 189 return buf_size;
189 else 190 else
190 s->next_p_frame_damaged=0; 191 s->next_p_frame_damaged=0;
191 } 192 }
192 193
193 MPV_frame_start(s); 194 MPV_frame_start(s, avctx);
194 195
195 #ifdef DEBUG 196 #ifdef DEBUG
196 printf("qscale=%d\n", s->qscale); 197 printf("qscale=%d\n", s->qscale);
197 #endif 198 #endif
198 199
457 sizeof(MpegEncContext), 458 sizeof(MpegEncContext),
458 h263_decode_init, 459 h263_decode_init,
459 NULL, 460 NULL,
460 h263_decode_end, 461 h263_decode_end,
461 h263_decode_frame, 462 h263_decode_frame,
462 CODEC_CAP_DRAW_HORIZ_BAND, 463 CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
463 }; 464 };
464 465
465 AVCodec h263_decoder = { 466 AVCodec h263_decoder = {
466 "h263", 467 "h263",
467 CODEC_TYPE_VIDEO, 468 CODEC_TYPE_VIDEO,
469 sizeof(MpegEncContext), 470 sizeof(MpegEncContext),
470 h263_decode_init, 471 h263_decode_init,
471 NULL, 472 NULL,
472 h263_decode_end, 473 h263_decode_end,
473 h263_decode_frame, 474 h263_decode_frame,
474 CODEC_CAP_DRAW_HORIZ_BAND, 475 CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
475 }; 476 };
476 477
477 AVCodec msmpeg4v1_decoder = { 478 AVCodec msmpeg4v1_decoder = {
478 "msmpeg4v1", 479 "msmpeg4v1",
479 CODEC_TYPE_VIDEO, 480 CODEC_TYPE_VIDEO,
481 sizeof(MpegEncContext), 482 sizeof(MpegEncContext),
482 h263_decode_init, 483 h263_decode_init,
483 NULL, 484 NULL,
484 h263_decode_end, 485 h263_decode_end,
485 h263_decode_frame, 486 h263_decode_frame,
486 CODEC_CAP_DRAW_HORIZ_BAND, 487 CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
487 }; 488 };
488 489
489 AVCodec msmpeg4v2_decoder = { 490 AVCodec msmpeg4v2_decoder = {
490 "msmpeg4v2", 491 "msmpeg4v2",
491 CODEC_TYPE_VIDEO, 492 CODEC_TYPE_VIDEO,
493 sizeof(MpegEncContext), 494 sizeof(MpegEncContext),
494 h263_decode_init, 495 h263_decode_init,
495 NULL, 496 NULL,
496 h263_decode_end, 497 h263_decode_end,
497 h263_decode_frame, 498 h263_decode_frame,
498 CODEC_CAP_DRAW_HORIZ_BAND, 499 CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
499 }; 500 };
500 501
501 AVCodec msmpeg4v3_decoder = { 502 AVCodec msmpeg4v3_decoder = {
502 "msmpeg4", 503 "msmpeg4",
503 CODEC_TYPE_VIDEO, 504 CODEC_TYPE_VIDEO,
505 sizeof(MpegEncContext), 506 sizeof(MpegEncContext),
506 h263_decode_init, 507 h263_decode_init,
507 NULL, 508 NULL,
508 h263_decode_end, 509 h263_decode_end,
509 h263_decode_frame, 510 h263_decode_frame,
510 CODEC_CAP_DRAW_HORIZ_BAND, 511 CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
511 }; 512 };
512 513
513 AVCodec wmv1_decoder = { 514 AVCodec wmv1_decoder = {
514 "wmv1", 515 "wmv1",
515 CODEC_TYPE_VIDEO, 516 CODEC_TYPE_VIDEO,
517 sizeof(MpegEncContext), 518 sizeof(MpegEncContext),
518 h263_decode_init, 519 h263_decode_init,
519 NULL, 520 NULL,
520 h263_decode_end, 521 h263_decode_end,
521 h263_decode_frame, 522 h263_decode_frame,
522 CODEC_CAP_DRAW_HORIZ_BAND, 523 CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
523 }; 524 };
524 525
525 AVCodec wmv2_decoder = { 526 AVCodec wmv2_decoder = {
526 "wmv2", 527 "wmv2",
527 CODEC_TYPE_VIDEO, 528 CODEC_TYPE_VIDEO,
529 sizeof(MpegEncContext), 530 sizeof(MpegEncContext),
530 h263_decode_init, 531 h263_decode_init,
531 NULL, 532 NULL,
532 h263_decode_end, 533 h263_decode_end,
533 h263_decode_frame, 534 h263_decode_frame,
534 CODEC_CAP_DRAW_HORIZ_BAND, 535 CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
535 }; 536 };
536 537
537 AVCodec h263i_decoder = { 538 AVCodec h263i_decoder = {
538 "h263i", 539 "h263i",
539 CODEC_TYPE_VIDEO, 540 CODEC_TYPE_VIDEO,
541 sizeof(MpegEncContext), 542 sizeof(MpegEncContext),
542 h263_decode_init, 543 h263_decode_init,
543 NULL, 544 NULL,
544 h263_decode_end, 545 h263_decode_end,
545 h263_decode_frame, 546 h263_decode_frame,
546 CODEC_CAP_DRAW_HORIZ_BAND, 547 CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
547 }; 548 };
548 549