Current File : //usr/man/man3mlib/mlib_MatrixMulShift_S16_S16_Mod.3mlib
'\" te
.\" Copyright (c) 2007, Sun Microsystems, Inc.  All Rights Reserved 
.TH mlib_MatrixMulShift_S16_S16_Mod 3MLIB "2 Mar 2007" "SunOS 5.11" "mediaLib Library Functions"
.SH NAME
mlib_MatrixMulShift_S16_S16_Mod, mlib_MatrixMulShift_S16_S16_Sat, mlib_MatrixMulShift_S16C_S16C_Mod, mlib_MatrixMulShift_S16C_S16C_Sat \- matrix multiplication plus shifting
.SH SYNOPSIS
.LP
.nf
cc [ \fIflag\fR... ] \fIfile\fR... \fB-lmlib\fR [ \fIlibrary\fR... ]
#include <mlib.h>

\fBmlib_status\fR \fBmlib_MatrixMulShift_S16_S16_Mod\fR(\fBmlib_s16 *\fR\fIz\fR, 
    \fBconst mlib_s16 *\fR\fIx\fR, \fBconst mlib_s16 *\fR\fIy\fR, \fBmlib_s32\fR \fIm\fR, 
    \fBmlib_s32\fR \fIl\fR, \fBmlib_s32\fR \fIn\fR, \fBmlib_s32\fR \fIshift\fR);
.fi

.LP
.nf
\fBmlib_status\fR \fBmlib_MatrixMulShift_S16_S16_Sat\fR(\fBmlib_s16 *\fR\fIz\fR, 
     \fBconst mlib_s16 *\fR\fIx\fR, \fBconst mlib_s16 *\fR\fIy\fR, \fBmlib_s32\fR \fIm\fR, 
     \fBmlib_s32\fR \fIl\fR, \fBmlib_s32\fR \fIn\fR, \fBmlib_s32\fR \fIshift\fR);
.fi

.LP
.nf
\fBmlib_status\fR \fBmlib_MatrixMulShift_S16C_S16C_Mod\fR(\fBmlib_s16 *\fR\fIz\fR, 
     \fBconst mlib_s16 *\fR\fIx\fR, \fBconst mlib_s16 *\fR\fIy\fR, \fBmlib_s32\fR \fIm\fR, 
     \fBmlib_s32\fR \fIl\fR, \fBmlib_s32\fR \fIn\fR, \fBmlib_s32\fR \fIshift\fR);
.fi

.LP
.nf
\fBmlib_status\fR \fBmlib_MatrixMulShift_S16C_S16C_Sat\fR(\fBmlib_s16 *\fR\fIz\fR, 
     \fBconst mlib_s16 *\fR\fIx\fR, \fBconst mlib_s16 *\fR\fIy\fR, \fBmlib_s32\fR \fIm\fR, 
     \fBmlib_s32\fR \fIl\fR, \fBmlib_s32\fR \fIn\fR, \fBmlib_s32\fR \fIshift\fR);
.fi

.SH DESCRIPTION
.sp
.LP
Each of these functions performs a multiplication of two matrices and shifts the result.
.sp
.LP
For real data, the following equation is used:
.sp
.in +2
.nf
              l-1
z[i*n + j] = {SUM (x[i*l + k] * y[k*n + j])} * 2**(-shift)
              k=0
.fi
.in -2

.sp
.LP
where \fBi = 0, 1, ..., (m - 1)\fR; \fBj = 0, 1, ..., (n - 1)\fR.
.sp
.LP
For complex data, the following equation is used:
.sp
.in +2
.nf
                      l-1
z[2*(i*n + j)]     = {SUM (xR*yR - xI*yI)} * 2**(-shift)
                      k=0

                      l-1
z[2*(i*n + j) + 1] = {SUM (xR*yI + xI*yR)} * 2**(-shift)
                      k=0
.fi
.in -2

.sp
.LP
where
.sp
.in +2
.nf
xR = x[2*(i*l + k)]
xI = x[2*(i*l + k) + 1]
yR = y[2*(k*n + j)]
yI = y[2*(k*n + j) + 1]
i = 0, 1, ..., (m - 1)
j = 0, 1, ..., (n - 1)
.fi
.in -2

.SH PARAMETERS
.sp
.LP
Each of the functions takes the following arguments:
.sp
.ne 2
.mk
.na
\fB\fIz\fR\fR
.ad
.RS 9n
.rt  
Pointer to the first element of the result matrix, in row major order.
.RE

.sp
.ne 2
.mk
.na
\fB\fIx\fR\fR
.ad
.RS 9n
.rt  
Pointer to the first element of the first matrix, in row major order.
.RE

.sp
.ne 2
.mk
.na
\fB\fIy\fR\fR
.ad
.RS 9n
.rt  
Pointer to the first element of the second matrix, in row major order.
.RE

.sp
.ne 2
.mk
.na
\fB\fIm\fR\fR
.ad
.RS 9n
.rt  
Number of rows in the first matrix. \fBm > 0\fR.
.RE

.sp
.ne 2
.mk
.na
\fB\fIl\fR\fR
.ad
.RS 9n
.rt  
Number of columns in the first matrix, and the number of rows in the second matrix. \fBl > 0\fR.
.RE

.sp
.ne 2
.mk
.na
\fB\fIn\fR\fR
.ad
.RS 9n
.rt  
Number of columns in the second matrix. \fBn > 0\fR.
.RE

.sp
.ne 2
.mk
.na
\fB\fIshift\fR\fR
.ad
.RS 9n
.rt  
Right shifting factor. \fB1 \(<= shift \(<= 16\fR.
.RE

.SH RETURN VALUES
.sp
.LP
Each of the functions returns \fBMLIB_SUCCESS\fR if successful. Otherwise it returns \fBMLIB_FAILURE\fR.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
tab() box;
cw(2.75i) |cw(2.75i) 
lw(2.75i) |lw(2.75i) 
.
ATTRIBUTE TYPEATTRIBUTE VALUE
_
Interface StabilityCommitted
_
MT-LevelMT-Safe
.TE

.SH SEE ALSO
.sp
.LP
\fBmlib_MatrixMul_U8_U8_Mod\fR(3MLIB), \fBattributes\fR(5)