AVCodecContext *avctx; ///< parent context
} AC3DecodeContext;
-/**
- * Generate a Kaiser-Bessel Derived Window.
- */
-static void ac3_window_init(float *window)
-{
- int i, j;
- double sum = 0.0, bessel, tmp;
- double local_window[256];
- double alpha2 = (5.0 * M_PI / 256.0) * (5.0 * M_PI / 256.0);
-
- for (i = 0; i < 256; i++) {
- tmp = i * (256 - i) * alpha2;
- bessel = 1.0;
- for (j = 100; j > 0; j--) /* default to 100 iterations */
- bessel = bessel * tmp / (j * j) + 1;
- sum += bessel;
- local_window[i] = sum;
- }
-
- sum++;
- for (i = 0; i < 256; i++)
- window[i] = sqrt(local_window[i] / sum);
-}
-
/**
* Symmetrical Dequantization
* reference: Section 7.3.3 Expansion of Mantissas for Symmetrical Quantization
ac3_tables_init();
ff_mdct_init(&s->imdct_256, 8, 1);
ff_mdct_init(&s->imdct_512, 9, 1);
- ac3_window_init(s->window);
+ ff_kbd_window_init(s->window);
dsputil_init(&s->dsp, avctx);
av_init_random(0, &s->dith_state);
FFTContext fft;
} MDCTContext;
+/**
+ * Generate a Kaiser-Bessel Derived Window.
+ * @param window pointer to half window
+ */
+void ff_kbd_window_init(float *window);
+
int ff_mdct_init(MDCTContext *s, int nbits, int inverse);
void ff_imdct_calc(MDCTContext *s, FFTSample *output,
const FFTSample *input, FFTSample *tmp);
* MDCT/IMDCT transforms.
*/
+// Generate a Kaiser-Bessel Derived Window.
+void ff_kbd_window_init(float *window)
+{
+ int i, j;
+ double sum = 0.0, bessel, tmp;
+ double local_window[256];
+ double alpha2 = (5.0 * M_PI / 256.0) * (5.0 * M_PI / 256.0);
+
+ for (i = 0; i < 256; i++) {
+ tmp = i * (256 - i) * alpha2;
+ bessel = 1.0;
+ for (j = 100; j > 0; j--) /* default to 100 iterations */
+ bessel = bessel * tmp / (j * j) + 1;
+ sum += bessel;
+ local_window[i] = sum;
+ }
+
+ sum++;
+ for (i = 0; i < 256; i++)
+ window[i] = sqrt(local_window[i] / sum);
+}
+
/**
* init MDCT or IMDCT computation.
*/