NINT as specified in 14496-3 is round away from zero which corresponds
to lroundf not lrintf. I looked at all the places where it could
actually affect the result and I found two places but it might be
better to change them all to be safe. Thoughts?
From 4b3d5379af513b076397167283814564ab4e86fb Mon Sep 17 00:00:00 2001
From: Alex Converse <alex.conve...@gmail.com>
Date: Wed, 18 Nov 2009 05:17:07 -0500
Subject: [PATCH 08/11] NINT as specified in 14496-3 is lroundf not lrintf.
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------1"

This is a multi-part message in MIME format.
--------------1
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit

---
 aacsbr.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


--------------1
Content-Type: text/x-patch; name="0008-NINT-as-specified-in-14496-3-is-lroundf-not-lrintf.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0008-NINT-as-specified-in-14496-3-is-lroundf-not-lrintf.patch"

diff --git a/aacsbr.c b/aacsbr.c
index 49bb026..9cd8ca7 100644
--- a/aacsbr.c
+++ b/aacsbr.c
@@ -202,7 +202,7 @@ static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr,
             sbr->n_master = ((unsigned int)((sbr->k[2] - sbr->k[0]) / (float)(dk << 1))) << 1;
         } else {
             dk = 2;
-            sbr->n_master =          lrintf((sbr->k[2] - sbr->k[0]) / (float)(dk << 1))  << 1;
+            sbr->n_master =         lroundf((sbr->k[2] - sbr->k[0]) / (float)(dk << 1))  << 1;
         }
 
         for (k = 1; k <= sbr->n_master; k++)
@@ -848,7 +848,7 @@ static int sbr_time_freq_grid(AACContext *ac, SpectralBandReplication *sbr,
     sbr->t_env[ch][ch_data->bs_num_env[1]] = abs_bord_trail;
 
     if (ch_data->bs_frame_class == FIXFIX) {
-        unsigned int temp = (unsigned int)lrintf(abs_bord_trail / (float)ch_data->bs_num_env[1]);
+        unsigned int temp = (unsigned int)lroundf(abs_bord_trail / (float)ch_data->bs_num_env[1]);
         for (i = 0; i < n_rel_lead; i++)
             sbr->t_env[ch][i + 1] = sbr->t_env[ch][i] + temp;
     } else if (ch_data->bs_frame_class > 1) { // VARFIX or VARVAR

--------------1--


_______________________________________________
FFmpeg-soc mailing list
FFmpeg-soc@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to