1 /* ----------------------------------------------------------------------
2 * Copyright (C) 2010 ARM Limited. All rights reserved.
7 * Project: CMSIS DSP Library
10 * Description: Minimum value of a Q31 vector.
12 * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
14 * Version 1.0.10 2011/7/15
15 * Big Endian support added and Merged M0 and M3/M4 Source code.
17 * Version 1.0.3 2010/11/29
18 * Re-organized the CMSIS folders and updated documentation.
20 * Version 1.0.2 2010/11/11
21 * Documentation updated.
23 * Version 1.0.1 2010/10/05
24 * Production release and review comments incorporated.
26 * Version 1.0.0 2010/09/20
27 * Production release and review comments incorporated.
28 * ---------------------------------------------------------------------------- */
44 * @brief Minimum value of a Q31 vector.
45 * @param[in] *pSrc points to the input vector
46 * @param[in] blockSize length of the input vector
47 * @param[out] *pResult minimum value returned here
48 * @param[out] *pIndex index of minimum value returned here
59 q31_t minVal, out; /* Temporary variables to store the output value. */
60 uint32_t blkCnt, outIndex; /* loop counter */
62 /* Initialise the index value to zero. */
64 /* Load first input value that act as reference value for comparision */
69 /* Run the below code for Cortex-M4 and Cortex-M3 */
71 /* Loop over blockSize number of values */
72 blkCnt = (blockSize - 1u);
76 /* Initialize minVal to the next consecutive values one by one */
79 /* compare for the minimum value */
82 /* Update the minimum value and its index */
84 outIndex = blockSize - blkCnt;
93 /* Run the below code for Cortex-M0 */
95 /* Loop over blockSize -1 number of values */
96 blkCnt = (blockSize - 1u);
100 /* Initialize minVal to the next consecutive values one by one */
103 /* compare for the minimum value */
106 /* Update the minimum value and its index */
108 outIndex = blockSize - blkCnt;
111 /* Decrement the loop counter */
116 #endif /* #ifndef ARM_MATH_CM0 */
118 /* Store the minimum value and its index into destination pointers */
124 * @} end of Min group