Revision bee4f778

View differences:

libavcodec/c93.c
46 46
#define C93_HAS_PALETTE 0x01
47 47
#define C93_FIRST_FRAME 0x02
48 48

  
49
static int c93_decode_init(AVCodecContext *avctx)
49
static int decode_init(AVCodecContext *avctx)
50 50
{
51 51
    avctx->pix_fmt = PIX_FMT_PAL8;
52 52
    return 0;
53 53
}
54 54

  
55
static int c93_decode_end(AVCodecContext *avctx)
55
static int decode_end(AVCodecContext *avctx)
56 56
{
57 57
    C93DecoderContext * const c93 = avctx->priv_data;
58 58

  
......
63 63
    return 0;
64 64
}
65 65

  
66
static inline int c93_copy_block(AVCodecContext *avctx, uint8_t *to,
66
static inline int copy_block(AVCodecContext *avctx, uint8_t *to,
67 67
        uint8_t *from, int offset, int height, int stride)
68 68
{
69 69
    int i;
......
97 97
    return 0;
98 98
}
99 99

  
100
static inline void c93_draw_n_color(uint8_t *out, int stride, int width,
100
static inline void draw_n_color(uint8_t *out, int stride, int width,
101 101
         int height, int bpp, uint8_t cols[4], uint8_t grps[4], uint32_t col)
102 102
{
103 103
    int x, y;
......
113 113
    }
114 114
}
115 115

  
116
static int c93_decode_frame(AVCodecContext *avctx, void *data,
116
static int decode_frame(AVCodecContext *avctx, void *data,
117 117
                            int *data_size, uint8_t * buf, int buf_size)
118 118
{
119 119
    C93DecoderContext * const c93 = avctx->priv_data;
......
168 168
            switch (bt & 0x0F) {
169 169
            case C93_8X8_FROM_PREV:
170 170
                offset = bytestream_get_le16(&buf);
171
                if (c93_copy_block(avctx, out, copy_from, offset, 8, stride))
171
                if (copy_block(avctx, out, copy_from, offset, 8, stride))
172 172
                    return -1;
173 173
                break;
174 174

  
......
178 178
                for (j = 0; j < 8; j += 4) {
179 179
                    for (i = 0; i < 8; i += 4) {
180 180
                        offset = bytestream_get_le16(&buf);
181
                        if (c93_copy_block(avctx, &out[j*stride+i],
181
                        if (copy_block(avctx, &out[j*stride+i],
182 182
                                           copy_from, offset, 4, stride))
183 183
                            return -1;
184 184
                    }
......
188 188
            case C93_8X8_2COLOR:
189 189
                bytestream_get_buffer(&buf, cols, 2);
190 190
                for (i = 0; i < 8; i++) {
191
                    c93_draw_n_color(out + i*stride, stride, 8, 1, 1, cols,
191
                    draw_n_color(out + i*stride, stride, 8, 1, 1, cols,
192 192
                                     NULL, *buf++);
193 193
                }
194 194

  
......
201 201
                    for (i = 0; i < 8; i += 4) {
202 202
                        if ((bt & 0x0F) == C93_4X4_2COLOR) {
203 203
                            bytestream_get_buffer(&buf, cols, 2);
204
                            c93_draw_n_color(out + i + j*stride, stride, 4, 4,
204
                            draw_n_color(out + i + j*stride, stride, 4, 4,
205 205
                                    1, cols, NULL, bytestream_get_le16(&buf));
206 206
                        } else if ((bt & 0x0F) == C93_4X4_4COLOR) {
207 207
                            bytestream_get_buffer(&buf, cols, 4);
208
                            c93_draw_n_color(out + i + j*stride, stride, 4, 4,
208
                            draw_n_color(out + i + j*stride, stride, 4, 4,
209 209
                                    2, cols, NULL, bytestream_get_le32(&buf));
210 210
                        } else {
211 211
                            bytestream_get_buffer(&buf, grps, 4);
212
                            c93_draw_n_color(out + i + j*stride, stride, 4, 4,
212
                            draw_n_color(out + i + j*stride, stride, 4, 4,
213 213
                                    1, cols, grps, bytestream_get_le16(&buf));
214 214
                        }
215 215
                    }
......
245 245
    CODEC_TYPE_VIDEO,
246 246
    CODEC_ID_C93,
247 247
    sizeof(C93DecoderContext),
248
    c93_decode_init,
248
    decode_init,
249 249
    NULL,
250
    c93_decode_end,
251
    c93_decode_frame,
250
    decode_end,
251
    decode_frame,
252 252
    CODEC_CAP_DR1,
253 253
};

Also available in: Unified diff