From 00b124967f4ee87fabe501b4d00bb6a4cd8460ca Mon Sep 17 00:00:00 2001 From: Gabriel Wang Date: Wed, 8 Jan 2025 06:18:49 +0000 Subject: [PATCH] remove helium.fp support --- .../Source/__arm_2d_ll_transform_helium.inc | 655 +----------------- 1 file changed, 2 insertions(+), 653 deletions(-) diff --git a/Library/Source/__arm_2d_ll_transform_helium.inc b/Library/Source/__arm_2d_ll_transform_helium.inc index 0996fbb5..242a01d9 100644 --- a/Library/Source/__arm_2d_ll_transform_helium.inc +++ b/Library/Source/__arm_2d_ll_transform_helium.inc @@ -22,8 +22,8 @@ * Title: __arm_2d_transform_helium.inc * Description: c code template for transform * - * $Date: 7. Jan 2025 - * $Revision: V.1.1.0 + * $Date: 8. Jan 2025 + * $Revision: V.2.0.0 * * -------------------------------------------------------------------- */ @@ -51,654 +51,6 @@ #define MASK_COLOR(sz) (sz == 8) ? ptInfo->Mask.chColour : ((sz == 16) ? ptInfo->Mask.hwColour : ptInfo->Mask.wColour) -#if !__ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(transform)( __arm_2d_param_copy_orig_t *ptParam, - __arm_2d_transform_info_t *ptInfo) -{ - int32_t iHeight = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iHeight; - int32_t iWidth = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iWidth; - - int32_t iTargetStride = - ptParam->use_as____arm_2d_param_copy_t.tTarget.iStride; - __API_INT_TYPE *pTargetBase = ptParam->use_as____arm_2d_param_copy_t.tTarget.pBuffer; - __API_INT_TYPE *pOrigin = ptParam->tOrigin.pBuffer; - int32_t iOrigStride = ptParam->tOrigin.iStride; - __API_INT_TYPE MaskColour = MASK_COLOR(__API_INT_TYPE_BIT_NUM); - float32_t fAngle = -ptInfo->fAngle; - arm_2d_location_t tOffset = - ptParam->use_as____arm_2d_param_copy_t.tSource.tValidRegion.tLocation; - arm_2d_location_t *pCenter = &(ptInfo->tCenter); - - float32_t invIWidth = iWidth > 1 ? 1.0f / (float32_t) (iWidth - 1) : __LARGEINVF32; - arm_2d_rot_linear_regr_t regrCoefs[2]; - arm_2d_location_t SrcPt = ptInfo->tDummySourceOffset; - - /* get regression parameters over 1st and last column */ -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - bool gatherLoadIdxOverflow; - gatherLoadIdxOverflow = -#endif - __arm_2d_transform_regression( - &ptParam->use_as____arm_2d_param_copy_t.tCopySize, - &SrcPt, - fAngle, - ptInfo->fScale, - &tOffset, - pCenter, - iOrigStride, - regrCoefs); - - - /* slopes between 1st and last columns */ - float32_t slopeY, slopeX; - - slopeY = (float32_t) (regrCoefs[1].interceptY - regrCoefs[0].interceptY) * invIWidth; - slopeX = (float32_t) (regrCoefs[1].interceptX - regrCoefs[0].interceptX) * invIWidth; - -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - if (!gatherLoadIdxOverflow) { -#endif - for (int32_t y = 0; y < iHeight; y++) { - - /* 1st column estimates (intercepts for regression in X direction */ - float32_t colFirstY = regrCoefs[0].slopeY * y + regrCoefs[0].interceptY; - float32_t colFirstX = regrCoefs[0].slopeX * y + regrCoefs[0].interceptX; - - int32_t nbVecElts = iWidth; - float16x8_t vX = vcvtq_f16_s16((int16x8_t) vidupq_n_u16(0, 1)); - __API_INT_TYPE *pTargetBaseCur = pTargetBase; - - while (nbVecElts > 0) { - arm_2d_point_f16x8_t tPointV; - - tPointV.X = - vfmaq_n_f16(vdupq_n_f16(colFirstX), vX, slopeX); - tPointV.Y = - vfmaq_n_f16(vdupq_n_f16(colFirstY), vX, slopeY); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_ROTATION_FOR_PERFORMANCE__) - tPointV.X = vaddq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpgtq(tPointV.X, 0)); - tPointV.X = vsubq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpleq(tPointV.X, 0)); - - tPointV.Y = vaddq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpgtq(tPointV.Y, 0)); - tPointV.Y = vsubq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpleq(tPointV.Y, 0)); - #endif - __ARM_2D_FUNC(get_pixel_colour)(&tPointV, - &ptParam->tOrigin.tValidRegion, - pOrigin, - iOrigStride, - pTargetBaseCur, MaskColour, - nbVecElts); - - pTargetBaseCur += 8; - vX += 8.0f16; - nbVecElts -= 8; - } - pTargetBase += iTargetStride; - } -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - } else { - for (int32_t y = 0; y < iHeight; y++) { - - /* 1st column estimates (intercepts for regression in X direction */ - float32_t colFirstY = regrCoefs[0].slopeY * y + regrCoefs[0].interceptY; - float32_t colFirstX = regrCoefs[0].slopeX * y + regrCoefs[0].interceptX; - int32_t nbVecElts = iWidth; - float16x8_t vX = vcvtq_f16_s16((int16x8_t) vidupq_n_u16(0, 1)); - uint16_t *pTargetBaseCur = pTargetBase; - - while (nbVecElts > 0) { - arm_2d_point_f16x8_t tPointV; - - tPointV.X = - vfmaq_n_f16(vdupq_n_f16(colFirstX), vX, slopeX); - tPointV.Y = - vfmaq_n_f16(vdupq_n_f16(colFirstY), vX, slopeY); - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_ROTATION_FOR_PERFORMANCE__) - tPointV.X = vaddq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpgtq(tPointV.X, 0)); - tPointV.X = vsubq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpleq(tPointV.X, 0)); - - tPointV.Y = vaddq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpgtq(tPointV.Y, 0)); - tPointV.Y = vsubq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpleq(tPointV.Y, 0)); -#endif - __MVE_WRAPPER(__arm_2d_impl_rgb565_get_pixel_colour_offs_compensated)(&tPointV, - &ptParam->tOrigin. - tValidRegion, - pOrigin, - iOrigStride, - pTargetBaseCur, - MaskColour, - nbVecElts); - - pTargetBaseCur += 8; - vX += 8.0f16; - nbVecElts -= 8; - } - pTargetBase += iTargetStride; - } - } -#endif -} - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(transform_only)( __arm_2d_param_copy_orig_t *ptParam, - __arm_2d_transform_info_t *ptInfo) -{ - int32_t iHeight = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iHeight; - int32_t iWidth = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iWidth; - - int32_t iTargetStride = - ptParam->use_as____arm_2d_param_copy_t.tTarget.iStride; - __API_INT_TYPE *pTargetBase = ptParam->use_as____arm_2d_param_copy_t.tTarget.pBuffer; - __API_INT_TYPE *pOrigin = ptParam->tOrigin.pBuffer; - int32_t iOrigStride = ptParam->tOrigin.iStride; - float32_t fAngle = -ptInfo->fAngle; - arm_2d_location_t tOffset = - ptParam->use_as____arm_2d_param_copy_t.tSource.tValidRegion.tLocation; - arm_2d_location_t *pCenter = &(ptInfo->tCenter); - - float32_t invIWidth = iWidth > 1 ? 1.0f / (float32_t) (iWidth - 1) : __LARGEINVF32; - arm_2d_rot_linear_regr_t regrCoefs[2]; - arm_2d_location_t SrcPt = ptInfo->tDummySourceOffset; - - /* get regression parameters over 1st and last column */ -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - bool gatherLoadIdxOverflow; - gatherLoadIdxOverflow = -#endif - __arm_2d_transform_regression( - &ptParam->use_as____arm_2d_param_copy_t.tCopySize, - &SrcPt, - fAngle, - ptInfo->fScale, - &tOffset, - pCenter, - iOrigStride, - regrCoefs); - - - /* slopes between 1st and last columns */ - float32_t slopeY, slopeX; - - slopeY = (float32_t) (regrCoefs[1].interceptY - regrCoefs[0].interceptY) * invIWidth; - slopeX = (float32_t) (regrCoefs[1].interceptX - regrCoefs[0].interceptX) * invIWidth; - -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - if (!gatherLoadIdxOverflow) { -#endif - for (int32_t y = 0; y < iHeight; y++) { - - /* 1st column estimates (intercepts for regression in X direction */ - float32_t colFirstY = regrCoefs[0].slopeY * y + regrCoefs[0].interceptY; - float32_t colFirstX = regrCoefs[0].slopeX * y + regrCoefs[0].interceptX; - - int32_t nbVecElts = iWidth; - float16x8_t vX = vcvtq_f16_s16((int16x8_t) vidupq_n_u16(0, 1)); - __API_INT_TYPE *pTargetBaseCur = pTargetBase; - - while (nbVecElts > 0) { - arm_2d_point_f16x8_t tPointV; - - tPointV.X = - vfmaq_n_f16(vdupq_n_f16(colFirstX), vX, slopeX); - tPointV.Y = - vfmaq_n_f16(vdupq_n_f16(colFirstY), vX, slopeY); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_ROTATION_FOR_PERFORMANCE__) - tPointV.X = vaddq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpgtq(tPointV.X, 0)); - tPointV.X = vsubq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpleq(tPointV.X, 0)); - - tPointV.Y = vaddq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpgtq(tPointV.Y, 0)); - tPointV.Y = vsubq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpleq(tPointV.Y, 0)); - #endif - __ARM_2D_FUNC(transform_only_get_pixel_colour)(&tPointV, - &ptParam->tOrigin.tValidRegion, - pOrigin, - iOrigStride, - pTargetBaseCur, - nbVecElts); - - pTargetBaseCur += 8; - vX += 8.0f16; - nbVecElts -= 8; - } - pTargetBase += iTargetStride; - } -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - } else { - for (int32_t y = 0; y < iHeight; y++) { - - /* 1st column estimates (intercepts for regression in X direction */ - float32_t colFirstY = regrCoefs[0].slopeY * y + regrCoefs[0].interceptY; - float32_t colFirstX = regrCoefs[0].slopeX * y + regrCoefs[0].interceptX; - int32_t nbVecElts = iWidth; - float16x8_t vX = vcvtq_f16_s16((int16x8_t) vidupq_n_u16(0, 1)); - uint16_t *pTargetBaseCur = pTargetBase; - - while (nbVecElts > 0) { - arm_2d_point_f16x8_t tPointV; - - tPointV.X = - vfmaq_n_f16(vdupq_n_f16(colFirstX), vX, slopeX); - tPointV.Y = - vfmaq_n_f16(vdupq_n_f16(colFirstY), vX, slopeY); - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_ROTATION_FOR_PERFORMANCE__) - tPointV.X = vaddq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpgtq(tPointV.X, 0)); - tPointV.X = vsubq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpleq(tPointV.X, 0)); - - tPointV.Y = vaddq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpgtq(tPointV.Y, 0)); - tPointV.Y = vsubq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpleq(tPointV.Y, 0)); -#endif - __MVE_WRAPPER(__arm_2d_impl_rgb565_transform_only_get_pixel_colour_offs_compensated)(&tPointV, - &ptParam->tOrigin. - tValidRegion, - pOrigin, - iOrigStride, - pTargetBaseCur, - nbVecElts); - - pTargetBaseCur += 8; - vX += 8.0f16; - nbVecElts -= 8; - } - pTargetBase += iTargetStride; - } - } -#endif -} - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(transform_with_opacity)(__arm_2d_param_copy_orig_t *ptParam, - __arm_2d_transform_info_t *ptInfo, - uint_fast16_t hwRatio) -{ - int32_t iHeight = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iHeight; - int32_t iWidth = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iWidth; - - int32_t iTargetStride = - ptParam->use_as____arm_2d_param_copy_t.tTarget.iStride; - __API_INT_TYPE *pTargetBase = ptParam->use_as____arm_2d_param_copy_t.tTarget.pBuffer; - __API_INT_TYPE *pOrigin = ptParam->tOrigin.pBuffer; - int32_t iOrigStride = ptParam->tOrigin.iStride; - __API_INT_TYPE MaskColour = MASK_COLOR(__API_INT_TYPE_BIT_NUM); - float32_t fAngle = -ptInfo->fAngle; - arm_2d_location_t tOffset = - ptParam->use_as____arm_2d_param_copy_t.tSource.tValidRegion.tLocation; - arm_2d_location_t *pCenter = &(ptInfo->tCenter); - float32_t invIWidth = iWidth > 1 ? 1.0f / (float32_t) (iWidth - 1) : __LARGEINVF32; - arm_2d_rot_linear_regr_t regrCoefs[2]; - arm_2d_location_t SrcPt = ptInfo->tDummySourceOffset; - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - - /* get regression parameters over 1st and last column */ -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - bool gatherLoadIdxOverflow; - gatherLoadIdxOverflow = -#endif - __arm_2d_transform_regression( - &ptParam->use_as____arm_2d_param_copy_t.tCopySize, - &SrcPt, - fAngle, - ptInfo->fScale, - &tOffset, - pCenter, - iOrigStride, - regrCoefs); - - /* slopes between 1st and last columns */ - float32_t slopeY, slopeX; - - slopeY = (float32_t) (regrCoefs[1].interceptY - regrCoefs[0].interceptY) * invIWidth; - slopeX = (float32_t) (regrCoefs[1].interceptX - regrCoefs[0].interceptX) * invIWidth; - -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - if (!gatherLoadIdxOverflow) { -#endif - for (int32_t y = 0; y < iHeight; y++) { - /* 1st column estimates (intercepts for regression in X direction */ - float32_t colFirstY = - (regrCoefs[0].slopeY * y + regrCoefs[0].interceptY); - float32_t colFirstX = - (regrCoefs[0].slopeX * y + regrCoefs[0].interceptX); - - int32_t nbVecElts = iWidth; - float16x8_t vX = vcvtq_f16_s16((int16x8_t) vidupq_n_u16(0, 1)); - __API_INT_TYPE *pTargetBaseCur = pTargetBase; - - while (nbVecElts > 0) { - arm_2d_point_f16x8_t tPointV; - - /* linear interpolation thru first & last columns */ - tPointV.X = - vfmaq_n_f16(vdupq_n_f16(colFirstX), vX, slopeX); - tPointV.Y = - vfmaq_n_f16(vdupq_n_f16(colFirstY), vX, slopeY); - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_ROTATION_FOR_PERFORMANCE__) - tPointV.X = vaddq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpgtq(tPointV.X, 0)); - tPointV.X = vsubq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpleq(tPointV.X, 0)); - - tPointV.Y = vaddq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpgtq(tPointV.Y, 0)); - tPointV.Y = vsubq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpleq(tPointV.Y, 0)); -#endif - __ARM_2D_FUNC(get_pixel_colour_with_alpha)(&tPointV, - &ptParam->tOrigin. - tValidRegion, - pOrigin, iOrigStride, - pTargetBaseCur, - MaskColour, - hwRatio, - nbVecElts); - pTargetBaseCur += 8; - vX += 8.0f16; - nbVecElts -= 8; - } - pTargetBase += iTargetStride; - } -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - } else { - - /* - Large image / Large origin offsets - Gather load 16-bit could overflow - - Y offset needs to be shifted down to avoid overflow - - 16-bit gather loads base address is incremented - - Needs to be done in the inner loop. - In the case of steep slopes, taking the minimum between the Y extrema could still generate overflows - */ - for (int32_t y = 0; y < iHeight; y++) { - /* 1st column estimates (intercepts for regression in X direction */ - float32_t colFirstY = - (regrCoefs[0].slopeY * y + regrCoefs[0].interceptY); - float32_t colFirstX = - (regrCoefs[0].slopeX * y + regrCoefs[0].interceptX); - - int32_t nbVecElts = iWidth; - float16x8_t vX = vcvtq_f16_s16((int16x8_t) vidupq_n_u16(0, 1)); - uint16_t *pTargetBaseCur = pTargetBase; - - while (nbVecElts > 0) { - arm_2d_point_f16x8_t tPointV; - - /* linear interpolation thru first & last columns */ - tPointV.X = - vfmaq_n_f16(vdupq_n_f16(colFirstX), vX, slopeX); - tPointV.Y = - vfmaq_n_f16(vdupq_n_f16(colFirstY), vX, slopeY); - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_ROTATION_FOR_PERFORMANCE__) - tPointV.X = vaddq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpgtq(tPointV.X, 0)); - tPointV.X = vsubq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpleq(tPointV.X, 0)); - - tPointV.Y = vaddq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpgtq(tPointV.Y, 0)); - tPointV.Y = vsubq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpleq(tPointV.Y, 0)); -#endif - __MVE_WRAPPER(__arm_2d_impl_rgb565_get_pixel_colour_with_alpha_offs_compensated)(&tPointV, - &ptParam->tOrigin. - tValidRegion, - pOrigin, - iOrigStride, - pTargetBaseCur, - MaskColour, - hwRatio, - nbVecElts); - pTargetBaseCur += 8; - vX += 8.0f16; - nbVecElts -= 8; - } - pTargetBase += iTargetStride; - } - } -#endif -} - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(transform_only_opacity)(__arm_2d_param_copy_orig_t *ptParam, - __arm_2d_transform_info_t *ptInfo, - uint_fast16_t hwRatio) -{ - int32_t iHeight = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iHeight; - int32_t iWidth = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iWidth; - - int32_t iTargetStride = - ptParam->use_as____arm_2d_param_copy_t.tTarget.iStride; - __API_INT_TYPE *pTargetBase = ptParam->use_as____arm_2d_param_copy_t.tTarget.pBuffer; - __API_INT_TYPE *pOrigin = ptParam->tOrigin.pBuffer; - int32_t iOrigStride = ptParam->tOrigin.iStride; - float32_t fAngle = -ptInfo->fAngle; - arm_2d_location_t tOffset = - ptParam->use_as____arm_2d_param_copy_t.tSource.tValidRegion.tLocation; - arm_2d_location_t *pCenter = &(ptInfo->tCenter); - float32_t invIWidth = iWidth > 1 ? 1.0f / (float32_t) (iWidth - 1) : __LARGEINVF32; - arm_2d_rot_linear_regr_t regrCoefs[2]; - arm_2d_location_t SrcPt = ptInfo->tDummySourceOffset; - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - - /* get regression parameters over 1st and last column */ -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - bool gatherLoadIdxOverflow; - gatherLoadIdxOverflow = -#endif - __arm_2d_transform_regression( - &ptParam->use_as____arm_2d_param_copy_t.tCopySize, - &SrcPt, - fAngle, - ptInfo->fScale, - &tOffset, - pCenter, - iOrigStride, - regrCoefs); - - /* slopes between 1st and last columns */ - float32_t slopeY, slopeX; - - slopeY = (float32_t) (regrCoefs[1].interceptY - regrCoefs[0].interceptY) * invIWidth; - slopeX = (float32_t) (regrCoefs[1].interceptX - regrCoefs[0].interceptX) * invIWidth; - -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - if (!gatherLoadIdxOverflow) { -#endif - for (int32_t y = 0; y < iHeight; y++) { - /* 1st column estimates (intercepts for regression in X direction */ - float32_t colFirstY = - (regrCoefs[0].slopeY * y + regrCoefs[0].interceptY); - float32_t colFirstX = - (regrCoefs[0].slopeX * y + regrCoefs[0].interceptX); - - int32_t nbVecElts = iWidth; - float16x8_t vX = vcvtq_f16_s16((int16x8_t) vidupq_n_u16(0, 1)); - __API_INT_TYPE *pTargetBaseCur = pTargetBase; - - while (nbVecElts > 0) { - arm_2d_point_f16x8_t tPointV; - - /* linear interpolation thru first & last columns */ - tPointV.X = - vfmaq_n_f16(vdupq_n_f16(colFirstX), vX, slopeX); - tPointV.Y = - vfmaq_n_f16(vdupq_n_f16(colFirstY), vX, slopeY); - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_ROTATION_FOR_PERFORMANCE__) - tPointV.X = vaddq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpgtq(tPointV.X, 0)); - tPointV.X = vsubq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpleq(tPointV.X, 0)); - - tPointV.Y = vaddq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpgtq(tPointV.Y, 0)); - tPointV.Y = vsubq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpleq(tPointV.Y, 0)); -#endif - __ARM_2D_FUNC(transform_only_get_pixel_colour_with_alpha)(&tPointV, - &ptParam->tOrigin. - tValidRegion, - pOrigin, iOrigStride, - pTargetBaseCur, - hwRatio, - nbVecElts); - pTargetBaseCur += 8; - vX += 8.0f16; - nbVecElts -= 8; - } - pTargetBase += iTargetStride; - } -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - } else { - - /* - Large image / Large origin offsets - Gather load 16-bit could overflow - - Y offset needs to be shifted down to avoid overflow - - 16-bit gather loads base address is incremented - - Needs to be done in the inner loop. - In the case of steep slopes, taking the minimum between the Y extrema could still generate overflows - */ - for (int32_t y = 0; y < iHeight; y++) { - /* 1st column estimates (intercepts for regression in X direction */ - float32_t colFirstY = - (regrCoefs[0].slopeY * y + regrCoefs[0].interceptY); - float32_t colFirstX = - (regrCoefs[0].slopeX * y + regrCoefs[0].interceptX); - - int32_t nbVecElts = iWidth; - float16x8_t vX = vcvtq_f16_s16((int16x8_t) vidupq_n_u16(0, 1)); - uint16_t *pTargetBaseCur = pTargetBase; - - while (nbVecElts > 0) { - arm_2d_point_f16x8_t tPointV; - - /* linear interpolation thru first & last columns */ - tPointV.X = - vfmaq_n_f16(vdupq_n_f16(colFirstX), vX, slopeX); - tPointV.Y = - vfmaq_n_f16(vdupq_n_f16(colFirstY), vX, slopeY); - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_ROTATION_FOR_PERFORMANCE__) - tPointV.X = vaddq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpgtq(tPointV.X, 0)); - tPointV.X = vsubq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpleq(tPointV.X, 0)); - - tPointV.Y = vaddq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpgtq(tPointV.Y, 0)); - tPointV.Y = vsubq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpleq(tPointV.Y, 0)); -#endif - __MVE_WRAPPER(__arm_2d_impl_rgb565_transform_only_get_pixel_colour_with_alpha_offs_compensated)(&tPointV, - &ptParam->tOrigin. - tValidRegion, - pOrigin, - iOrigStride, - pTargetBaseCur, - hwRatio, - nbVecElts); - pTargetBaseCur += 8; - vX += 8.0f16; - nbVecElts -= 8; - } - pTargetBase += iTargetStride; - } - } -#endif -} - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(colour_filling_mask_opacity_transform)(__arm_2d_param_copy_orig_t *ptParam, - __arm_2d_transform_info_t *ptInfo, - uint_fast16_t hwRatio) -{ - int32_t iHeight = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iHeight; - int32_t iWidth = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iWidth; - - int32_t iTargetStride = - ptParam->use_as____arm_2d_param_copy_t.tTarget.iStride; - __API_INT_TYPE *pTargetBase = ptParam->use_as____arm_2d_param_copy_t.tTarget.pBuffer; - uint8_t *pOrigin = ptParam->tOrigin.pBuffer; - int32_t iOrigStride = ptParam->tOrigin.iStride; - __API_INT_TYPE MaskColour = MASK_COLOR(__API_INT_TYPE_BIT_NUM); - float32_t fAngle = -ptInfo->fAngle; - arm_2d_location_t tOffset = - ptParam->use_as____arm_2d_param_copy_t.tSource.tValidRegion.tLocation; - arm_2d_location_t *pCenter = &(ptInfo->tCenter); - float32_t invIWidth = iWidth > 1 ? 1.0f / (float32_t) (iWidth - 1) : __LARGEINVF32; - arm_2d_rot_linear_regr_t regrCoefs[2]; - arm_2d_location_t SrcPt = ptInfo->tDummySourceOffset; - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - - /* get regression parameters over 1st and last column */ - __arm_2d_transform_regression( - &ptParam->use_as____arm_2d_param_copy_t.tCopySize, - &SrcPt, - fAngle, - ptInfo->fScale, - &tOffset, - pCenter, - iOrigStride, - regrCoefs); - - /* slopes between 1st and last columns */ - float32_t slopeY, slopeX; - - slopeY = (float32_t) (regrCoefs[1].interceptY - regrCoefs[0].interceptY) * invIWidth; - slopeX = (float32_t) (regrCoefs[1].interceptX - regrCoefs[0].interceptX) * invIWidth; - - for (int32_t y = 0; y < iHeight; y++) { - /* 1st column estimates (intercepts for regression in X direction */ - float32_t colFirstY = - (regrCoefs[0].slopeY * y + regrCoefs[0].interceptY); - float32_t colFirstX = - (regrCoefs[0].slopeX * y + regrCoefs[0].interceptX); - - int32_t nbVecElts = iWidth; - float16x8_t vX = vcvtq_f16_s16((int16x8_t) vidupq_n_u16(0, 1)); - __API_INT_TYPE *pTargetBaseCur = pTargetBase; - - while (nbVecElts > 0) { - arm_2d_point_f16x8_t tPointV; - - /* linear interpolation thru first & last columns */ - tPointV.X = - vfmaq_n_f16(vdupq_n_f16(colFirstX), vX, slopeX); - tPointV.Y = - vfmaq_n_f16(vdupq_n_f16(colFirstY), vX, slopeY); - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_ROTATION_FOR_PERFORMANCE__) - tPointV.X = vaddq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpgtq(tPointV.X, 0)); - tPointV.X = vsubq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpleq(tPointV.X, 0)); - - tPointV.Y = vaddq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpgtq(tPointV.Y, 0)); - tPointV.Y = vsubq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpleq(tPointV.Y, 0)); -#endif - __ARM_2D_FUNC(get_alpha_with_opacity)(&tPointV, - &ptParam->tOrigin. - tValidRegion, - pOrigin, iOrigStride, - pTargetBaseCur, - MaskColour, - hwRatio, - nbVecElts); - pTargetBaseCur += 8; - vX += 8.0f16; - nbVecElts -= 8; - } - pTargetBase += iTargetStride; - } -} - - -#else /* __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ */ - __OVERRIDE_WEAK void __ARM_2D_FUNC(transform)( __arm_2d_param_copy_orig_t *ptParam, __arm_2d_transform_info_t *ptInfo) @@ -1403,9 +755,6 @@ void __ARM_2D_FUNC(colour_filling_mask_opacity_transform)( __arm_2d_param_copy } } -#endif /* __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ */ - - #define __API_MTWM_COLOUR __API_COLOUR #define __API_MTWM_COLOUR_NAME __API_COLOUR_NAME #define __API_MTWM_INT_TYPE __API_INT_TYPE