/*
* 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.
*/
/*
* FUNCTION
* mlib_convMxN_8nw - convolve a 8-bit image, MxN kernel,
* edge = no write
*
* SYNOPSIS
* mlib_status mlib_convMxNnw_u8(mlib_image *dst,
* const mlib_image *src,
* mlib_s32 kwid,
* mlib_s32 khgt,
* mlib_s32 khw,
* mlib_s32 khh,
* const mlib_s32 *skernel,
* mlib_s32 discardbits,
* mlib_s32 cmask)
*
* ARGUMENT
* src Ptr to source image structure
* dst Ptr to destination image structure
* khgt Kernel height (# of rows)
* kwid Kernel width (# of cols)
* skernel Ptr to convolution kernel
* discardbits The number of LSBits of the 32-bit accumulator that
* are discarded when the 32-bit accumulator is converted
* to 16-bit output data; discardbits must be 1-15 (it
* cannot be zero). Same as exponent N for scalefac=2**N.
* cmask Channel mask to indicate the channels to be convolved.
* Each bit of which represents a channel in the image. The
* channels corresponded to 1 bits are those to be processed.
*
* DESCRIPTION
* A 2-D convolution (MxN kernel) for 8-bit images.
*
*/
#include "vis_proto.h"
#include "mlib_image.h"
#include "mlib_ImageConv.h"
#include "mlib_c_ImageConv.h"
#include "mlib_v_ImageConv.h"
#include "mlib_v_ImageChannelExtract.h"
#include "mlib_v_ImageChannelInsert.h"
/***************************************************************/
const mlib_image *src,
mlib_s32 m,
mlib_s32 n,
/***************************************************************/
0x00400040, 0x00200020, 0x00100010, 0x00080008,
0x00040004, 0x00020002, 0x00010001, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000
};
/***************************************************************/
const mlib_image *src,
{
discardbits, cmask);
if (nchannel == 1)
cmask = 1;
}
else {
discardbits, cmask);
}
}
/***************************************************************/
const mlib_image *src,
mlib_s32 m,
mlib_s32 n,
{
if (n > MAX_N) {
return MLIB_FAILURE;
}
if (buffs != buffs_local)
return MLIB_FAILURE;
}
for (i = 0; i < (n + 1); i++)
for (i = 0; i < (n + 1); i++)
hgt -= (n - 1);
if (nchan == 2) {
}
else if (nchan == 3) {
}
else {
}
testchan = 1;
buff_ind = 0;
testchan <<= 1;
continue;
}
for (l = 0; l < n; l++) {
}
/* init buffer */
#pragma pipeloop(0)
}
for (j = 0; j < hgt; j++) {
for (l = 0; l < n; l++) {
}
ik_last = (m - 1);
if (jk_size >= 6)
jk_size = 4;
if (jk_size == 5)
jk_size = 3;
coff = 0;
if (jk_size == 1) {
continue;
#pragma pipeloop(0)
}
}
pk += m;
}
else if (jk_size == 2) {
continue;
#pragma pipeloop(0)
}
}
pk += 2 * m;
}
else if (jk_size == 3) {
continue;
if (off == 0) {
#pragma pipeloop(0)
}
}
else if (off == 4) {
#pragma pipeloop(0)
}
}
else {
#pragma pipeloop(0)
}
}
}
pk += 3 * m;
}
else { /* jk_size == 4 */
continue;
if (off == 0) {
#pragma pipeloop(0)
}
}
else if (off == 4) {
#pragma pipeloop(0)
}
}
else {
#pragma pipeloop(0)
}
}
}
pk += 4 * m;
}
}
/*****************************************
*****************************************
** Final iteration **
*****************************************
*****************************************/
jk_size = n;
if (jk_size >= 6)
jk_size = 4;
if (jk_size == 5)
jk_size = 3;
off &= 7;
if (jk_size == 1) {
#pragma pipeloop(0)
}
}
else if (jk_size == 2) {
#pragma pipeloop(0)
}
}
else if (jk_size == 3) {
#pragma pipeloop(0)
}
}
else { /* if (jk_size == 4) */
#pragma pipeloop(0)
}
}
buff_ind++;
if (buff_ind >= (n + 1))
buff_ind = 0;
}
testchan <<= 1;
}
if (buffs != buffs_local)
return MLIB_SUCCESS;
}
/***************************************************************/