1N/A * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. 1N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1N/A * This code is free software; you can redistribute it and/or modify it 1N/A * under the terms of the GNU General Public License version 2 only, as 1N/A * published by the Free Software Foundation. Oracle designates this 1N/A * particular file as subject to the "Classpath" exception as provided 1N/A * by Oracle in the LICENSE file that accompanied this code. 1N/A * This code is distributed in the hope that it will be useful, but WITHOUT 1N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1N/A * version 2 for more details (a copy is included in the LICENSE file that 1N/A * accompanied this code). 1N/A * You should have received a copy of the GNU General Public License version 1N/A * 2 along with this work; if not, write to the Free Software Foundation, 1N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1N/A * mlib_v_ImageChannelInsert_U8 1N/A * mlib_v_ImageChannelInsert_U8_12_A8D1X8 1N/A * mlib_v_ImageChannelInsert_U8_12_A8D2X8 1N/A * mlib_v_ImageChannelInsert_U8_12_D1 1N/A * mlib_v_ImageChannelInsert_U8_12 1N/A * mlib_v_ImageChannelInsert_U8_13_A8D1X8 1N/A * mlib_v_ImageChannelInsert_U8_13_A8D2X8 1N/A * mlib_v_ImageChannelInsert_U8_13_D1 1N/A * mlib_v_ImageChannelInsert_U8_13 1N/A * mlib_v_ImageChannelInsert_U8_14_A8D1X8 1N/A * mlib_v_ImageChannelInsert_U8_14_A8D2X8 1N/A * mlib_v_ImageChannelInsert_U8_14_D1 1N/A * mlib_v_ImageChannelInsert_U8_14 1N/A * mlib_v_ImageChannelInsert_S16 1N/A * mlib_v_ImageChannelInsert_S16_12_A8D1X4 1N/A * mlib_v_ImageChannelInsert_S16_12_A8D2X4 1N/A * mlib_v_ImageChannelInsert_S16_12_D1 1N/A * mlib_v_ImageChannelInsert_S16_12 1N/A * mlib_v_ImageChannelInsert_S16_13_A8D1X4 1N/A * mlib_v_ImageChannelInsert_S16_13_A8D2X4 * mlib_v_ImageChannelInsert_S16_13_D1 * mlib_v_ImageChannelInsert_S16_13 * mlib_v_ImageChannelInsert_S16_14_A8D1X4 * mlib_v_ImageChannelInsert_S16_14_A8D2X4 * mlib_v_ImageChannelInsert_S16_14_D1 * mlib_v_ImageChannelInsert_S16_14 * mlib_v_ImageChannelInsert_S32 * mlib_v_ImageChannelInsert_D64 * 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 * Copy the 1-channel source image into the selected channel * of the destination image -- VIS version low level functions. * for loop unrolling and structure clarity. /***************************************************************/ /* general channel insertion: slower due to the inner loop */ mlib_s32 i, j, k;
/* indices for x, y, channel */ for (i = (
channeld -
1), k = 0; i >= 0; i--) {
if ((
cmask & (
1 << i)) == 0)
for (j = 0; j <
height; j++) {
for (i = 0; i <
width; i++) {
for (j = 0; j <
height; j++) {
for (i = 0; i <
width; i++) {
/***************************************************************/ /* general channel insertion: slower due to the inner loop */ mlib_s32 i, j, k;
/* indices for x, y, channel */ for (i = (
channeld -
1), k = 0; i >= 0; i--) {
if ((
cmask & (
1 << i)) == 0)
for (j = 0; j <
height; j++) {
for (i = 0; i <
width; i++) {
for (j = 0; j <
height; j++) {
for (i = 0; i <
width; i++) {
for (j = 0; j <
height; j++) {
for (i = 0; i <
width; i++) {
/***************************************************************/ /* general channel insertion: slower due to the inner loop */ mlib_s32 i, j, k;
/* indices for x, y, channel */ for (i = (
channeld -
1), k = 0; i >= 0; i--) {
if ((
cmask & (
1 << i)) == 0)
for (j = 0; j <
height; j++) {
for (i = 0; i <
width; i++) {
for (j = 0; j <
height; j++) {
for (i = 0; i <
width; i++) {
/***************************************************************/ /* general channel insertion: slower due to the inner loop */ mlib_s32 i, j, k;
/* indices for x, y, channel */ for (i = (
channeld -
1), k = 0; i >= 0; i--) {
if ((
cmask & (
1 << i)) == 0)
for (j = 0; j <
height; j++) {
for (i = 0; i <
width; i++) {
for (j = 0; j <
height; j++) {
for (i = 0; i <
width; i++) {
for (j = 0; j <
height; j++) {
for (i = 0; i <
width; i++) {
/***************************************************************/ /***************************************************************/ /* insert one channel to a 2-channel image. * both source and destination image data are 8-byte aligned. * dsize is multiple of 8. for (i = 0; i <
dsize /
8; i++) {
/***************************************************************/ /* insert one channel to a 2-channel image. * both source and destination image data are 8-byte aligned. * xsize is multiple of 8. for (j = 0; j <
ysize; j++) {
for (i = 0; i <
xsize /
8; i++) {
/***************************************************************/ /* insert one channel to a 2-channel image. mlib_d64 *
dp;
/* 8-byte aligned start points in dst */ mlib_d64 *
sp;
/* 8-byte aligned start point in src */ /* prepare the source address */ /* prepare the destination addresses */ /* calculate the src's offset over dst */ if (
off == 0) {
/* src and dst have same alignment */ /* insert, including some garbage at the start point */ /* store 16 bytes result */ /* 8-pixel column loop, emask not needed */ for (i = 0; i < n; i++) {
/* generate edge mask for the start point */ /* insert and store 16 bytes */ /* 8-pixel column loop, emask not needed */ for (i = 0; i < n; i++) {
/* generate edge mask for the start point */ /* insert and store 16 bytes */ /* 8-pixel column loop, emask not needed */ for (i = 0; i < n; i++) {
/* generate edge mask for the start point */ /* insert and store 16 bytes */ /* 8-pixel column loop, emask not needed */ for (i = 0; i < n; i++) {
/***************************************************************/ /* insert one channel to a 2-channel image. for (j = 0; j <
ysize; j++) {
/***************************************************************/ /***************************************************************/ /***************************************************************/ /***************************************************************/ for (i = 0; i <
dsize /
8; i++) {
/***************************************************************/ for (j = 0; j <
ysize; j++) {
for (i = 0; i <
xsize /
8; i++) {
/***************************************************************/ mlib_d64 *
sp;
/* 8-byte aligned start points in src */ /* prepare the src address */ /* prepare the dst address */ for (i = 0; i <
dsize /
8; i++) {
/***************************************************************/ for (j = 0; j <
ysize; j++) {
/***************************************************************/ /***************************************************************/ for (i = 0; i <
dsize /
8; i++) {
/***************************************************************/ for (j = 0; j <
ysize; j++) {
for (i = 0; i <
xsize /
8; i++) {
/***************************************************************/ mlib_d64 *
dp;
/* 8-byte aligned start points in dst */ mlib_d64 *
sp;
/* 8-byte aligned start point in src */ /* prepare the source address */ /* prepare the destination addresses */ if (
doff == 0) {
/* dst is 8-byte aligned */ /* 8-pixel column loop, emask not needed */ for (i = 0; i < n; i++) {
else {
/* dst is not 8-byte aligned */ /* 8-pixel column loop, emask not needed */ for (i = 0; i < n; i++) {
/***************************************************************/ for (j = 0; j <
ysize; j++) {
/***************************************************************/ /***************************************************************/ /***************************************************************/ for (i = 0; i <
dsize /
4; i++) {
/***************************************************************/ for (j = 0; j <
ysize; j++) {
for (i = 0; i <
xsize /
4; i++) {
/***************************************************************/ mlib_d64 *
sp;
/* 8-byte aligned start points in src */ /* prepare the src address */ for (i = 0; i <
dsize /
4; i++) {
/***************************************************************/ for (j = 0; j <
ysize; j++) {
/***************************************************************/ for (i = 0; i <
dsize /
4; i++) {
/***************************************************************/ for (j = 0; j <
ysize; j++) {
for (i = 0; i <
xsize /
4; i++) {
/***************************************************************/ mlib_d64 *
sp;
/* 8-byte aligned start points in src */ /* prepare the src address */ for (i = 0; i <
dsize /
4; i++) {
/***************************************************************/ for (j = 0; j <
ysize; j++) {
/***************************************************************/ /* obsolete: it is slower than the vis_st_u16() version*/ \
/***************************************************************/ da =
dst + (
6 /
cmask +
1) /
2;
/* 8,4,2,1 -> 0,1,2,3 */ for (i = 0; i <
dsize /
4; i++) {
/***************************************************************/ da =
dl =
dst + (
6 /
cmask +
1) /
2;
/* 8,4,2,1 -> 0,1,2,3 */ for (j = 0; j <
ysize; j++) {
for (i = 0; i <
xsize /
4; i++) {
/***************************************************************/ mlib_d64 *
sp;
/* 8-byte aligned start points in src */ da =
dst + (
6 /
cmask +
1) /
2;
/* 8,4,2,1 -> 0,1,2,3 */ /* prepare the src address */ for (i = 0; i <
dsize /
4; i++) {
/***************************************************************/ for (j = 0; j <
ysize; j++) {
/***************************************************************/