summaryrefslogtreecommitdiff
path: root/libswscale/output.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-14 17:19:32 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-15 21:39:32 +0200
commit1e0e193240a8e47a980ac76b8b5af831b17b7928 (patch)
tree94c567820d1581aacfad6d01f1ba79d28a1df195 /libswscale/output.c
parent60e9b8556ab33af8087968b1de15867ede7c5685 (diff)
sws: add dither enum
This allows specifying more dither algorithms without using up flags and without ambiguities. Also initialize the new field based on the flags and use it. Note, improving the logic of the checks is left to subsequent commits, this here only switches from flags to enum. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale/output.c')
-rw-r--r--libswscale/output.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libswscale/output.c b/libswscale/output.c
index 54b6ebd461..2d390c706c 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -349,7 +349,7 @@ yuv2mono_X_c_template(SwsContext *c, const int16_t *lumFilter,
Y1 = av_clip_uint8(Y1);
Y2 = av_clip_uint8(Y2);
}
- if (c->flags & SWS_ERROR_DIFFUSION) {
+ if (c->dither == SWS_DITHER_ED) {
Y1 += (7*err + 1*c->dither_error[0][i] + 5*c->dither_error[0][i+1] + 3*c->dither_error[0][i+2] + 8 - 256)>>4;
c->dither_error[0][i] = err;
acc = 2*acc + (Y1 >= 128);
@@ -386,7 +386,7 @@ yuv2mono_2_c_template(SwsContext *c, const int16_t *buf[2],
int yalpha1 = 4096 - yalpha;
int i;
- if (c->flags & SWS_ERROR_DIFFUSION) {
+ if (c->dither == SWS_DITHER_ED) {
int err = 0;
int acc = 0;
for (i = 0; i < dstW; i +=2) {
@@ -443,7 +443,7 @@ yuv2mono_1_c_template(SwsContext *c, const int16_t *buf0,
const uint8_t * const d128 = dither_8x8_220[y & 7];
int i;
- if (c->flags & SWS_ERROR_DIFFUSION) {
+ if (c->dither == SWS_DITHER_ED) {
int err = 0;
int acc = 0;
for (i = 0; i < dstW; i +=2) {