]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dcadata.h
avcodec/cabac: force get_cabac to be not inlined
[ffmpeg] / libavcodec / dcadata.h
index 5b22698f2ac286f72452120ef92c219d144ded98..5154fbca0ca0a40d1b233586c4c17904989379da 100644 (file)
@@ -7505,24 +7505,19 @@ DECLARE_ALIGNED(16, static const float, lfe_fir_128)[] =
     0.01724460535, 0.47964480519, 0.48503074050, 0.01805862412,
 };
 
-/* 10^-(dB/20), with dB being a list of dB values ranging from 0 to -72 */
-/* do a 20*log10(dca_downmix_coeffs) to reconvert the values */
-
-static const float dca_downmix_coeffs[65] = {
-  1.000000000000000, 0.988553094656939, 0.971627951577106, 0.944060876285923, 0.917275935389780, 0.891250938133746,
-  0.865964323360065, 0.841395141645195, 0.817523037943650, 0.794328234724281, 0.771791515585012, 0.749894209332456,
-  0.728618174513228, 0.707945784384138, 0.687859912308808, 0.668343917568615, 0.649381631576211, 0.630957344480193,
-  0.613055792149821, 0.595662143529010, 0.578761988349121, 0.562341325190349, 0.546386549881854, 0.530884444230988,
-  0.515822165072306, 0.501187233627272, 0.446683592150963, 0.398107170553497, 0.354813389233575, 0.316227766016838,
-  0.281838293126445, 0.251188643150958, 0.223872113856834, 0.199526231496888, 0.177827941003892, 0.158489319246111,
-  0.141253754462275, 0.125892541179417, 0.112201845430196, 0.100000000000000, 0.089125093813374, 0.079432823472428,
-  0.070794578438414, 0.063095734448019, 0.053088444423099, 0.044668359215096, 0.037583740428844, 0.031622776601684,
-  0.026607250597988, 0.022387211385683, 0.018836490894898, 0.015848931924611, 0.013335214321633, 0.011220184543020,
-  0.009440608762859, 0.007943282347243, 0.005623413251903, 0.003981071705535, 0.002818382931264, 0.001995262314969,
-  0.001412537544623, 0.001000000000000, 0.000501187233627, 0.000251188643151, 0.000000000000000,
-};
-
-static const float dca_downmix_scale_factors[241] = {
+/*
+ * D.11 Look-up Table for Downmix Scale Factors
+ *
+ * Note that the range of the entries in DmixTable[] is between -60 dB and 0 dB
+ * with addition of -inf (|DMixCoeff| = 0), which is coded with a DmixCode = 0.
+ * Furthermore, the range [-60 to 0] is subdivided into 3 regions, each with a
+ * different grid resolution:
+ *
+ * 1) [-60.000 to -30] with resolution of 0.500 dB
+ * 2) [-29.750 to -15] with resolution of 0.250 dB
+ * 3) [-14.875 to   0] with resolution of 0.125 dB
+ */
+static const float dca_dmixtable[241] = {
     0.001000, 0.001059, 0.001122, 0.001189, 0.001259, 0.001334, 0.001413, 0.001496,
     0.001585, 0.001679, 0.001778, 0.001884, 0.001995, 0.002113, 0.002239, 0.002371,
     0.002512, 0.002661, 0.002818, 0.002985, 0.003162, 0.003350, 0.003548, 0.003758,
@@ -7553,20 +7548,20 @@ static const float dca_downmix_scale_factors[241] = {
     0.707107, 0.718208, 0.728618, 0.739180, 0.749894, 0.760764, 0.771792, 0.782979,
     0.794328, 0.805842, 0.817523, 0.829373, 0.841395, 0.853591, 0.865964, 0.878517,
     0.891251, 0.904170, 0.917276, 0.930572, 0.944061, 0.957745, 0.971628, 0.985712,
-    1.000000
+    1.000000,
 };
 
-static const float dca_default_coeffs[10][5][2] = {
-    { { 0.707946, 0.707946 },                                                                                                 }, // A
-    { { 1.000000, 0.000000 }, { 0.000000, 1.000000 },                                                                         }, // A + B (dual mono)
-    { { 1.000000, 0.000000 }, { 0.000000, 1.000000 },                                                                         }, // L + R (stereo)
-    { { 1.000000, 0.000000 }, { 0.000000, 1.000000 },                                                                         }, // (L+R) + (L-R) (sum-difference)
-    { { 1.000000, 0.000000 }, { 0.000000, 1.000000 },                                                                         }, // LT + RT (left and right total)
-    { { 0.865964, 0.865964 }, { 1.000000, 0.501187 }, { 0.501187, 1.000000 },                                                 }, // C + L + R
-    { { 1.000000, 0.501187 }, { 0.501187, 1.000000 }, { 0.707946, 0.707946 },                                                 }, // L + R + S
-    { { 0.865964, 0.865964 }, { 1.000000, 0.501187 }, { 0.501187, 1.000000 }, { 0.707946, 0.707946 },                         }, // C + L + R + S
-    { { 1.000000, 0.501187 }, { 0.501187, 1.000000 }, { 1.000000, 0.707946 }, { 0.707946, 1.000000 },                         }, // L + R + SL + SR
-    { { 0.865964, 0.865964 }, { 1.000000, 0.501187 }, { 0.501187, 1.000000 }, { 1.000000, 0.707946 }, { 0.707946, 1.000000 }, }, // C + L + R + SL + SR
+static const float dca_default_coeffs[10][6][2] = {
+    { { 0.707107, 0.707107 }, { 0.000000, 0.000000 },                                                                                                 }, // A [LFE]
+    { { 1.000000, 0.000000 }, { 0.000000, 1.000000 }, { 0.000000, 0.000000 },                                                                         }, // A + B (dual mono) [LFE]
+    { { 1.000000, 0.000000 }, { 0.000000, 1.000000 }, { 0.000000, 0.000000 },                                                                         }, // L + R (stereo) [LFE]
+    { { 1.000000, 0.000000 }, { 0.000000, 1.000000 }, { 0.000000, 0.000000 },                                                                         }, // (L+R) + (L-R) (sum-difference) [LFE]
+    { { 1.000000, 0.000000 }, { 0.000000, 1.000000 }, { 0.000000, 0.000000 },                                                                         }, // LT + RT (left and right total) [LFE]
+    { { 0.501187, 0.501187 }, { 0.707107, 0.000000 }, { 0.000000, 0.707107 }, { 0.000000, 0.000000 },                                                 }, // C + L + R [LFE]
+    { { 0.707107, 0.000000 }, { 0.000000, 0.707107 }, { 0.501187, 0.501187 }, { 0.000000, 0.000000 },                                                 }, // L + R + S [LFE]
+    { { 0.501187, 0.501187 }, { 0.707107, 0.000000 }, { 0.000000, 0.707107 }, { 0.501187, 0.501187 }, { 0.000000, 0.000000 },                         }, // C + L + R + S [LFE]
+    { { 0.707107, 0.000000 }, { 0.000000, 0.707107 }, { 0.501187, 0.000000 }, { 0.000000, 0.501187 }, { 0.000000, 0.000000 },                         }, // L + R + SL + SR [LFE]
+    { { 0.501187, 0.501187 }, { 0.707107, 0.000000 }, { 0.000000, 0.707107 }, { 0.501187, 0.000000 }, { 0.000000, 0.501187 }, { 0.000000, 0.000000 }, }, // C + L + R + SL + SR [LFE]
 };
 
 /* downmix coeffs