summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamera Software Integration <camswint@localhost>2015-07-29 11:29:17 -0700
committerSteve Kondik <steve@cyngn.com>2016-08-25 21:55:20 -0700
commit92defff221591e21df85e8a1d33f54b469fb9fe0 (patch)
tree0ded86cf4a9fba938fbc92923baf23da3962879a
parent33c9194c9e208c78b34a33fa9de9d5c109f9ceb6 (diff)
downloadandroid_packages_apps_Snap-92defff221591e21df85e8a1d33f54b469fb9fe0.zip
android_packages_apps_Snap-92defff221591e21df85e8a1d33f54b469fb9fe0.tar.gz
android_packages_apps_Snap-92defff221591e21df85e8a1d33f54b469fb9fe0.tar.bz2
SnapdragonCamera: Add noise reduction modes.
- Add menu for noise reduction modes Change-Id: Ie5cd6590e08938fb8fbb668ac1b48aac5fe801c3
-rw-r--r--res/values/qcomarrays.xml16
-rw-r--r--res/values/qcomstrings.xml17
-rw-r--r--res/values/strings.xml12
-rw-r--r--res/xml/video_preferences.xml8
-rw-r--r--src/com/android/camera/CameraSettings.java18
-rw-r--r--src/com/android/camera/VideoMenu.java1
-rw-r--r--src/com/android/camera/VideoModule.java37
7 files changed, 107 insertions, 2 deletions
diff --git a/res/values/qcomarrays.xml b/res/values/qcomarrays.xml
index 2b565fd..0bacfe3 100644
--- a/res/values/qcomarrays.xml
+++ b/res/values/qcomarrays.xml
@@ -513,13 +513,27 @@
<string-array name="pref_camera_facedetection_entries" translatable="false">
<item>@string/setting_off</item>
<item>@string/setting_on</item>
- </string-array>
+ </string-array>
<string-array name="pref_camera_facedetection_entryvalues" translatable="false">
<item>off</item>
<item>on</item>
</string-array>
+ <!-- Video Preferences Noise Reduction dialog box entries -->
+ <string-array name="pref_camera_noise_reduction_entries">
+ <item>@string/pref_camera_noise_reduction_entry_off</item>
+ <item>@string/pref_camera_noise_reduction_entry_fast</item>
+ <item>@string/pref_camera_noise_reduction_entry_high_quality</item>
+ </string-array>
+
+ <!-- Do not localize entryvalues -->
+ <string-array name="pref_camera_noise_reduction_entryvalues" translatable="false">
+ <item>@string/pref_camera_noise_reduction_value_off</item>
+ <item>@string/pref_camera_noise_reduction_value_fast</item>
+ <item>@string/pref_camera_noise_reduction_value_high_quality</item>
+ </string-array>
+
<!-- Denoise -->
<string-array name="pref_camera_denoise_entries" translatable="false">
<item>@string/setting_off</item>
diff --git a/res/values/qcomstrings.xml b/res/values/qcomstrings.xml
index f54df4f..371c03a 100644
--- a/res/values/qcomstrings.xml
+++ b/res/values/qcomstrings.xml
@@ -195,6 +195,23 @@
<!-- Denoise -->
<string name="pref_camera_denoise_title">Denoise</string>
+
+ <!-- Default noise reduction setting. Do not translate. -->
+ <string name="pref_camera_noise_reduction_default">off</string>
+
+ <!-- Settings screen, Select See More title -->
+ <string name="pref_camera_noise_reduction_title">Noise Reduction</string>
+
+ <!-- Settings screen, see more radio button choices -->
+ <string name="pref_camera_noise_reduction_entry_off">Off</string>
+ <string name="pref_camera_noise_reduction_entry_fast">Fast</string>
+ <string name="pref_camera_noise_reduction_entry_high_quality">High Quality</string>
+
+ <!-- see more entry values. Do not translate. -->
+ <string name="pref_camera_noise_reduction_value_off">off</string>
+ <string name="pref_camera_noise_reduction_value_fast">fast</string>
+ <string name="pref_camera_noise_reduction_value_high_quality">high-quality</string>
+
<string name="pref_camera_denoise_default" translatable="false">denoise-on</string>
<!-- ISO -->
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 7f97f5a..ddadda6 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -385,6 +385,18 @@
<!-- Toast after trying to select a setting that is not allowed to change in scene mode [CHAR LIMIT=NONE] -->
<string name="not_selectable_in_scene_mode">Not selectable in scene mode.</string>
+ <!-- Toast after High Quality Noise Reduction has been enabled to show CDS is disabled -->
+ <string name="disable_CDS_during_HighQualityNoiseReduction">High Quality Noise Reduction will disable CDS</string>
+
+ <!-- Toast after High Quality Noise Reduction has been enabled to show TNR is disabled -->
+ <string name="disable_TNR_during_HighQualityNoiseReduction">High Quality Noise Reduction will disable TNR</string>
+
+ <!-- Toast after SeeMore has been enabled to show CDS is disabled -->
+ <string name="disable_CDS_during_SeeMore">SeeMore will disable CDS.</string>
+
+ <!-- Toast after SeeMore has been enabled to show TNR is disabled -->
+ <string name="disable_TNR_during_SeeMore">SeeMore will disable TNR.</string>
+
<!-- Exposure settings in preference -->
<string name="pref_exposure_title">Exposure</string>
<string name="pref_exposure_default" translatable="false">0</string>
diff --git a/res/xml/video_preferences.xml b/res/xml/video_preferences.xml
index f4f8522..2cf47b5 100644
--- a/res/xml/video_preferences.xml
+++ b/res/xml/video_preferences.xml
@@ -131,7 +131,13 @@
camera:singleIcon="@drawable/ic_settings_fps"
camera:entries="@array/pref_camera_hfr_entries"
camera:entryValues="@array/pref_camera_hfr_entryvalues"/>
- <IconListPreference
+ <ListPreference
+ camera:key="pref_camera_noise_reduction_key"
+ camera:defaultValue="@string/pref_camera_noise_reduction_default"
+ camera:title="@string/pref_camera_noise_reduction_title"
+ camera:entries="@array/pref_camera_noise_reduction_entries"
+ camera:entryValues="@array/pref_camera_noise_reduction_entryvalues"/>
+ <ListPreference
camera:key="pref_camera_see_more_key"
camera:defaultValue="@string/pref_camera_see_more_default"
camera:title="@string/pref_camera_see_more_title"
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index 6d8778b..d3f5656 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -114,6 +114,7 @@ public class CameraSettings {
public static final String KEY_VIDEO_SNAPSHOT_SIZE = "pref_camera_videosnapsize_key";
public static final String KEY_VIDEO_HIGH_FRAME_RATE = "pref_camera_hfr_key";
public static final String KEY_SEE_MORE = "pref_camera_see_more_key";
+ public static final String KEY_NOISE_REDUCTION = "pref_camera_noise_reduction_key";
public static final String KEY_VIDEO_HDR = "pref_camera_video_hdr_key";
public static final String DEFAULT_VIDEO_QUALITY_VALUE = "custom";
public static final String KEY_SKIN_TONE_ENHANCEMENT = "pref_camera_skinToneEnhancement_key";
@@ -135,6 +136,7 @@ public class CameraSettings {
private static final String KEY_QC_SUPPORTED_FACE_RECOGNITION_MODES = "face-recognition-values";
private static final String KEY_QC_SUPPORTED_DIS_MODES = "dis-values";
private static final String KEY_QC_SUPPORTED_SEE_MORE_MODES = "see-more-values";
+ private static final String KEY_QC_SUPPORTED_NOISE_REDUCTION_MODES = "noise-reduction-mode-values";
private static final String KEY_QC_SUPPORTED_STILL_MORE_MODES = "still-more-values";
private static final String KEY_QC_SUPPORTED_CDS_MODES = "cds-mode-values";
private static final String KEY_QC_SUPPORTED_VIDEO_CDS_MODES = "video-cds-mode-values";
@@ -167,6 +169,7 @@ public class CameraSettings {
public static final String KEY_SNAPCAM_HDR_NEED_1X = "hdr-need-1x";
public static final String KEY_VIDEO_HSR = "video-hsr";
public static final String KEY_QC_SEE_MORE_MODE = "see-more";
+ public static final String KEY_QC_NOISE_REDUCTION_MODE = "noise-reduction-mode";
public static final String KEY_LUMINANCE_CONITION = "luminance-condition";
public static final String LUMINANCE_CONITION_LOW = "low";
@@ -484,6 +487,14 @@ public class CameraSettings {
return split(str);
}
+ public static List<String> getSupportedNoiseReductionModes(Parameters params) {
+ String str = params.get(KEY_QC_SUPPORTED_NOISE_REDUCTION_MODES);
+ if (str == null) {
+ return null;
+ }
+ return split(str);
+ }
+
public static List<String> getSupportedAEBracketingModes(Parameters params) {
String str = params.get(KEY_QC_SUPPORTED_AE_BRACKETING_MODES);
if (str == null) {
@@ -903,9 +914,16 @@ public class CameraSettings {
group.findPreference(KEY_VIDEO_HIGH_FRAME_RATE);
ListPreference seeMoreMode = group.findPreference(KEY_SEE_MORE);
ListPreference savePath = group.findPreference(KEY_CAMERA_SAVEPATH);
+ ListPreference noiseReductionMode = group.findPreference(KEY_NOISE_REDUCTION);
// Since the screen could be loaded from different resources, we need
// to check if the preference is available here
+
+ if (noiseReductionMode != null) {
+ filterUnsupportedOptions(group, noiseReductionMode,
+ getSupportedNoiseReductionModes(mParameters));
+ }
+
if (seeMoreMode != null) {
filterUnsupportedOptions(group, seeMoreMode,
getSupportedSeeMoreModes(mParameters));
diff --git a/src/com/android/camera/VideoMenu.java b/src/com/android/camera/VideoMenu.java
index 58331cf..1fd8b5d 100644
--- a/src/com/android/camera/VideoMenu.java
+++ b/src/com/android/camera/VideoMenu.java
@@ -135,6 +135,7 @@ public class VideoMenu extends MenuController
CameraSettings.KEY_POWER_SHUTTER,
CameraSettings.KEY_MAX_BRIGHTNESS,
CameraSettings.KEY_SEE_MORE,
+ CameraSettings.KEY_NOISE_REDUCTION,
CameraSettings.KEY_DIS,
CameraSettings.KEY_VIDEO_EFFECT,
CameraSettings.KEY_VIDEO_TIME_LAPSE_FRAME_INTERVAL,
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 02bf9d4..5dc4c21 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -2522,6 +2522,43 @@ public class VideoModule implements CameraModule,
mUI.overrideSettings(CameraSettings.KEY_QC_VIDEO_TNR_MODE, video_tnr);
}
+ String noiseReductionMode = mPreferences.getString(
+ CameraSettings.KEY_NOISE_REDUCTION,
+ mActivity.getString(R.string.pref_camera_noise_reduction_default));
+ Log.v(TAG, "Noise ReductionMode =" + noiseReductionMode);
+
+ if (isSupported(noiseReductionMode,
+ CameraSettings.getSupportedNoiseReductionModes(mParameters))) {
+ /* Disable CDS */
+ if (noiseReductionMode.equals(
+ mActivity.getString(R.string.pref_camera_noise_reduction_value_high_quality)) &&
+ video_cds.equals(mActivity.getString(R.string.
+ pref_camera_video_cds_value_on))) {
+ mParameters.set(CameraSettings.KEY_QC_VIDEO_CDS_MODE,
+ mActivity.getString(R.string.pref_camera_video_cds_value_off));
+ mUI.overrideSettings(CameraSettings.KEY_QC_VIDEO_CDS_MODE,
+ mActivity.getString(R.string.pref_camera_video_cds_value_off));
+ Toast.makeText(mActivity, R.string.disable_CDS_during_HighQualityNoiseReduction,
+ Toast.LENGTH_LONG).show();
+ }
+
+ /* Disable TNR */
+ if (noiseReductionMode.equals(
+ mActivity.getString(R.string.pref_camera_noise_reduction_value_high_quality)) &&
+ video_tnr.equals(mActivity.getString(R.string.
+ pref_camera_video_tnr_value_on))) {
+ mParameters.set(CameraSettings.KEY_QC_VIDEO_TNR_MODE,
+ mActivity.getString(R.string.pref_camera_video_tnr_value_off));
+ mUI.overrideSettings(CameraSettings.KEY_QC_VIDEO_TNR_MODE,
+ mActivity.getString(R.string.pref_camera_video_tnr_value_off));
+ Toast.makeText(mActivity, R.string.disable_TNR_during_HighQualityNoiseReduction,
+ Toast.LENGTH_LONG).show();
+ }
+
+ /* Set Noise Reduction mode */
+ mParameters.set(CameraSettings.KEY_QC_NOISE_REDUCTION_MODE, noiseReductionMode);
+ }
+
String seeMoreMode = mPreferences.getString(
CameraSettings.KEY_SEE_MORE,
mActivity.getString(R.string.pref_camera_see_more_default));