diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-18 23:01:08 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-18 23:26:00 +0100 |
commit | 646ade76793c49317d05d54dc254d28f6738adbd (patch) | |
tree | decbbe098553a10f23227b47d3107055e2bb2d80 /libswscale/utils.c | |
parent | 24bbc416a4d8e2ed015b0d56aabbf4c49360fb8e (diff) | |
download | ffmpeg-646ade76793c49317d05d54dc254d28f6738adbd.tar.gz |
sws: Support error diffusion dither for mono output
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale/utils.c')
-rw-r--r-- | libswscale/utils.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c index 89bf0da59b..53f4fb8121 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -1247,6 +1247,9 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, c->vChrFilterPos[chrI]; } + for (i = 0; i < 4; i++) + FF_ALLOCZ_OR_GOTO(c, c->dither_error[i], (c->dstW+2) * sizeof(int), fail); + /* Allocate pixbufs (we use dynamic allocation because otherwise we would * need to allocate several megabytes to handle all possible cases) */ FF_ALLOC_OR_GOTO(c, c->lumPixBuf, c->vLumBufSize * 3 * sizeof(int16_t *), fail); @@ -1740,6 +1743,9 @@ void sws_freeContext(SwsContext *c) av_freep(&c->alpPixBuf); } + for (i = 0; i < 4; i++) + av_freep(&c->dither_error[i]); + av_freep(&c->vLumFilter); av_freep(&c->vChrFilter); av_freep(&c->hLumFilter); |