[FFmpeg-devel] [PATCH] lswr/rematrix: avoid clipping for floats too.
Nicolas George
nicolas.george at normalesup.org
Wed Aug 7 19:21:52 CEST 2013
A later conversion to a limited range is rather likely, either
inside ffmpeg or at a later step of the processing, and having
the rematrix coefficients depend on the format is fragile.
The old behaviour can be emulated by setting the rematrix_maxval
option to a large value.
Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
libswresample/rematrix.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
Whether this is a good or a bad thing is open to discussion.
No FATE test needed updating, which does not bode well for lswr coverage ;-(
diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c
index f13c240..af4c655 100644
--- a/libswresample/rematrix.c
+++ b/libswresample/rematrix.c
@@ -307,11 +307,8 @@ av_cold static int auto_matrix(SwrContext *s)
if (s->rematrix_maxval > 0) {
maxval = s->rematrix_maxval;
- } else if ( av_get_packed_sample_fmt(s->out_sample_fmt) < AV_SAMPLE_FMT_FLT
- || av_get_packed_sample_fmt(s->int_sample_fmt) < AV_SAMPLE_FMT_FLT) {
- maxval = 1.0;
} else
- maxval = INT_MAX;
+ maxval = 1.0;
if(maxcoef > maxval || s->rematrix_volume < 0){
maxcoef /= maxval;
--
1.7.10.4
More information about the ffmpeg-devel
mailing list