blob: fca5550c480f3f40b987f17f9116e0dfdb18635d [file] [log] [blame]
Dharmaray Kundargi7c9d8012011-01-16 15:59:43 -08001/*
Dharmaray Kundargi7c9d8012011-01-16 15:59:43 -08002 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16/**
17 ******************************************************************************
18 * @file M4ChannelCoverter.c
19 * @brief
20 * @note
21 ******************************************************************************
22 */
23
24void MonoTo2I_16( const short *src,
25 short *dst,
26 short n)
27{
28 short ii;
29 src += n-1;
30 dst += (n*2)-1;
31
32 for (ii = n; ii != 0; ii--){
33 *dst-- = *src;
34 *dst-- = *src--;
35 }
36
37 return;
38}
39
40void From2iToMono_16( const short *src,
41 short *dst,
42 short n)
43{
44 short ii;
45 long Temp;
hongteng0a389ab2011-04-22 13:48:46 -070046 for (ii = n; ii != 0; ii--){
Dharmaray Kundargi7c9d8012011-01-16 15:59:43 -080047 Temp = (long)*(src++);
48 Temp += (long)*(src++);
49 *(dst++) = (short)(Temp >>1);
50 }
51
52 return;
53}
54