~ubuntu-branches/debian/sid/mplayer/sid

« back to all changes in this revision

Viewing changes to libavcodec/roqvideodec.c

  • Committer: Bazaar Package Importer
  • Author(s): A Mennucc1
  • Date: 2009-03-23 10:05:45 UTC
  • mfrom: (4.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090323100545-x8h79obawnnte7kk
Tags: 1.0~rc2+svn20090303-5
debian/control : move docbook-xml,docbook-xsl,xsltproc from 
Build-Depends-Indep to Build-Depends, since they are needed to run
configure

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 */
20
20
 
21
21
/**
22
 
 * @file roqvideodec.c
23
 
 * Id RoQ Video Decoder by Dr. Tim Ferguson
24
 
 * For more information about the Id RoQ format, visit:
 
22
 * @file libavcodec/roqvideodec.c
 
23
 * id RoQ Video Decoder by Dr. Tim Ferguson
 
24
 * For more information about the id RoQ format, visit:
25
25
 *   http://www.csse.monash.edu.au/~timf/
26
26
 */
27
27
 
32
32
 
33
33
#include "avcodec.h"
34
34
#include "bytestream.h"
35
 
#include "dsputil.h"
36
35
#include "roqvideo.h"
37
36
 
38
37
static void roqvideo_decode_frame(RoqContext *ri)
43
42
    int vqid, bpos, xpos, ypos, xp, yp, x, y, mx, my;
44
43
    int frame_stats[2][4] = {{0},{0}};
45
44
    roq_qcell *qcell;
46
 
    unsigned char *buf = ri->buf;
47
 
    unsigned char *buf_end = ri->buf + ri->size;
 
45
    const unsigned char *buf = ri->buf;
 
46
    const unsigned char *buf_end = ri->buf + ri->size;
48
47
 
49
48
    while (buf < buf_end) {
50
49
        chunk_id = bytestream_get_le16(&buf);
154
153
}
155
154
 
156
155
 
157
 
static int roq_decode_init(AVCodecContext *avctx)
 
156
static av_cold int roq_decode_init(AVCodecContext *avctx)
158
157
{
159
158
    RoqContext *s = avctx->priv_data;
160
159
 
164
163
    s->last_frame    = &s->frames[0];
165
164
    s->current_frame = &s->frames[1];
166
165
    avctx->pix_fmt = PIX_FMT_YUV444P;
167
 
    dsputil_init(&s->dsp, avctx);
168
166
 
169
167
    return 0;
170
168
}
171
169
 
172
170
static int roq_decode_frame(AVCodecContext *avctx,
173
171
                            void *data, int *data_size,
174
 
                            uint8_t *buf, int buf_size)
 
172
                            const uint8_t *buf, int buf_size)
175
173
{
176
174
    RoqContext *s = avctx->priv_data;
177
175
    int copy= !s->current_frame->data[0];
198
196
    return buf_size;
199
197
}
200
198
 
201
 
static int roq_decode_end(AVCodecContext *avctx)
 
199
static av_cold int roq_decode_end(AVCodecContext *avctx)
202
200
{
203
201
    RoqContext *s = avctx->priv_data;
204
202
 
221
219
    roq_decode_end,
222
220
    roq_decode_frame,
223
221
    CODEC_CAP_DR1,
 
222
    .long_name = NULL_IF_CONFIG_SMALL("id RoQ video"),
224
223
};