Skip to content

Commit 8c8bd5a

Browse files
committed
Merge commit '3a538e4db39ddcbb7becf81ab3004ca83b4ccf79' into libjamesdsp_upgrade
2 parents 3987e9c + 3a538e4 commit 8c8bd5a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2049
-1107
lines changed

libjamesdsp/subtree/Main/DSPManager/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<application
1212
android:icon="@drawable/icon"
1313
android:label="@string/app_name"
14-
android:requestLegacyExternalStorage="true"
1514
android:persistent="true"
1615
android:allowBackup="true">
1716
<activity

libjamesdsp/subtree/Main/DSPManager/jni/main/JdspImpResToolbox.c

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,8 @@ void circshift(float *x, int n, int k)
398398
k < 0 ? shift(x, -k, n) : shift(x, n - k, n);
399399
}
400400
#define NUMPTS 15
401-
ierper pch1, pch2;
401+
#define NUMPTS_DRS (7)
402+
ierper pch1, pch2, pch3;
402403
__attribute__((constructor)) static void initialize(void)
403404
{
404405
if (decompressedCoefficients)
@@ -407,13 +408,15 @@ __attribute__((constructor)) static void initialize(void)
407408
decompressResamplerMQ(compressedCoeffMQ, decompressedCoefficients);
408409
initIerper(&pch1, NUMPTS + 2);
409410
initIerper(&pch2, NUMPTS + 2);
411+
initIerper(&pch3, NUMPTS_DRS + 2);
410412
}
411413
__attribute__((destructor)) static void destruction(void)
412414
{
413415
free(decompressedCoefficients);
414416
decompressedCoefficients = 0;
415417
freeIerper(&pch1);
416418
freeIerper(&pch2);
419+
freeIerper(&pch3);
417420
}
418421
void JamesDSPOfflineResampling(float const *in, float *out, size_t lenIn, size_t lenOut, int channels, double src_ratio, int resampleQuality)
419422
{
@@ -680,9 +683,32 @@ JNIEXPORT jint JNICALL Java_james_dsp_activity_JdspImpResToolbox_ComputeEqRespon
680683
lerpPtr = &pch2;
681684
}
682685
for (int i = 0; i < queryPts; i++)
683-
{
684686
javaResponsePtr[i] = (float)getValueAt(&lerpPtr->cb, javadispFreqPtr[i]);
685-
}
687+
(*env)->ReleaseDoubleArrayElements(env, dispFreq, javadispFreqPtr, 0);
688+
(*env)->SetFloatArrayRegion(env, response, 0, queryPts, javaResponsePtr);
689+
return 0;
690+
}
691+
double freqComp[NUMPTS_DRS + 2];
692+
double gainComp[NUMPTS_DRS + 2];
693+
JNIEXPORT jint JNICALL Java_james_dsp_activity_JdspImpResToolbox_ComputeCompResponse
694+
(JNIEnv *env, jobject obj, jint n, jdoubleArray jfreq, jdoubleArray jgain, jint queryPts, jdoubleArray dispFreq, jfloatArray response)
695+
{
696+
jdouble *javaFreqPtr = (jdouble*) (*env)->GetDoubleArrayElements(env, jfreq, 0);
697+
jdouble *javaGainPtr = (jdouble*) (*env)->GetDoubleArrayElements(env, jgain, 0);
698+
jdouble *javadispFreqPtr = (jdouble*) (*env)->GetDoubleArrayElements(env, dispFreq, 0);
699+
jfloat *javaResponsePtr = (jfloat*) (*env)->GetFloatArrayElements(env, response, 0);
700+
memcpy(freqComp + 1, javaFreqPtr, NUMPTS_DRS * sizeof(double));
701+
memcpy(gainComp + 1, javaGainPtr, NUMPTS_DRS * sizeof(double));
702+
(*env)->ReleaseDoubleArrayElements(env, jfreq, javaFreqPtr, 0);
703+
(*env)->ReleaseDoubleArrayElements(env, jgain, javaGainPtr, 0);
704+
freqComp[0] = 0.0;
705+
gainComp[0] = gainComp[1];
706+
freqComp[NUMPTS_DRS + 1] = 24000.0;
707+
gainComp[NUMPTS_DRS + 1] = gainComp[NUMPTS_DRS];
708+
makima(&pch3, freqComp, gainComp, NUMPTS_DRS + 2, 1, 1);
709+
ierper *lerpPtr = &pch3;
710+
for (int i = 0; i < queryPts; i++)
711+
javaResponsePtr[i] = (float)getValueAt(&lerpPtr->cb, javadispFreqPtr[i]);
686712
(*env)->ReleaseDoubleArrayElements(env, dispFreq, javadispFreqPtr, 0);
687713
(*env)->SetFloatArrayRegion(env, response, 0, queryPts, javaResponsePtr);
688714
return 0;

libjamesdsp/subtree/Main/DSPManager/project.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
1212

1313
# Project target.
14-
target=android-29
14+
target=android-28
1515
proguard.config=proguard.txt
16-
android.library.reference.1=../../appcompatSupport
16+
android.library.reference.1=../../../appcompatSupport

libjamesdsp/subtree/Main/DSPManager/res/layout/equalizer.xml renamed to libjamesdsp/subtree/Main/DSPManager/res/layout/compander.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
android:layout_gravity="center"
66
android:layout_width="fill_parent">
77

8-
<james.dsp.preference.EqualizerSurface
9-
android:id="@+id/FrequencyResponse"
8+
<james.dsp.preference.CompanderSurface
9+
android:id="@+id/DynamicResponse"
1010
android:layout_height="fill_parent"
1111
android:layout_width="fill_parent" />
1212
</LinearLayout>

libjamesdsp/subtree/Main/DSPManager/res/layout/equalizer_popup.xml renamed to libjamesdsp/subtree/Main/DSPManager/res/layout/compander_popup.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
android:layout_width="fill_parent"
55
android:layout_height="300dp">
66

7-
<james.dsp.preference.EqualizerSurface
8-
android:id="@+id/FrequencyResponse"
7+
<james.dsp.preference.CompanderSurface
8+
android:id="@+id/DynamicResponse"
99
android:layout_width="fill_parent"
1010
android:layout_height="fill_parent" />
1111
</LinearLayout>

libjamesdsp/subtree/Main/DSPManager/res/layout/drc.xml renamed to libjamesdsp/subtree/Main/DSPManager/res/layout/eq.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
android:layout_gravity="center"
66
android:layout_width="fill_parent">
77

8-
<james.dsp.preference.DRCSurface
9-
android:id="@+id/IOGraph"
8+
<james.dsp.preference.EQSurface
9+
android:id="@+id/MagnitudeResponse"
1010
android:layout_height="fill_parent"
1111
android:layout_width="fill_parent" />
1212
</LinearLayout>

libjamesdsp/subtree/Main/DSPManager/res/layout/drc_popup.xml renamed to libjamesdsp/subtree/Main/DSPManager/res/layout/eq_popup.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
android:layout_width="fill_parent"
55
android:layout_height="300dp">
66

7-
<james.dsp.preference.DRCSurface
8-
android:id="@+id/IOGraph"
7+
<james.dsp.preference.EQSurface
8+
android:id="@+id/MagnitudeResponse"
99
android:layout_width="fill_parent"
1010
android:layout_height="fill_parent" />
1111
</LinearLayout>

libjamesdsp/subtree/Main/DSPManager/res/values-ru/arrays.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
33
<string-array name="equalizer_filtertype">
4-
<item>Минимально-фазовый</item>
5-
<item>Линейно-фазовый</item>
4+
<item>КИХ Минимально-фазовый</item>
5+
<item>IIR 4 order</item>
6+
<item>IIR 6 order</item>
7+
<item>IIR 8 order</item>
8+
<item>IIR 10 order</item>
9+
<item>IIR 12 order</item>
610
</string-array>
711
<string-array name="equalizer_dialog_spinterpolation">
812
<item>Кубический сплайн Эрмита</item>

libjamesdsp/subtree/Main/DSPManager/res/values-zh-rCN/arrays.xml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,25 @@
99
<item>超长混响1</item>
1010
<item>超长混响2</item>
1111
</string-array>
12-
<string-array name="compression_modes">
13-
<item>轻微</item>
14-
<item>中等</item>
12+
<string-array name="compression_granularity">
13+
<item>很低</item>
14+
<item>低</item>
15+
<item>中</item>
16+
<item>高</item>
17+
<item>极高</item>
18+
</string-array>
19+
<string-array name="compression_tfresolution">
20+
<item>均匀(短时傅里叶)</item>
21+
<item>多解析率(连续小波)</item>
22+
<item>多解析率(时域)</item>
1523
</string-array>
1624
<string-array name="equalizer_filtertype">
17-
<item>最小相位</item>
18-
<item>线性相位</item>
19-
</string-array>
20-
<string-array name="equalizer_stringfiltertype">
21-
<item>最小相位</item>
22-
<item>线性相位</item>
25+
<item>最小相位FIR</item>
26+
<item>4阶IIR</item>
27+
<item>6阶IIR</item>
28+
<item>8阶IIR</item>
29+
<item>10阶IIR</item>
30+
<item>12阶IIR</item>
2331
</string-array>
2432
<string-array name="equalizer_dialog_spinterpolation">
2533
<item>分段三次Hermite插值</item>

libjamesdsp/subtree/Main/DSPManager/res/values-zh-rCN/strings.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,25 @@
1616
<string name="pref_dsp_enable">总音讯效果控制</string>
1717
<string name="dspcrashed">DSP采样率出问题\n引擎崩溃\n正在重启引擎!</string>
1818
<string name="dspneedreboot">获取引擎进程PID失败</string>
19-
<string name="pref_compression_title">动态范围压缩</string>
20-
<string name="pref_compression_summary_on">已启用压缩</string>
21-
<string name="pref_compression_summary_off">已停用压缩</string>
22-
<string name="pref_compression_enable">启用压缩动态范围</string>
23-
<string name="dialog_maxatk">功率包络上升沿</string>
24-
<string name="dialog_maxrel">功率包络下降沿</string>
25-
<string name="dialog_adaptspeed">强度</string>
19+
<string name="pref_compression_title">动态范围压扩器</string>
20+
<string name="pref_compression_summary_on">已启用压扩器</string>
21+
<string name="pref_compression_summary_off">已停用压扩器</string>
22+
<string name="pref_compression_enable">启用动态范围压扩器</string>
23+
<string name="dialog_compression_timeconstant">时间常数</string>
24+
<string name="dialog_compression_granularity">粒度</string>
25+
<string name="dialog_compression_tfresolution">时频变换</string>
2626
<string name="pref_effect_title">选择效果程度</string>
2727
<string name="dialog_filtertype">滤波器类型</string>
2828
<string name="dialog_spinterpolation">插值器</string>
2929
<string name="dialog_effect">效果程度</string>
30-
<string name="pref_equalizer_title">基于插值的FIR均衡器</string>
30+
<string name="pref_equalizer_title">多模均衡器</string>
3131
<string name="pref_strequalizer_title">任意响应滤波器</string>
3232
<string name="pref_strequalizer_summary_on">使用任意响应滤波器</string>
3333
<string name="pref_strequalizer_summary_off">关闭任意响应滤波器</string>
3434
<string name="dialog_magnitude_response">幅度增益字串输入</string>
35-
<string name="pref_equalizer_summary_on">已启用FIR等化器</string>
36-
<string name="pref_equalizer_summary_off">已停用FIR等化器</string>
37-
<string name="pref_equalizer_enable">使用插值FIR等化器</string>
35+
<string name="pref_equalizer_summary_on">已启用多模等化器</string>
36+
<string name="pref_equalizer_summary_off">已停用多模等化器</string>
37+
<string name="pref_equalizer_enable">使用多模等化器</string>
3838
<string name="pref_strequalizer_enable">使用任意幅度响应滤波器</string>
3939
<string name="pref_strphase_enable">使用任意移相器</string>
4040
<string name="pref_equalizer_preset_title">选择设置</string>

0 commit comments

Comments
 (0)