Mercurial > libavcodec.hg
comparison roqvideodec.c @ 5188:c2a475157299 libavcodec
add width and height in context and use them
patch by Vitor: [vitor1001 gmail com]
author | benoit |
---|---|
date | Tue, 26 Jun 2007 20:10:26 +0000 |
parents | b8e8aa53f613 |
children | 0af35881395e |
comparison
equal
deleted
inserted
replaced
5187:9968f39d03aa | 5188:c2a475157299 |
---|---|
143 av_log(ri->avctx, AV_LOG_ERROR, "Unknown vq code: %d\n", vqid); | 143 av_log(ri->avctx, AV_LOG_ERROR, "Unknown vq code: %d\n", vqid); |
144 } | 144 } |
145 } | 145 } |
146 | 146 |
147 xpos += 16; | 147 xpos += 16; |
148 if (xpos >= ri->avctx->width) { | 148 if (xpos >= ri->width) { |
149 xpos -= ri->avctx->width; | 149 xpos -= ri->width; |
150 ypos += 16; | 150 ypos += 16; |
151 } | 151 } |
152 if(ypos >= ri->avctx->height) | 152 if(ypos >= ri->height) |
153 break; | 153 break; |
154 } | 154 } |
155 } | 155 } |
156 | 156 |
157 | 157 |
158 static int roq_decode_init(AVCodecContext *avctx) | 158 static int roq_decode_init(AVCodecContext *avctx) |
159 { | 159 { |
160 RoqContext *s = avctx->priv_data; | 160 RoqContext *s = avctx->priv_data; |
161 | 161 |
162 s->avctx = avctx; | 162 s->avctx = avctx; |
163 s->width = avctx->width; | |
164 s->height = avctx->height; | |
163 s->last_frame = &s->frames[0]; | 165 s->last_frame = &s->frames[0]; |
164 s->current_frame = &s->frames[1]; | 166 s->current_frame = &s->frames[1]; |
165 avctx->pix_fmt = PIX_FMT_YUV444P; | 167 avctx->pix_fmt = PIX_FMT_YUV444P; |
166 dsputil_init(&s->dsp, avctx); | 168 dsputil_init(&s->dsp, avctx); |
167 | 169 |