Resync with broadcom drivers 5.100.138.20 and utilities.
[tomato.git] / release / src-rt / include / qmath.h
blobf5e2885c4888110461fd393f9f420f3e40e0eb2e
1 /*
2 * qmath functions used in arithmatic and DSP operations where
3 * fractional operations, saturation support is needed.
5 * Copyright (C) 2010, Broadcom Corporation
6 * All Rights Reserved.
7 *
8 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
9 * the contents of this file may not be disclosed to third parties, copied
10 * or duplicated in any form, in whole or in part, without the prior
11 * written permission of Broadcom Corporation.
13 * $Id: qmath.h,v 13.2 2008-01-11 22:58:12 Exp $
16 #ifndef __QMATH_H__
17 #define __QMATH_H__
19 #include <typedefs.h>
21 int16
22 qm_sat32(int32 op);
24 int32
25 qm_mul321616(int16 op1, int16 op2);
27 int16
28 qm_mul16(int16 op1, int16 op2);
30 int32
31 qm_muls321616(int16 op1, int16 op2);
33 uint16
34 qm_mulu16(uint16 op1, uint16 op2);
36 int16
37 qm_muls16(int16 op1, int16 op2);
39 int32
40 qm_add32(int32 op1, int32 op2);
42 int16
43 qm_add16(int16 op1, int16 op2);
45 int16
46 qm_sub16(int16 op1, int16 op2);
48 int32
49 qm_sub32(int32 op1, int32 op2);
51 int32
52 qm_mac321616(int32 acc, int16 op1, int16 op2);
54 int32
55 qm_shl32(int32 op, int shift);
57 int32
58 qm_shr32(int32 op, int shift);
60 int16
61 qm_shl16(int16 op, int shift);
63 int16
64 qm_shr16(int16 op, int shift);
66 int16
67 qm_norm16(int16 op);
69 int16
70 qm_norm32(int32 op);
72 int16
73 qm_div_s(int16 num, int16 denom);
75 int16
76 qm_abs16(int16 op);
78 int16
79 qm_div16(int16 num, int16 denom, int16 *qQuotient);
81 int32
82 qm_abs32(int32 op);
84 int16
85 qm_div163232(int32 num, int32 denom, int16 *qquotient);
87 int32
88 qm_mul323216(int32 op1, int16 op2);
90 int32
91 qm_mulsu321616(int16 op1, uint16 op2);
93 int32
94 qm_muls323216(int32 op1, int16 op2);
96 int32
97 qm_mul32(int32 a, int32 b);
99 int32
100 qm_muls32(int32 a, int32 b);
102 void
103 qm_log10(int32 N, int16 qN, int16 *log10N, int16 *qLog10N);
105 void
106 qm_1byN(int32 N, int16 qN, int32 *result, int16 *qResult);
108 #endif /* #ifndef __QMATH_H__ */