comparison h263dec.c @ 274:d0c186bcf075 libavcodec

use the width & height from the mpeg4 header ... in the case that its complete
author michaelni
date Tue, 19 Mar 2002 03:51:36 +0000
parents 34f40a0fc840
children 1fc96b02142e
comparison
equal deleted inserted replaced
273:34f40a0fc840 274:d0c186bcf075
57 default: 57 default:
58 return -1; 58 return -1;
59 } 59 }
60 60
61 /* for h263, we allocate the images after having read the header */ 61 /* for h263, we allocate the images after having read the header */
62 if (avctx->codec->id != CODEC_ID_H263) 62 if (avctx->codec->id != CODEC_ID_H263 && avctx->codec->id != CODEC_ID_MPEG4)
63 if (MPV_common_init(s) < 0) 63 if (MPV_common_init(s) < 0)
64 return -1; 64 return -1;
65 65
66 /* XXX: suppress this matrix init, only needed because using mpeg1 66 /* XXX: suppress this matrix init, only needed because using mpeg1
67 dequantize in mmx case */ 67 dequantize in mmx case */
112 ret = mpeg4_decode_picture_header(s); 112 ret = mpeg4_decode_picture_header(s);
113 } else if (s->h263_intel) { 113 } else if (s->h263_intel) {
114 ret = intel_h263_decode_picture_header(s); 114 ret = intel_h263_decode_picture_header(s);
115 } else { 115 } else {
116 ret = h263_decode_picture_header(s); 116 ret = h263_decode_picture_header(s);
117 /* After H263 header decode we have the height, width, */ 117 }
118
119 /* After H263 & mpeg4 header decode we have the height, width,*/
118 /* and other parameters. So then we could init the picture */ 120 /* and other parameters. So then we could init the picture */
119 /* FIXME: By the way H263 decoder is evolving it should have */ 121 /* FIXME: By the way H263 decoder is evolving it should have */
120 /* an H263EncContext */ 122 /* an H263EncContext */
121 if (!s->context_initialized) { 123 if (!s->context_initialized) {
122 avctx->width = s->width; 124 avctx->width = s->width;
123 avctx->height = s->height; 125 avctx->height = s->height;
124 if (MPV_common_init(s) < 0) 126 if (MPV_common_init(s) < 0)
125 return -1; 127 return -1;
126 } else if (s->width != avctx->width || s->height != avctx->height) { 128 } else if (s->width != avctx->width || s->height != avctx->height) {
127 /* H.263 could change picture size any time */ 129 /* H.263 could change picture size any time */
128 MPV_common_end(s); 130 MPV_common_end(s);
129 if (MPV_common_init(s) < 0) 131 if (MPV_common_init(s) < 0)
130 return -1; 132 return -1;
131 } 133 }
132 } 134
133 if (ret < 0) 135 if (ret < 0)
134 return -1; 136 return -1;
135 137
136 MPV_frame_start(s); 138 MPV_frame_start(s);
137 139