diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-05-07 14:21:45 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-05-07 14:21:49 +0200 |
commit | 144baf427a6b786f1167f89597335e2eb512929c (patch) | |
tree | 9138d14ab8c7c8c8a832ca53f2acaafb8d420f6e | |
parent | acc4a7e5b350f56671ef4a19c56e5b1787428893 (diff) | |
parent | f381dc1d618611f149da32ab865bfc1b49861fd3 (diff) |
Merge remote-tracking branch 'cehoyos/master'
* cehoyos/master:
Support decoding of Lagarith frame type FRAME_SOLID_COLOR.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/lagarith.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c index 85997846e4..4285644f67 100644 --- a/libavcodec/lagarith.c +++ b/libavcodec/lagarith.c @@ -556,6 +556,28 @@ static int lag_decode_frame(AVCodecContext *avctx, } } break; + case FRAME_SOLID_COLOR: + if (avctx->bits_per_coded_sample == 24) { + avctx->pix_fmt = AV_PIX_FMT_RGB24; + } else { + avctx->pix_fmt = AV_PIX_FMT_RGB32; + offset_gu |= 0xFFU << 24; + } + + if ((ret = ff_thread_get_buffer(avctx, &frame,0)) < 0) + return ret; + + dst = p->data[0]; + for (j = 0; j < avctx->height; j++) { + for (i = 0; i < avctx->width; i++) + if (avctx->bits_per_coded_sample == 24) { + AV_WB24(dst + i * 3, offset_gu); + } else { + AV_WN32(dst + i * 4, offset_gu); + } + dst += p->linesize[0]; + } + break; case FRAME_ARITH_RGBA: avctx->pix_fmt = AV_PIX_FMT_RGB32; planes = 4; |