2 * Copyright (C) 2012 Team XBMC
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
21 #include "EndianSwap.h"
23 /* based on libavformat/spdif.c */
24 void Endian_Swap16_buf(uint16_t *dst, uint16_t *src, int w)
28 for (i = 0; i + 8 <= w; i += 8) {
29 dst[i + 0] = Endian_Swap16(src[i + 0]);
30 dst[i + 1] = Endian_Swap16(src[i + 1]);
31 dst[i + 2] = Endian_Swap16(src[i + 2]);
32 dst[i + 3] = Endian_Swap16(src[i + 3]);
33 dst[i + 4] = Endian_Swap16(src[i + 4]);
34 dst[i + 5] = Endian_Swap16(src[i + 5]);
35 dst[i + 6] = Endian_Swap16(src[i + 6]);
36 dst[i + 7] = Endian_Swap16(src[i + 7]);
40 dst[i + 0] = Endian_Swap16(src[i + 0]);