summaryrefslogtreecommitdiff
path: root/libswscale
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-19 18:29:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-19 18:31:35 +0200
commit8c50ea2251b57d9200d079f33648712965a46fd8 (patch)
tree466a4a9a7992cc04c7c37537d4e76effcc14e4d3 /libswscale
parent76d8d2388120910b46225299b3e10fb4dd18287f (diff)
swscale: set dither to a specific value for rgb/bgr8 output
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 3303dcbeaa..89b8a61752 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1203,6 +1203,8 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
dstFormat == AV_PIX_FMT_RGB4_BYTE ||
dstFormat == AV_PIX_FMT_BGR8 ||
dstFormat == AV_PIX_FMT_RGB8) {
+ if (c->dither == SWS_DITHER_AUTO)
+ c->dither = (flags & SWS_FULL_CHR_H_INT) ? SWS_DITHER_ED : SWS_DITHER_BAYER;
if (c->dither == SWS_DITHER_ED && !(flags & SWS_FULL_CHR_H_INT)) {
av_log(c, AV_LOG_DEBUG,
"Error diffusion dither is only supported in full chroma interpolation for destination format '%s'\n",