Mercurial > libavcodec.hg
comparison h263dec.c @ 2270:21f450be6cb5 libavcodec
lowres width/height cleanup 3rd try
author | michael |
---|---|
date | Mon, 27 Sep 2004 11:50:56 +0000 |
parents | 514949de5d15 |
children | 870597ca3e7a |
comparison
equal
deleted
inserted
replaced
2269:535b7dfee202 | 2270:21f450be6cb5 |
---|---|
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->coded_width; |
41 s->height = avctx->height; | 41 s->height = avctx->coded_height; |
42 avctx->width = -((-s->width )>>avctx->lowres); | |
43 avctx->height= -((-s->height)>>avctx->lowres); | |
44 s->workaround_bugs= avctx->workaround_bugs; | 42 s->workaround_bugs= avctx->workaround_bugs; |
45 | 43 |
46 // set defaults | 44 // set defaults |
47 MPV_decode_defaults(s); | 45 MPV_decode_defaults(s); |
48 s->quant_precision=5; | 46 s->quant_precision=5; |
637 /* After H263 & mpeg4 header decode we have the height, width,*/ | 635 /* After H263 & mpeg4 header decode we have the height, width,*/ |
638 /* and other parameters. So then we could init the picture */ | 636 /* and other parameters. So then we could init the picture */ |
639 /* FIXME: By the way H263 decoder is evolving it should have */ | 637 /* FIXME: By the way H263 decoder is evolving it should have */ |
640 /* an H263EncContext */ | 638 /* an H263EncContext */ |
641 | 639 |
642 if ( -((-s->width )>>avctx->lowres) != avctx->width | 640 if ( s->width != avctx->coded_width |
643 || -((-s->height)>>avctx->lowres) != avctx->height) { | 641 || s->height != avctx->coded_height) { |
644 /* H.263 could change picture size any time */ | 642 /* H.263 could change picture size any time */ |
645 ParseContext pc= s->parse_context; //FIXME move these demuxng hack to avformat | 643 ParseContext pc= s->parse_context; //FIXME move these demuxng hack to avformat |
646 s->parse_context.buffer=0; | 644 s->parse_context.buffer=0; |
647 MPV_common_end(s); | 645 MPV_common_end(s); |
648 s->parse_context= pc; | 646 s->parse_context= pc; |
649 } | 647 } |
650 if (!s->context_initialized) { | 648 if (!s->context_initialized) { |
651 avctx->width = -((-s->width)>>avctx->lowres); | 649 avcodec_set_dimensions(avctx, s->width, s->height); |
652 avctx->height = -((-s->height)>>avctx->lowres); | |
653 | 650 |
654 goto retry; | 651 goto retry; |
655 } | 652 } |
656 | 653 |
657 if((s->codec_id==CODEC_ID_H263 || s->codec_id==CODEC_ID_H263P)) | 654 if((s->codec_id==CODEC_ID_H263 || s->codec_id==CODEC_ID_H263P)) |