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

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

Merge "Port ImageProcessing to Filterscript." into jb-mr1-dev

parents 73db36e6 d3d6570d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -136,6 +136,7 @@ $(call add-clean-step, rm -f $(PRODUCT_OUT)/system/media/video/Disco*)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework_intermediates)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/ImageProcessing_intermediates)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/ImageProcessing2_intermediates)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/ImageProcessing_intermediates)
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
+3 −3
Original line number Diff line number Diff line
@@ -29,10 +29,10 @@ void setMatrix(rs_matrix4x4 m) {
    Mat = m;
}

void root(const uchar4 *in, uchar4 *out) {
    float4 f = convert_float4(*in);
uchar4 __attribute__((kernel)) root(uchar4 in) {
    float4 f = convert_float4(in);
    f = rsMatrixMultiply(&Mat, f);
    f = clamp(f, 0.f, 255.f);
    *out = convert_uchar4(f);
    return convert_uchar4(f);
}
+2 −2
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ rs_allocation gIn;

float gCoeffs[9];

void root(uchar4 *out, uint32_t x, uint32_t y) {
uchar4 __attribute__((kernel)) root(uint32_t x, uint32_t y) {
    uint32_t x1 = min((int32_t)x+1, gWidth-1);
    uint32_t x2 = max((int32_t)x-1, 0);
    uint32_t y1 = min((int32_t)y+1, gHeight-1);
@@ -61,7 +61,7 @@ void root(uchar4 *out, uint32_t x, uint32_t y) {
    p20 += p02;

    p20 = clamp(p20, 0.f, 255.f);
    *out = convert_uchar4(p20);
    return convert_uchar4(p20);
}

+2 −2
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ rs_allocation gIn;

float gCoeffs[25];

void root(uchar4 *out, uint32_t x, uint32_t y) {
uchar4 __attribute__((kernel)) root(uint32_t x, uint32_t y) {
    uint32_t x0 = max((int32_t)x-2, 0);
    uint32_t x1 = max((int32_t)x-1, 0);
    uint32_t x2 = x;
@@ -68,7 +68,7 @@ void root(uchar4 *out, uint32_t x, uint32_t y) {
              + convert_float4(rsGetElementAt_uchar4(gIn, x4, y4)) * gCoeffs[24];

    p0 = clamp(p0 + p1 + p2 + p3 + p4, 0.f, 255.f);
    *out = convert_uchar4(p0);
    return convert_uchar4(p0);
}

+2 −2
Original line number Diff line number Diff line
@@ -17,8 +17,8 @@
#pragma version(1)
#pragma rs java_package_name(com.android.rs.image)

void root(const uchar4 *v_in, uchar4 *v_out) {
    *v_out = *v_in;
uchar4 __attribute__((kernel)) root(uchar4 v_in) {
    return v_in;
}

Loading