Browse code

psymodel: Remove the single channel analysis function

Nathan Caldwell authored on 2011/05/19 14:23:22
Showing 3 changed files
... ...
@@ -572,7 +572,7 @@ static int aac_encode_frame(AVCodecContext *avctx,
572 572
             put_bits(&s->pb, 4, chan_el_counter[tag]++);
573 573
             for (ch = 0; ch < chans; ch++)
574 574
                 coeffs[ch] = cpe->ch[ch].coeffs;
575
-            s->psy.model->analyze_group(&s->psy, start_ch, coeffs, wi);
575
+            s->psy.model->analyze(&s->psy, start_ch, coeffs, wi);
576 576
             for (ch = 0; ch < chans; ch++) {
577 577
                 s->cur_channel = start_ch * 2 + ch;
578 578
                 s->coder->search_for_quantizers(avctx, s, &cpe->ch[ch], s->lambda);
... ...
@@ -557,8 +557,8 @@ static float calc_reduced_thr_3gpp(AacPsyBand *band, float min_snr,
557 557
 /**
558 558
  * Calculate band thresholds as suggested in 3GPP TS26.403
559 559
  */
560
-static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
561
-                             const float *coefs, const FFPsyWindowInfo *wi)
560
+static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
561
+                                     const float *coefs, const FFPsyWindowInfo *wi)
562 562
 {
563 563
     AacPsyContext *pctx = (AacPsyContext*) ctx->model_priv_data;
564 564
     AacPsyChannel *pch  = &pctx->ch[channel];
... ...
@@ -741,14 +741,14 @@ static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
741 741
     memcpy(pch->prev_band, pch->band, sizeof(pch->band));
742 742
 }
743 743
 
744
-static void psy_3gpp_analyze_group(FFPsyContext *ctx, int channel,
744
+static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
745 745
                                    const float **coeffs, const FFPsyWindowInfo *wi)
746 746
 {
747 747
     int ch;
748 748
     FFPsyChannelGroup *group = ff_psy_find_group(ctx, channel);
749 749
 
750 750
     for (ch = 0; ch < group->num_ch; ch++)
751
-        psy_3gpp_analyze(ctx, channel + ch, coeffs[ch], &wi[ch]);
751
+        psy_3gpp_analyze_channel(ctx, channel + ch, coeffs[ch], &wi[ch]);
752 752
 }
753 753
 
754 754
 static av_cold void psy_3gpp_end(FFPsyContext *apc)
... ...
@@ -931,6 +931,5 @@ const FFPsyModel ff_aac_psy_model =
931 931
     .init    = psy_3gpp_init,
932 932
     .window  = psy_lame_window,
933 933
     .analyze = psy_3gpp_analyze,
934
-    .analyze_group = psy_3gpp_analyze_group,
935 934
     .end     = psy_3gpp_end,
936 935
 };
... ...
@@ -112,16 +112,6 @@ typedef struct FFPsyModel {
112 112
     FFPsyWindowInfo (*window)(FFPsyContext *ctx, const int16_t *audio, const int16_t *la, int channel, int prev_type);
113 113
 
114 114
     /**
115
-     * Perform psychoacoustic analysis and set band info (threshold, energy) for a single channel.
116
-     *
117
-     * @param ctx     model context
118
-     * @param channel audio channel number
119
-     * @param coeffs  pointer to the transformed coefficients
120
-     * @param wi      window information
121
-     */
122
-    void (*analyze)(FFPsyContext *ctx, int channel, const float *coeffs, const FFPsyWindowInfo *wi);
123
-
124
-    /**
125 115
      * Perform psychoacoustic analysis and set band info (threshold, energy) for a group of channels.
126 116
      *
127 117
      * @param ctx      model context
... ...
@@ -129,7 +119,7 @@ typedef struct FFPsyModel {
129 129
      * @param coeffs   array of pointers to the transformed coefficients
130 130
      * @param wi       window information for the channels in the group
131 131
      */
132
-    void (*analyze_group)(FFPsyContext *ctx, int channel, const float **coeffs, const FFPsyWindowInfo *wi);
132
+    void (*analyze)(FFPsyContext *ctx, int channel, const float **coeffs, const FFPsyWindowInfo *wi);
133 133
 
134 134
     void (*end)    (FFPsyContext *apc);
135 135
 } FFPsyModel;