/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* The functions step along the lines from xLeft to xRight and apply
* the bilinear filtering.
*
*/
#include "vis_proto.h"
#include "mlib_image.h"
#include "mlib_ImageColormap.h"
#include "mlib_ImageCopy.h"
#include "mlib_ImageAffine.h"
#include "mlib_v_ImageFilters.h"
#include "mlib_v_ImageChannelExtract.h"
#include "mlib_v_ImageAffine_BL_S16.h"
/*#define MLIB_VIS2*/
/***************************************************************/
/***************************************************************/
/***************************************************************/
/***************************************************************/
#ifdef MLIB_VIS2
#else
#endif /* MLIB_VIS2 */
/***************************************************************/
#define DECLAREVAR() \
DECLAREVAR0(); \
/***************************************************************/
/* arguments (x, y) are swapped to prevent overflow */
#define FMUL_16x16(x, y) \
vis_fpadd16(vis_fmul8sux16(y, x), \
vis_fmul8ulx16(y, x))
/***************************************************************/
/***************************************************************/
/***************************************************************/
#define BL_SUM() \
\
\
\
\
\
/***************************************************************/
#define BL_SUM_3CH() \
\
\
\
\
vis_alignaddr((void*)0, 2); \
\
/***************************************************************/
/***************************************************************/
#ifndef MLIB_VIS2
#define LOAD_1CH() \
\
\
\
#else
#define LOAD_1CH() \
\
\
#endif /* MLIB_VIS2 */
/***************************************************************/
X += dX; \
Y += dY
/***************************************************************/
#define PREPARE_DELTAS \
}
/***************************************************************/
{
DECLAREVAR();
#ifdef MLIB_VIS2
vis_write_bmask(0x45CD67EF, 0);
#else
vis_alignaddr((void*)0, 6);
#endif /* MLIB_VIS2 */
NEW_LINE(1);
off >>= 1;
if (off) {
}
if (off > 2) {
if (size > 2) {
}
}
LOAD_1CH();
BL_SUM();
}
#pragma pipeloop(0)
for (i = 0; i < size/4; i++) {
LOAD_1CH();
BL_SUM();
}
if (off) {
if (off > 1) {
}
if (off > 2) {
}
LOAD_1CH();
BL_SUM();
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
X += dX; \
Y += dY
/***************************************************************/
#define LOAD_2CH() \
/***************************************************************/
#define PREPARE_DELTAS \
}
/***************************************************************/
{
DECLAREVAR();
}
srcYStride >>= 2;
NEW_LINE(2);
if (off) {
} else {
}
if (off) {
LOAD_2CH();
BL_SUM();
dp++;
size--;
}
#pragma pipeloop(0)
for (i = 0; i < size/2; i++) {
LOAD_2CH();
BL_SUM();
}
if (size & 1) {
LOAD_2CH();
BL_SUM();
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
X += dX; \
Y += dY
/***************************************************************/
#ifndef MLIB_VIS2
#define LOAD_2CH_NA() \
\
\
\
#else
#define LOAD_2CH_NA() \
\
\
#endif /* MLIB_VIS2 */
/***************************************************************/
{
DECLAREVAR();
#ifdef MLIB_VIS2
#endif /* MLIB_VIS2 */
}
MLIB_WRITE_BMASK(0x45CD67EF);
#ifndef MLIB_VIS2
vis_alignaddr((void*)0, 6);
#endif /* MLIB_VIS2 */
NEW_LINE(2);
#pragma pipeloop(0)
for (i = 0; i < size/2; i++) {
LOAD_2CH_NA();
BL_SUM();
}
if (size & 1) {
LOAD_2CH_NA();
BL_SUM();
}
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
#define PREPARE_DELTAS \
}
/***************************************************************/
{
DECLAREVAR();
}
NEW_LINE(3);
deltax = DOUBLE_4U16(X, X, X, X);
deltay = DOUBLE_4U16(Y, Y, Y, Y);
#pragma pipeloop(0)
for (i = 0; i < size; i++) {
vis_alignaddr(sp, 0);
BL_SUM_3CH();
X += dX;
Y += dY;
}
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
{
DECLAREVAR();
}
srcYStride >>= 3;
NEW_LINE(4);
deltax = DOUBLE_4U16(X, X, X, X);
deltay = DOUBLE_4U16(Y, Y, Y, Y);
#pragma pipeloop(0)
for (i = 0; i < size; i++) {
BL_SUM();
X += dX;
Y += dY;
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
{
DECLAREVAR();
}
NEW_LINE(4);
deltax = DOUBLE_4U16(X, X, X, X);
deltay = DOUBLE_4U16(Y, Y, Y, Y);
#pragma pipeloop(0)
for (i = 0; i < size; i++) {
vis_alignaddr(sp, 0);
BL_SUM();
X += dX;
Y += dY;
}
}
}
return MLIB_SUCCESS;
}
/***************************************************************/