[FFmpeg-cvslog] opus_pvq: make max_den a float

Rostislav Pehlivanov git at videolan.org
Fri Sep 29 00:41:43 EEST 2017


ffmpeg | branch: master | Rostislav Pehlivanov <atomnuker at gmail.com> | Thu Sep 28 22:39:36 2017 +0100| [05dfa21d47f35f394938653abcab8b3baa3bc999] | committer: Rostislav Pehlivanov

opus_pvq: make max_den a float

Prevents int->float conversions on every loop.
Performance gain on synthetic benchmarks: 13%.
Suggested by kamedo2.

Signed-off-by: Rostislav Pehlivanov <atomnuker at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=05dfa21d47f35f394938653abcab8b3baa3bc999
---

 libavcodec/opus_pvq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/opus_pvq.c b/libavcodec/opus_pvq.c
index 2fb276099b..f98b85d36f 100644
--- a/libavcodec/opus_pvq.c
+++ b/libavcodec/opus_pvq.c
@@ -381,8 +381,9 @@ static float ppp_pvq_search_c(float *X, int *y, int K, int N)
     }
 
     while (K) {
-        int max_idx = 0, max_den = 1, phase = FFSIGN(K);
+        int max_idx = 0, phase = FFSIGN(K);
         float max_num = 0.0f;
+        float max_den = 1.0f;
         y_norm += 1.0f;
 
         for (i = 0; i < N; i++) {



More information about the ffmpeg-cvslog mailing list