Merge pull request #26220 from 78andyp/blurayfixes
[xbmc.git] / xbmc / utils / EndianSwap.cpp
blob3f645d9338b92219f4f63807a05afb65b68e11ed
1 /*
2 * Copyright (C) 2012-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #include "EndianSwap.h"
11 /* based on libavformat/spdif.c */
12 void Endian_Swap16_buf(uint16_t *dst, uint16_t *src, int w)
14 int i;
16 for (i = 0; i + 8 <= w; i += 8) {
17 dst[i + 0] = Endian_Swap16(src[i + 0]);
18 dst[i + 1] = Endian_Swap16(src[i + 1]);
19 dst[i + 2] = Endian_Swap16(src[i + 2]);
20 dst[i + 3] = Endian_Swap16(src[i + 3]);
21 dst[i + 4] = Endian_Swap16(src[i + 4]);
22 dst[i + 5] = Endian_Swap16(src[i + 5]);
23 dst[i + 6] = Endian_Swap16(src[i + 6]);
24 dst[i + 7] = Endian_Swap16(src[i + 7]);
27 for (; i < w; i++)
28 dst[i + 0] = Endian_Swap16(src[i + 0]);