[Android] Util: add some sane deblocking defaults
Edward Wang
git at videolan.org
Sat Jun 22 18:44:46 CEST 2013
vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Sat Jun 22 12:40:32 2013 -0400| [f72afe683db7f37614320da8d043116706218686] | committer: Edward Wang
Util: add some sane deblocking defaults
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=f72afe683db7f37614320da8d043116706218686
---
vlc-android/res/values/strings.xml | 4 ++--
vlc-android/res/xml/preferences.xml | 9 ++++-----
vlc-android/src/org/videolan/vlc/Util.java | 16 +++++++++++++++-
3 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 394a873..926aa52 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -191,8 +191,8 @@
<string name="enable_iomx_summary">Improves performance, but may not work with all devices.</string>
<string name="enable_time_stretching_audio">Time-stretching audio</string>
<string name="enable_time_stretching_audio_summary">Speed up and slow down audio without changing the pitch (requires a fast device).</string>
- <string name="enable_deblocking">Deblocking filter</string>
- <string name="enable_deblocking_summary">Improves quality but requires a fast device</string>
+ <string name="enable_deblocking">Deblocking (loop) filter</string>
+ <string name="enable_deblocking_summary">Improves video quality but requires a fast device</string>
<string name="other_prefs_category">Other</string>
<string name="clear_history">Clear search history</string>
<string name="clear_media_db">Clear media database</string>
diff --git a/vlc-android/res/xml/preferences.xml b/vlc-android/res/xml/preferences.xml
index 3ef3165..301f418 100644
--- a/vlc-android/res/xml/preferences.xml
+++ b/vlc-android/res/xml/preferences.xml
@@ -50,15 +50,14 @@
android:summary="@string/enable_iomx_summary"
android:title="@string/enable_iomx" />
<CheckBoxPreference
+ android:key="enable_deblocking"
+ android:summary="@string/enable_deblocking_summary"
+ android:title="@string/enable_deblocking" />
+ <CheckBoxPreference
android:defaultValue="false"
android:key="enable_time_stretching_audio"
android:summary="@string/enable_time_stretching_audio_summary"
android:title="@string/enable_time_stretching_audio" />
- <CheckBoxPreference
- android:defaultValue="false"
- android:key="enable_deblocking"
- android:summary="@string/enable_deblocking_summary"
- android:title="@string/enable_deblocking" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/other_prefs_category" >
diff --git a/vlc-android/src/org/videolan/vlc/Util.java b/vlc-android/src/org/videolan/vlc/Util.java
index d3baa1d..19ca69c 100644
--- a/vlc-android/src/org/videolan/vlc/Util.java
+++ b/vlc-android/src/org/videolan/vlc/Util.java
@@ -37,6 +37,7 @@ import java.util.StringTokenizer;
import org.videolan.libvlc.LibVLC;
import org.videolan.libvlc.LibVlcException;
+import org.videolan.libvlc.LibVlcUtil;
import android.content.Context;
import android.content.SharedPreferences;
@@ -88,7 +89,7 @@ public class Util {
instance.setIomx(pref.getBoolean("enable_iomx", false));
instance.setSubtitlesEncoding(pref.getString("subtitles_text_encoding", ""));
instance.setTimeStretching(pref.getBoolean("enable_time_stretching_audio", false));
- instance.setDeblocking(pref.getBoolean("enable_deblocking", false));
+ instance.setDeblocking(pref.getBoolean("enable_deblocking", deblockingDefault()));
instance.setChroma(pref.getString("chroma_format", ""));
instance.setVerboseMode(pref.getBoolean("enable_verbose_mode", true));
@@ -102,6 +103,19 @@ public class Util {
instance.setAout(aout);
}
+ public static boolean deblockingDefault() {
+ // Set some reasonable deblocking defaults
+ // For now, we will enable it on all ARMv7+NEON devices
+ // and disable it on others.
+ boolean deblocking_default;
+ LibVlcUtil.MachineSpecs m = LibVlcUtil.getMachineSpecs();
+ if(m.hasArmV7 && m.hasNeon)
+ deblocking_default = true;
+ else
+ deblocking_default = false;
+ return deblocking_default;
+ }
+
/** Print an on-screen message to alert the user */
public static void toaster(Context context, int stringId, int duration) {
Toast.makeText(context, stringId, duration).show();
More information about the Android
mailing list