/*
* 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.
*/
/*
* FILENAME: mlib_v_ImageChannelInsert_34.c
*
* FUNCTIONS
* mlib_v_ImageChannelInsert_U8_34R_A8D1X8
* mlib_v_ImageChannelInsert_U8_34R_A8D2X8
* mlib_v_ImageChannelInsert_U8_34R_D1
* mlib_v_ImageChannelInsert_U8_34R
* mlib_v_ImageChannelInsert_S16_34R_A8D1X4
* mlib_v_ImageChannelInsert_S16_34R_A8D2X4
* mlib_v_ImageChannelInsert_S16_34R_D1
* mlib_v_ImageChannelInsert_S16_34R
* mlib_v_ImageChannelInsert_U8_34L_A8D1X8
* mlib_v_ImageChannelInsert_U8_34L_A8D2X8
* mlib_v_ImageChannelInsert_U8_34L_D1
* mlib_v_ImageChannelInsert_U8_34L
* mlib_v_ImageChannelInsert_S16_34L_A8D1X4
* mlib_v_ImageChannelInsert_S16_34L_A8D2X4
* mlib_v_ImageChannelInsert_S16_34L_D1
* mlib_v_ImageChannelInsert_S16_34L
*
* SYNOPSIS
*
* ARGUMENT
* src pointer to source image data
* dst pointer to destination image data
* slb source image line stride in bytes
* dlb destination image line stride in bytes
* dsize image data size in pixels
* xsize image width in pixels
* ysize image height in lines
* cmask channel mask
*
* DESCRIPTION
* Insert a 3-channel image into the right or left 3 channels of
* a 4-channel image low level functions.
*
* BGR => ABGR (34R), or RGB => RGBA (34L)
*
* NOTE
* These functions are separated from mlib_v_ImageChannelInsert.c
* for loop unrolling and structure clarity.
*/
#include <stdlib.h>
#include "vis_proto.h"
#include "mlib_image.h"
/***************************************************************/
#define INSERT_U8_34R \
/***************************************************************/
#define LOAD_INSERT_STORE_U8_34R_A8 \
/***************************************************************/
#define LOAD_INSERT_U8_34R \
vis_alignaddr((void *)soff, 0); \
sp += 3; \
/***************************************************************/
/*
* Both source and destination image data are 1-d vectors and
* 8-byte aligned. And dsize is multiple of 8.
*/
void
{
int i;
#pragma pipeloop(0)
for (i = 0; i < dsize / 8; i++) {
}
}
/***************************************************************/
/*
* Either source or destination image data are not 1-d vectors, but
* they are 8-byte aligned. And slb and dlb are multiple of 8.
* The xsize is multiple of 8.
*/
void
{
int i, j; /* indices for x, y */
/* row loop */
for (j = 0; j < ysize; j++) {
/* 8-byte column loop */
#pragma pipeloop(0)
for (i = 0; i < xsize / 8; i++) {
}
}
}
/***************************************************************/
/*
* either source or destination data are not 8-byte aligned.
*/
void
{
int i, n;
/* prepare the source address */
/* prepare the destination addresses */
/* set band mask for vis_pst_8 to store the bytes needed */
/* generate edge mask for the start point */
/* load 24 bytes, convert to 32 bytes */
if (doff == 0) { /* dst is 8-byte aligned */
if (dsize >= 8 ) {
}
else { /* for very small size */
}
}
}
}
/* no edge handling is needed in the loop */
#pragma pipeloop(0)
for (i = 0; i < n; i++) {
}
}
}
}
}
}
}
else { /* (doff != 0) */
vis_alignaddr((void *)0, -doff);
if (dsize >= 8 ) {
}
else { /* for very small size */
}
}
}
}
}
/* no edge handling is needed in the loop */
#pragma pipeloop(0)
for (i = 0; i < n; i++) {
vis_alignaddr((void *)0, -doff);
}
}
vis_alignaddr((void *)0, -doff);
}
}
}
}
}
}
/***************************************************************/
void
{
int j;
#pragma pipeloop(0)
for (j = 0; j < ysize; j++) {
}
}
/***************************************************************/
#define INSERT_S16_34R \
vis_alignaddr((void *)0, 6); \
vis_alignaddr((void *)0, 4); \
vis_alignaddr((void *)0, 2); \
/***************************************************************/
#define LOAD_INSERT_STORE_S16_34R_A8 \
/***************************************************************/
#define LOAD_INSERT_S16_34R \
vis_alignaddr((void *)soff, 0); \
sp += 3; \
/***************************************************************/
/*
* both source and destination image data are 1-d vectors and
* 8-byte aligned. dsize is multiple of 4.
*/
void
{
int i;
/* set GSR.offset for vis_faligndata() */
/* vis_alignaddr((void *)0, 2); */ /* only for _old */
#pragma pipeloop(0)
for (i = 0; i < dsize / 4; i++) {
}
}
/***************************************************************/
/*
* either source or destination image data are not 1-d vectors, but
* they are 8-byte aligned. xsize is multiple of 4.
*/
void
{
int i, j; /* indices for x, y */
/* row loop */
for (j = 0; j < ysize; j++) {
/* 4-pixel column loop */
#pragma pipeloop(0)
for (i = 0; i < xsize / 4; i++) {
}
}
}
/***************************************************************/
/*
* either source or destination data are not 8-byte aligned.
*/
void
{
int i, n;
/* prepare the source address */
/* prepare the destination addresses */
/* set channel mask for vis_pst_16 to store the words needed */
/* generate edge mask for the start point */
/* load 24 byte, convert, store 32 bytes */
if (doff == 0) { /* dst is 8-byte aligned */
if (dsize >= 4 ) {
}
else { /* for very small size */
}
}
}
/* no edge handling is needed in the loop */
#pragma pipeloop(0)
for (i = 0; i < n; i++) {
}
}
}
}
}
}
else { /* (doff != 0) */
vis_alignaddr((void *)0, -doff);
if (dsize >= 4 ) {
}
else { /* for very small size */
}
}
}
}
/* no edge handling is needed in the loop */
#pragma pipeloop(0)
for (i = 0; i < n; i++) {
vis_alignaddr((void *)0, -doff);
}
}
vis_alignaddr((void *)0, -doff);
}
}
}
}
}
}
/***************************************************************/
void
{
int j;
#pragma pipeloop(0)
for (j = 0; j < ysize; j++) {
}
}
/***************************************************************/
#define INSERT_U8_34L \
/***************************************************************/
#define LOAD_INSERT_STORE_U8_34L_A8 \
/***************************************************************/
#define LOAD_INSERT_U8_34L \
vis_alignaddr((void *)soff, 0); \
sp += 3; \
/***************************************************************/
/*
* Both source and destination image data are 1-d vectors and
* 8-byte aligned. And dsize is multiple of 8.
*/
void
{
int i;
#pragma pipeloop(0)
for (i = 0; i < dsize / 8; i++) {
}
}
/***************************************************************/
/*
* Either source or destination image data are not 1-d vectors, but
* they are 8-byte aligned. And slb and dlb are multiple of 8.
* The xsize is multiple of 8.
*/
void
{
int i, j; /* indices for x, y */
/* row loop */
for (j = 0; j < ysize; j++) {
/* 8-byte column loop */
#pragma pipeloop(0)
for (i = 0; i < xsize / 8; i++) {
}
}
}
/***************************************************************/
/*
* either source or destination data are not 8-byte aligned.
*/
void
{
int i, n;
/* prepare the source address */
/* prepare the destination addresses */
/* set band mask for vis_pst_8 to store the bytes needed */
/* generate edge mask for the start point */
/* load 24 bytes, convert to 32 bytes */
if (doff == 0) { /* dst is 8-byte aligned */
if (dsize >= 8 ) {
}
else { /* for very small size */
}
}
}
}
/* no edge handling is needed in the loop */
#pragma pipeloop(0)
for (i = 0; i < n; i++) {
}
}
}
}
}
}
}
else { /* (doff != 0) */
vis_alignaddr((void *)0, -doff);
if (dsize >= 8 ) {
}
else { /* for very small size */
}
}
}
}
}
/* no edge handling is needed in the loop */
#pragma pipeloop(0)
for (i = 0; i < n; i++) {
vis_alignaddr((void *)0, -doff);
}
}
vis_alignaddr((void *)0, -doff);
}
}
}
}
}
}
/***************************************************************/
void
{
int j;
#pragma pipeloop(0)
for (j = 0; j < ysize; j++) {
}
}
/***************************************************************/
#define INSERT_S16_34L \
vis_alignaddr((void *)0, 6); \
vis_alignaddr((void *)0, 4); \
vis_alignaddr((void *)0, 2); \
/***************************************************************/
#define LOAD_INSERT_STORE_S16_34L_A8 \
/***************************************************************/
#define LOAD_INSERT_S16_34L \
vis_alignaddr((void *)soff, 0); \
sp += 3; \
/***************************************************************/
/*
* both source and destination image data are 1-d vectors and
* 8-byte aligned. dsize is multiple of 4.
*/
void
{
int i;
#pragma pipeloop(0)
for (i = 0; i < dsize / 4; i++) {
}
}
/***************************************************************/
/*
* either source or destination image data are not 1-d vectors, but
* they are 8-byte aligned. xsize is multiple of 4.
*/
void
{
int i, j; /* indices for x, y */
/* row loop */
for (j = 0; j < ysize; j++) {
/* 4-pixel column loop */
#pragma pipeloop(0)
for (i = 0; i < xsize / 4; i++) {
}
}
}
/***************************************************************/
/*
* either source or destination data are not 8-byte aligned.
*/
void
{
int i, n;
/* prepare the source address */
/* prepare the destination addresses */
/* set channel mask for vis_pst_16 to store the words needed */
/* generate edge mask for the start point */
/* load 24 byte, convert, store 32 bytes */
if (doff == 0) { /* dst is 8-byte aligned */
if (dsize >= 4 ) {
}
else { /* for very small size */
}
}
}
/* no edge handling is needed in the loop */
#pragma pipeloop(0)
for (i = 0; i < n; i++) {
}
}
}
}
}
}
else { /* (doff != 0) */
vis_alignaddr((void *)0, -doff);
if (dsize >= 4 ) {
}
else { /* for very small size */
}
}
}
}
/* no edge handling is needed in the loop */
#pragma pipeloop(0)
for (i = 0; i < n; i++) {
vis_alignaddr((void *)0, -doff);
}
}
vis_alignaddr((void *)0, -doff);
}
}
}
}
}
}
/***************************************************************/
void
{
int j;
#pragma pipeloop(0)
for (j = 0; j < ysize; j++) {
}
}
/***************************************************************/