[Android] Preferences : disable deblocking by default

Alexandre Perraud git at videolan.org
Sat Jun 22 14:58:14 CEST 2013


vlc-ports/android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Fri Jun 21 18:27:58 2013 +0200| [abffaf5587d81eaec7c8fef1773951d153cd01fe] | committer: Sébastien Toque

Preferences : disable deblocking by default

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=abffaf5587d81eaec7c8fef1773951d153cd01fe
---

 vlc-android/jni/libvlcjni.c                                   |    4 ++++
 vlc-android/res/values-fr/strings.xml                         |    4 +++-
 vlc-android/res/values/strings.xml                            |    2 ++
 vlc-android/res/xml/preferences.xml                           |    5 +++++
 vlc-android/src/org/videolan/libvlc/LibVLC.java               |    9 +++++++++
 vlc-android/src/org/videolan/vlc/Util.java                    |    1 +
 vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java |    1 +
 7 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/vlc-android/jni/libvlcjni.c b/vlc-android/jni/libvlcjni.c
index a7e7e76..f65d439 100644
--- a/vlc-android/jni/libvlcjni.c
+++ b/vlc-android/jni/libvlcjni.c
@@ -488,6 +488,9 @@ void Java_org_videolan_libvlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz)
     methodId = (*env)->GetMethodID(env, cls, "timeStretchingEnabled", "()Z");
     bool enable_time_stretch = (*env)->CallBooleanMethod(env, thiz, methodId);
 
+    methodId = (*env)->GetMethodID(env, cls, "deblockingEnabled", "()Z");
+    bool enable_deblocking = (*env)->CallBooleanMethod(env, thiz, methodId);
+
     methodId = (*env)->GetMethodID(env, cls, "getChroma", "()Ljava/lang/String;");
     jstring chroma = (*env)->CallObjectMethod(env, thiz, methodId);
     const char *chromastr = (*env)->GetStringUTFChars(env, chroma, 0);
@@ -513,6 +516,7 @@ void Java_org_videolan_libvlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz)
         "--avcodec-threads=0",
         "--subsdec-encoding", subsencodingstr,
         enable_time_stretch ? "--audio-time-stretch" : "--no-audio-time-stretch",
+        enable_deblocking ? "" : "--avcodec-skiploopfilter=3",
         use_opensles ? "--aout=opensles" : "--aout=android_audiotrack",
         "--androidsurface-chroma", chromastr != NULL && chromastr[0] != 0 ? chromastr : "RV32",
     };
diff --git a/vlc-android/res/values-fr/strings.xml b/vlc-android/res/values-fr/strings.xml
index 472c0dd..447c491 100644
--- a/vlc-android/res/values-fr/strings.xml
+++ b/vlc-android/res/values-fr/strings.xml
@@ -162,9 +162,11 @@
     <string name="chroma_format">Chroma Vidéo</string>
     <string name="chroma_format_summary">RGB 32-bit:\tmode par défaut\nRGB 16-bit:\taméliore les performances vidéos mais diminue la qualité\nYUV:\taméliore les performances vidéos mais ne fonctionne pas sur tous les appareils. Android 2.3 et supérieur uniquement</string>
     <string name="enable_iomx">Décodage matériel</string>
-    <string name="enable_iomx_summary">Activer l\'accélération matérielle pour améliorer les performances. Ne fonctionne pas sur tous les appareils.</string>
+    <string name="enable_iomx_summary">Active l\'accélération matérielle pour améliorer les performances. Ne fonctionne pas sur tous les appareils.</string>
     <string name="enable_time_stretching_audio">Correction audio</string>
     <string name="enable_time_stretching_audio_summary">Active la correction audio en lecture accélérée ou ralentie. Nécessite un appareil puissant</string>
+    <string name="enable_deblocking">Filtre de deblocking</string>
+    <string name="enable_deblocking_summary">Améliore la qualité mais nécessite un appareil puissant</string>
     <string name="other_prefs_category">Autre</string>
     <string name="clear_history">Supprimer l\'historique de vos recherches</string>
     <string name="clear_media_db">Réinitialiser votre bibliothèque multimédia</string>
diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 7e91747..394a873 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -191,6 +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="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 4c8852c..3ef3165 100644
--- a/vlc-android/res/xml/preferences.xml
+++ b/vlc-android/res/xml/preferences.xml
@@ -54,6 +54,11 @@
             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/libvlc/LibVLC.java b/vlc-android/src/org/videolan/libvlc/LibVLC.java
index 62bc6d2..d6964ce 100644
--- a/vlc-android/src/org/videolan/libvlc/LibVLC.java
+++ b/vlc-android/src/org/videolan/libvlc/LibVLC.java
@@ -58,6 +58,7 @@ public class LibVLC {
     private String subtitlesEncoding = "";
     private int aout = LibVlcUtil.isGingerbreadOrLater() ? AOUT_OPENSLES : AOUT_AUDIOTRACK_JAVA;
     private boolean timeStretching = false;
+    private boolean deblocking = false;
     private String chroma = "";
     private boolean verboseMode = true;
 
@@ -199,6 +200,14 @@ public class LibVLC {
         this.timeStretching = timeStretching;
     }
 
+    public boolean deblockingEnabled() {
+        return deblocking;
+    }
+
+    public void setDeblocking(boolean deblocking) {
+        this.deblocking = deblocking;
+    }
+
     public String getChroma() {
         return chroma;
     }
diff --git a/vlc-android/src/org/videolan/vlc/Util.java b/vlc-android/src/org/videolan/vlc/Util.java
index 2549887..d3baa1d 100644
--- a/vlc-android/src/org/videolan/vlc/Util.java
+++ b/vlc-android/src/org/videolan/vlc/Util.java
@@ -88,6 +88,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.setChroma(pref.getString("chroma_format", ""));
         instance.setVerboseMode(pref.getBoolean("enable_verbose_mode", true));
 
diff --git a/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java b/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java
index 3a42ce6..3847d68 100644
--- a/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java
@@ -204,6 +204,7 @@ public class PreferencesActivity extends PreferenceActivity implements OnSharedP
                 || key.equalsIgnoreCase("subtitles_text_encoding")
                 || key.equalsIgnoreCase("aout")
                 || key.equalsIgnoreCase("enable_time_stretching_audio")
+                || key.equalsIgnoreCase("enable_deblocking")
                 || key.equalsIgnoreCase("chroma_format")
                 || key.equalsIgnoreCase("enable_verbose_mode")) {
             Util.updateLibVlcSettings(sharedPreferences);



More information about the Android mailing list