/*
* 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 bicubic filtering.
*
*/
#include "vis_proto.h"
#include "mlib_ImageAffine.h"
#include "mlib_v_ImageFilters.h"
/*#define MLIB_VIS2*/
/***************************************************************/
/***************************************************************/
#ifdef MLIB_VIS2
#else
#endif /* MLIB_VIS2 */
/***************************************************************/
/***************************************************************/
#define NEXT_PIXEL_1BC_U8() \
/***************************************************************/
#ifndef MLIB_VIS2
#else
vis_alignaddr(dp, 0); \
#endif /* MLIB_VIS2 */
/***************************************************************/
sPtr += srcYStride; \
sPtr += srcYStride; \
sPtr += srcYStride; \
X += dX; \
Y += dY
/***************************************************************/
#ifndef MLIB_VIS2
vis_alignaddr((void*)2, 0); \
#else
#endif /* MLIB_VIS2 */
/***************************************************************/
/***************************************************************/
filterposy = (Y >> FILTER_SHIFT); \
filterposx = (X >> FILTER_SHIFT); \
sPtr += srcYStride; \
X += dX; \
sPtr += srcYStride; \
Y += dY; \
filterposy &= FILTER_MASK; \
sPtr += srcYStride; \
filterposx &= FILTER_MASK; \
/***************************************************************/
#ifndef MLIB_VIS2
#define FADD_1BC_U8() \
#else
#define FADD_1BC_U8() \
#endif /* MLIB_VIS2 */
/***************************************************************/
{
#ifndef MLIB_VIS2
#endif /* MLIB_VIS2 */
if (filter == MLIB_BICUBIC) {
} else {
}
MLIB_WRITE_BMASK(0x0145ABEF);
CLIP(1);
for (i = 0; i < align; i++) {
}
if (i <= cols - 10) {
FADD_1BC_U8();
#pragma pipeloop(0)
FADD_1BC_U8();
dstPixelPtr += 4;
}
dstPixelPtr += 4;
FADD_1BC_U8();
dstPixelPtr += 4;
i += 10;
}
for (; i < cols; i++) {
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
#define FADD_2BC_U8() \
/***************************************************************/
X += dX; \
Y += dY; \
sPtr += srcYStride; \
sPtr += srcYStride; \
sPtr += srcYStride; \
/***************************************************************/
#define NEXT_PIXEL_2BC_U8() \
/***************************************************************/
#define RESULT_2BC_U8_1PIXEL() \
vis_read_lo(d0))); \
/***************************************************************/
filterposy = (Y >> FILTER_SHIFT); \
filterposx = (X >> FILTER_SHIFT); \
sPtr += srcYStride; \
X += dX; \
sPtr += srcYStride; \
Y += dY; \
filterposy &= FILTER_MASK; \
sPtr += srcYStride; \
filterposx &= FILTER_MASK; \
/***************************************************************/
{
if (filter == MLIB_BICUBIC) {
} else {
}
CLIP(2);
dstLineEnd += 1;
i = 0;
if (i <= cols - 10) {
FADD_2BC_U8();
#pragma pipeloop(0)
FADD_2BC_U8();
}
FADD_2BC_U8();
vis_alignaddr((void *)7, 0);
dstPixelPtr += 2;
vis_alignaddr((void *)7, 0);
dstPixelPtr += 2;
i += 10;
}
for (; i < cols; i++) {
vis_alignaddr((void *)7, 0);
dstPixelPtr += 2;
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
#ifndef MLIB_VIS2
#define FADD_3BC_U8() \
vis_alignaddr((void*)6, 0); \
vis_alignaddr((void*)2, 0); \
#else
#define FADD_3BC_U8() \
vis_alignaddr((void*)4, 0); \
#endif /* MLIB_VIS2 */
/***************************************************************/
X += dX; \
Y += dY; \
sPtr += srcYStride; \
sPtr += srcYStride; \
sPtr += srcYStride; \
/***************************************************************/
#define STORE_BC_U8_3CH_1PIXEL() \
dstPixelPtr[0] = f0.t[0]; \
dstPixelPtr += 3
/***************************************************************/
#define NEXT_PIXEL_3BC_U8() \
/***************************************************************/
#define RESULT_3BC_U8_1PIXEL() \
FADD_3BC_U8();
/***************************************************************/
filterposy = (Y >> FILTER_SHIFT); \
filterposx = (X >> FILTER_SHIFT); \
sPtr += srcYStride; \
X += dX; \
sPtr += srcYStride; \
Y += dY; \
filterposy &= FILTER_MASK; \
sPtr += srcYStride; \
filterposx &= FILTER_MASK; \
/***************************************************************/
{
union {
mlib_u8 t[4];
mlib_f32 f;
} f0;
if (filter == MLIB_BICUBIC) {
} else {
}
MLIB_WRITE_BMASK(0x6789ABCD);
CLIP(3);
i = 0;
if (i <= cols - 4) {
FADD_3BC_U8();
#pragma pipeloop(0)
for (; i < cols-4; i++) {
FADD_3BC_U8();
}
FADD_3BC_U8();
i += 4;
}
for (; i < cols; i++) {
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
#define FADD_4BC_U8() \
/***************************************************************/
X += dX; \
Y += dY; \
sPtr += srcYStride; \
sPtr += srcYStride; \
sPtr += srcYStride; \
/***************************************************************/
#define NEXT_PIXEL_4BC_U8() \
/***************************************************************/
/***************************************************************/
filterposy = (Y >> FILTER_SHIFT); \
filterposx = (X >> FILTER_SHIFT); \
sPtr += srcYStride; \
X += dX; \
sPtr += srcYStride; \
Y += dY; \
filterposy &= FILTER_MASK; \
sPtr += srcYStride; \
filterposx &= FILTER_MASK; \
/***************************************************************/
{
if (filter == MLIB_BICUBIC) {
} else {
}
CLIP(4);
dstLineEnd += 3;
i = 0;
if (i <= cols - 6) {
FADD_4BC_U8();
#pragma pipeloop(0)
vis_alignaddr((void *)gsrd, 0);
FADD_4BC_U8();
}
vis_alignaddr((void *)gsrd, 0);
FADD_4BC_U8();
vis_alignaddr((void *)gsrd, 0);
FADD_4BC_U8();
vis_alignaddr((void *)gsrd, 0);
i += 6;
}
if (i <= cols-4) {
FADD_4BC_U8();
vis_alignaddr((void *)gsrd, 0);
FADD_4BC_U8();
vis_alignaddr((void *)gsrd, 0);
i += 4;
}
if (i <= cols-2) {
FADD_4BC_U8();
vis_alignaddr((void *)gsrd, 0);
i += 2;
}
if (i < cols) {
vis_alignaddr((void *)gsrd, 0);
}
}
}
return MLIB_SUCCESS;
}
/***************************************************************/