| 214 | } |
| 215 | |
| 216 | static int decode_argb_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) |
| 217 | { |
| 218 | AVCodecContext *avctx = ctx->avctx; |
| 219 | uint8_t *dst; |
| 220 | int pred[4]; |
| 221 | int ret; |
| 222 | int i, j; |
| 223 | VLC vlc[4]; |
| 224 | |
| 225 | pred[0] = 0; |
| 226 | pred[1] = 0x80; |
| 227 | pred[2] = 0x80; |
| 228 | pred[3] = 0x80; |
| 229 | |
| 230 | dst = pic->data[0]; |
| 231 | |
| 232 | skip_bits(gb, 16); |
| 233 | |
| 234 | /* Read in code table for each plane */ |
| 235 | for (i = 0; i < 4; i++) { |
| 236 | ret = read_code_table(ctx, gb, &vlc[i]); |
| 237 | if (ret < 0) { |
| 238 | for (j = 0; j < i; j++) |
| 239 | ff_vlc_free(&vlc[j]); |
| 240 | |
| 241 | av_log(ctx->avctx, AV_LOG_ERROR, |
| 242 | "Could not read code table %d.\n", i); |
| 243 | return ret; |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | /* Read in and restore every line */ |
| 248 | for (i = 0; i < avctx->height; i++) { |
| 249 | read_argb_line(ctx, gb, pred, vlc, dst); |
| 250 | |
| 251 | dst += pic->linesize[0]; |
| 252 | } |
| 253 | |
| 254 | for (i = 0; i < 4; i++) |
| 255 | ff_vlc_free(&vlc[i]); |
| 256 | |
| 257 | return 0; |
| 258 | } |
| 259 | |
| 260 | static int decode_rgb24_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) |
| 261 | { |
no test coverage detected