16 #include <freerdp/config.h>
18 #include <freerdp/types.h>
19 #include <freerdp/primitives.h>
21 #include "prim_internal.h"
22 #include "prim_shift.h"
25 static INLINE INT16 shift(INT16 val, UINT32 sh)
30 static INLINE pstatus_t general_lShiftC_16s_inplace(INT16* WINPR_RESTRICT pSrcDst, UINT32 val,
34 return PRIMITIVES_SUCCESS;
38 for (UINT32 x = 0; x < len; x++)
39 pSrcDst[x] = shift(pSrcDst[x], val);
41 return PRIMITIVES_SUCCESS;
44 static INLINE pstatus_t general_lShiftC_16s(
const INT16* pSrc, UINT32 val, INT16* pDst, UINT32 len)
47 return PRIMITIVES_SUCCESS;
51 for (UINT32 x = 0; x < len; x++)
52 pDst[x] = shift(pSrc[x], val);
54 return PRIMITIVES_SUCCESS;
58 static INLINE pstatus_t general_rShiftC_16s(
const INT16* pSrc, UINT32 val, INT16* pDst, UINT32 len)
61 return PRIMITIVES_SUCCESS;
66 *pDst++ = *pSrc++ >> val;
68 return PRIMITIVES_SUCCESS;
72 static INLINE pstatus_t general_lShiftC_16u(
const UINT16* pSrc, UINT32 val, UINT16* pDst,
76 return PRIMITIVES_SUCCESS;
81 *pDst++ = (INT16)(*pSrc++ << val);
83 return PRIMITIVES_SUCCESS;
87 static INLINE pstatus_t general_rShiftC_16u(
const UINT16* pSrc, UINT32 val, UINT16* pDst,
91 return PRIMITIVES_SUCCESS;
96 *pDst++ = *pSrc++ >> val;
98 return PRIMITIVES_SUCCESS;
102 static INLINE pstatus_t general_shiftC_16s(
const INT16* pSrc, INT32 val, INT16* pDst, UINT32 len)
105 return PRIMITIVES_SUCCESS;
108 return general_rShiftC_16s(pSrc, -val, pDst, len);
110 return general_lShiftC_16s(pSrc, val, pDst, len);
114 static INLINE pstatus_t general_shiftC_16u(
const UINT16* pSrc, INT32 val, UINT16* pDst, UINT32 len)
117 return PRIMITIVES_SUCCESS;
120 return general_rShiftC_16u(pSrc, -val, pDst, len);
122 return general_lShiftC_16u(pSrc, val, pDst, len);
126 void primitives_init_shift(
primitives_t* WINPR_RESTRICT prims)
129 prims->lShiftC_16s_inplace = general_lShiftC_16s_inplace;
130 prims->lShiftC_16s = general_lShiftC_16s;
131 prims->rShiftC_16s = general_rShiftC_16s;
132 prims->lShiftC_16u = general_lShiftC_16u;
133 prims->rShiftC_16u = general_rShiftC_16u;
135 prims->shiftC_16s = general_shiftC_16s;
136 prims->shiftC_16u = general_shiftC_16u;
139 void primitives_init_shift_opt(
primitives_t* WINPR_RESTRICT prims)
141 primitives_init_shift_sse3(prims);