On Sat, Sep 24, 2011 at 12:19:16AM +0200, Jean First wrote:
> ---
> libavcodec/tiff.c | 22 ++++++++++++++++++----
> 1 files changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
> index ab5f1eb..78d30a7 100644
> --- a/libavcodec/tiff.c
> +++ b/libavcodec/tiff.c
> @@ -572,10 +572,24 @@ static int decode_frame(AVCodecContext *avctx,
> dst = p->data[0];
> soff = s->bpp >> 3;
> ssize = s->width * soff;
> - for(i = 0; i < s->height; i++) {
> - for(j = soff; j < ssize; j++)
> - dst[j] += dst[j - soff];
> - dst += stride;
> + if (s->avctx->pix_fmt == PIX_FMT_RGB48LE) {
> + for (i = 0; i < s->height; i++) {
> + for (j = soff; j < ssize; j += 2)
> + AV_WL16(dst + j, AV_RL16(dst + j) + AV_RL16(dst + j -
> soff));
> + dst += stride;
> + }
> + } else if (s->avctx->pix_fmt == PIX_FMT_RGB48BE) {
> + for (i = 0; i < s->height; i++) {
> + for (j = soff; j < ssize; j += 2)
> + AV_WB16(dst + j, AV_RB16(dst + j) + AV_RB16(dst + j -
> soff));
> + dst += stride;
> + }
> + } else {
> + for(i = 0; i < s->height; i++) {
> + for(j = soff; j < ssize; j++)
> + dst[j] += dst[j - soff];
> + dst += stride;
> + }
> }
> }
>
> --
looks OK
/me wants GRAY16* there too though
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel