[FFmpeg-devel] [PATCH 8/9] avcodec/wavpackenc: use lrint instead of floor hack

Ganesh Ajjanagadde gajjanagadde at gmail.com
Wed Dec 2 01:27:57 CET 2015


Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
---
 libavcodec/wavpackenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c
index 977bcf0..6a9b716 100644
--- a/libavcodec/wavpackenc.c
+++ b/libavcodec/wavpackenc.c
@@ -954,7 +954,7 @@ static void analyze_mono(WavPackEncodeContext *s, int32_t *samples, int do_sampl
     memcpy(s->sampleptrs[info.nterms + 1][0], s->sampleptrs[i][0], s->block_samples * 4);
 
     if (s->extra_flags & EXTRA_BRANCHES)
-        recurse_mono(s, &info, 0, (int) floor(s->delta_decay + 0.5),
+        recurse_mono(s, &info, 0, lrint(s->delta_decay),
                      log2mono(s->sampleptrs[0][0], s->block_samples, 0));
 
     if (s->extra_flags & EXTRA_SORT_FIRST)
@@ -1773,7 +1773,7 @@ static void analyze_stereo(WavPackEncodeContext *s,
     memcpy(s->sampleptrs[info.nterms + 1][1], s->sampleptrs[i][1], s->block_samples * 4);
 
     if (s->extra_flags & EXTRA_BRANCHES)
-        recurse_stereo(s, &info, 0, (int) floor(s->delta_decay + 0.5),
+        recurse_stereo(s, &info, 0, lrint(s->delta_decay),
                        log2stereo(s->sampleptrs[0][0], s->sampleptrs[0][1],
                                   s->block_samples, 0));
 
-- 
2.6.2



More information about the ffmpeg-devel mailing list