Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b472aade authored by Jason Sams's avatar Jason Sams Committed by Android (Google) Code Review
Browse files

Merge "fast math error testing."

parents 7384db20 023c260a
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

#pragma version(1)
#pragma rs java_package_name(com.android.rs.image)
#pragma rs_fp_relaxed

float vibrance = 0.f;

@@ -39,7 +38,7 @@ void vibranceKernel(const uchar4 *in, uchar4 *out) {
    int g = in->g;
    int b = in->b;
    float red = (r-max(g, b))/256.f;
    float sx = (float)(Vib/(1+exp(-red*3)));
    float sx = (float)(Vib/(1+native_exp(-red*3)));
    S = sx+1;
    MS = 1.0f - S;
    Rt = Rf * MS;
+1 −2
Original line number Diff line number Diff line
@@ -50,8 +50,7 @@ uchar4 __attribute__((kernel)) root(uchar4 in, uint32_t x, uint32_t y) {
    const float2 inCoord = {(float)x, (float)y};
    const float2 coord = mad(inCoord, inv_dimensions, neg_center);
    const float sloped_dist_ratio = fast_length(axis_scale * coord)  * sloped_inv_max_dist;
    // TODO:  add half_exp once implemented
    const float lumen = opp_shade + shade * half_recip(1.f + sloped_neg_range * exp(sloped_dist_ratio));
    const float lumen = opp_shade + shade * half_recip(1.f + sloped_neg_range * native_exp(sloped_dist_ratio));
    float4 fout;
    fout.rgb = fin.rgb * lumen;
    fout.w = fin.w;
+27 −0
Original line number Diff line number Diff line
#
# Copyright (C) 2013 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := tests

LOCAL_SRC_FILES := $(call all-java-files-under, src) \
                   $(call all-renderscript-files-under, src)

LOCAL_PACKAGE_NAME := RsMathErr

include $(BUILD_PACKAGE)
+29 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.android.rs.matherr">

    <uses-sdk android:minSdkVersion="17" />
    <application android:label="RS Math Err">
        <activity android:name="MathErrActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>
+31 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    <ImageView
        android:id="@+id/displayin"
        android:layout_width="320dip"
        android:layout_height="266dip" />

    <ImageView
        android:id="@+id/displayout"
        android:layout_width="320dip"
        android:layout_height="266dip" />

</LinearLayout>
Loading