[FFmpeg-cvslog] avcodec/aacenc_is: Make ff_aac_is_encoding_err() static

Andreas Rheinhardt git at videolan.org
Wed Apr 9 15:03:12 EEST 2025


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Wed Apr  2 11:35:55 2025 +0200| [a2136d545cc4f9738f7ccba3a666bd0979c70ac9] | committer: Andreas Rheinhardt

avcodec/aacenc_is: Make ff_aac_is_encoding_err() static

Possible since 9b11fefb88c770b9c1d4d4583c61c6abde6c033c.
Also remove a now always-zero parameter.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 libavcodec/aacenc_is.c | 31 +++++++++++++++++++++----------
 libavcodec/aacenc_is.h | 16 ----------------
 2 files changed, 21 insertions(+), 26 deletions(-)

diff --git a/libavcodec/aacenc_is.c b/libavcodec/aacenc_is.c
index 4943b6450c..4e711382dc 100644
--- a/libavcodec/aacenc_is.c
+++ b/libavcodec/aacenc_is.c
@@ -30,16 +30,27 @@
 #include "aacenc_is.h"
 #include "aacenc_quantization.h"
 
-struct AACISError ff_aac_is_encoding_err(AACEncContext *s, ChannelElement *cpe,
-                                         int start, int w, int g, float ener0,
-                                         float ener1, float ener01,
-                                         int use_pcoeffs, int phase)
+/** Frequency in Hz for lower limit of intensity stereo **/
+#define INT_STEREO_LOW_LIMIT 6100
+
+struct AACISError {
+    int pass;    /* 1 if dist2 <= dist1  */
+    int phase;   /* -1 or +1             */
+    float error; /* fabs(dist1 - dist2)  */
+    float dist1; /* From original coeffs */
+    float dist2; /* From IS'd coeffs     */
+    float ener01;
+};
+
+static struct AACISError aac_is_encoding_err(AACEncContext *s, ChannelElement *cpe,
+                                             int start, int w, int g, float ener0,
+                                             float ener1, float ener01, int phase)
 {
     int i, w2;
     SingleChannelElement *sce0 = &cpe->ch[0];
     SingleChannelElement *sce1 = &cpe->ch[1];
-    float *L = use_pcoeffs ? sce0->pcoeffs : sce0->coeffs;
-    float *R = use_pcoeffs ? sce1->pcoeffs : sce1->coeffs;
+    float *L = sce0->coeffs;
+    float *R = sce1->coeffs;
     float *L34 = &s->scoefs[256*0], *R34 = &s->scoefs[256*1];
     float *IS  = &s->scoefs[256*2], *I34 = &s->scoefs[256*3];
     float dist1 = 0.0f, dist2 = 0.0f;
@@ -128,10 +139,10 @@ void ff_aac_search_for_is(AACEncContext *s, AVCodecContext *avctx, ChannelElemen
                         ener01p += (coef0 - coef1)*(coef0 - coef1);
                     }
                 }
-                ph_err1 = ff_aac_is_encoding_err(s, cpe, start, w, g,
-                                                 ener0, ener1, ener01p, 0, -1);
-                ph_err2 = ff_aac_is_encoding_err(s, cpe, start, w, g,
-                                                 ener0, ener1, ener01, 0, +1);
+                ph_err1 = aac_is_encoding_err(s, cpe, start, w, g,
+                                              ener0, ener1, ener01p, -1);
+                ph_err2 = aac_is_encoding_err(s, cpe, start, w, g,
+                                              ener0, ener1, ener01, +1);
                 best = (ph_err1.pass && ph_err1.error < ph_err2.error) ? &ph_err1 : &ph_err2;
                 if (best->pass) {
                     cpe->is_mask[w*16+g] = 1;
diff --git a/libavcodec/aacenc_is.h b/libavcodec/aacenc_is.h
index 269fd1a9c9..beaa70c790 100644
--- a/libavcodec/aacenc_is.h
+++ b/libavcodec/aacenc_is.h
@@ -30,22 +30,6 @@
 
 #include "aacenc.h"
 
-/** Frequency in Hz for lower limit of intensity stereo **/
-#define INT_STEREO_LOW_LIMIT 6100
-
-struct AACISError {
-    int pass;    /* 1 if dist2 <= dist1  */
-    int phase;   /* -1 or +1             */
-    float error; /* fabs(dist1 - dist2)  */
-    float dist1; /* From original coeffs */
-    float dist2; /* From IS'd coeffs     */
-    float ener01;
-};
-
-struct AACISError ff_aac_is_encoding_err(AACEncContext *s, ChannelElement *cpe,
-                                         int start, int w, int g, float ener0,
-                                         float ener1, float ener01,
-                                         int use_pcoeffs, int phase);
 void ff_aac_search_for_is(AACEncContext *s, AVCodecContext *avctx, ChannelElement *cpe);
 
 #endif /* AVCODEC_AACENC_IS_H */



More information about the ffmpeg-cvslog mailing list