summaryrefslogtreecommitdiff
path: root/libswresample/dither.c
diff options
context:
space:
mode:
Diffstat (limited to 'libswresample/dither.c')
-rw-r--r--libswresample/dither.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libswresample/dither.c b/libswresample/dither.c
index 4e39cceb0d..663e2007ba 100644
--- a/libswresample/dither.c
+++ b/libswresample/dither.c
@@ -40,6 +40,11 @@ void swri_get_dither(void *dst, int len, unsigned seed, enum AVSampleFormat out_
switch(method){
case SWR_DITHER_RECTANGULAR: v= ((double)seed) / UINT_MAX - 0.5; break;
+ case SWR_DITHER_TRIANGULAR :
+ v = ((double)seed) / UINT_MAX;
+ seed = seed*1664525 + 1013904223;
+ v-= ((double)seed) / UINT_MAX;
+ break;
default: av_assert0(0);
}