comparison h263dec.c @ 2266:514949de5d15 libavcodec

set AVCodecContext.width/height to the picture width/height instead of the one stored in the bitstream (that only matters if lowres!=0)
author michael
date Mon, 27 Sep 2004 02:39:55 +0000
parents bd09f4d1976f
children 21f450be6cb5
comparison
equal deleted inserted replaced
2265:c93da911905e 2266:514949de5d15
35 MpegEncContext *s = avctx->priv_data; 35 MpegEncContext *s = avctx->priv_data;
36 36
37 s->avctx = avctx; 37 s->avctx = avctx;
38 s->out_format = FMT_H263; 38 s->out_format = FMT_H263;
39 39
40 s->width = avctx->width; 40 s->width = avctx->width;
41 s->height = avctx->height; 41 s->height = avctx->height;
42 avctx->width = -((-s->width )>>avctx->lowres);
43 avctx->height= -((-s->height)>>avctx->lowres);
42 s->workaround_bugs= avctx->workaround_bugs; 44 s->workaround_bugs= avctx->workaround_bugs;
43 45
44 // set defaults 46 // set defaults
45 MPV_decode_defaults(s); 47 MPV_decode_defaults(s);
46 s->quant_precision=5; 48 s->quant_precision=5;
635 /* After H263 & mpeg4 header decode we have the height, width,*/ 637 /* After H263 & mpeg4 header decode we have the height, width,*/
636 /* and other parameters. So then we could init the picture */ 638 /* and other parameters. So then we could init the picture */
637 /* FIXME: By the way H263 decoder is evolving it should have */ 639 /* FIXME: By the way H263 decoder is evolving it should have */
638 /* an H263EncContext */ 640 /* an H263EncContext */
639 641
640 if ( s->width != avctx->width || s->height != avctx->height) { 642 if ( -((-s->width )>>avctx->lowres) != avctx->width
643 || -((-s->height)>>avctx->lowres) != avctx->height) {
641 /* H.263 could change picture size any time */ 644 /* H.263 could change picture size any time */
642 ParseContext pc= s->parse_context; //FIXME move these demuxng hack to avformat 645 ParseContext pc= s->parse_context; //FIXME move these demuxng hack to avformat
643 s->parse_context.buffer=0; 646 s->parse_context.buffer=0;
644 MPV_common_end(s); 647 MPV_common_end(s);
645 s->parse_context= pc; 648 s->parse_context= pc;
646 } 649 }
647 if (!s->context_initialized) { 650 if (!s->context_initialized) {
648 avctx->width = s->width; 651 avctx->width = -((-s->width)>>avctx->lowres);
649 avctx->height = s->height; 652 avctx->height = -((-s->height)>>avctx->lowres);
650 653
651 goto retry; 654 goto retry;
652 } 655 }
653 656
654 if((s->codec_id==CODEC_ID_H263 || s->codec_id==CODEC_ID_H263P)) 657 if((s->codec_id==CODEC_ID_H263 || s->codec_id==CODEC_ID_H263P))