ffmpeg | branch: master | Michael Niedermayer <[email protected]> | Thu 
Dec 24 22:13:56 2020 +0100| [e847cabb60a29c354512664022ad6833a907bf1b] | 
committer: Michael Niedermayer

avcodec/siren: Factorize category 5 and 6 noise computation

Signed-off-by: Michael Niedermayer <[email protected]>

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

 libavcodec/siren.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/libavcodec/siren.c b/libavcodec/siren.c
index 2d72fb9572..6c7a8e8b34 100644
--- a/libavcodec/siren.c
+++ b/libavcodec/siren.c
@@ -625,7 +625,7 @@ static int decode_vector(SirenContext *s, int 
number_of_regions,
 
         coefs_ptr = coefs + (region * REGION_SIZE);
 
-        if (category == 5) {
+        if (category == 5 || category == 6) {
             i = 0;
             for (j = 0; j < REGION_SIZE; j++) {
                 if (*coefs_ptr != 0)
@@ -633,15 +633,10 @@ static int decode_vector(SirenContext *s, int 
number_of_regions,
                 coefs_ptr++;
             }
 
-            noise = decoder_standard_deviation[region] * noise_category5[i];
-        } else if (category == 6) {
-            i = 0;
-            for (j = 0; j < REGION_SIZE; j++) {
-                if (*coefs_ptr++ != 0)
-                    i++;
-            }
-
-            noise = decoder_standard_deviation[region] * noise_category6[i];
+            if (category == 5) {
+                noise = decoder_standard_deviation[region] * 
noise_category5[i];
+            } else
+                noise = decoder_standard_deviation[region] * 
noise_category6[i];
         } else if (category == 7) {
             noise = decoder_standard_deviation[region] * 0.70711f;
         } else {

_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to