00001 /* 00002 * IEC 61937 common code 00003 * Copyright (c) 2009 Bartlomiej Wolowiec 00004 * 00005 * This file is part of FFmpeg. 00006 * 00007 * FFmpeg is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * FFmpeg is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with FFmpeg; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 */ 00021 00022 #include "spdif.h" 00023 #include "libavutil/bswap.h" 00024 00025 //TODO move to DSP 00026 void ff_spdif_bswap_buf16(uint16_t *dst, const uint16_t *src, int w) 00027 { 00028 int i; 00029 00030 for (i = 0; i + 8 <= w; i += 8) { 00031 dst[i + 0] = av_bswap16(src[i + 0]); 00032 dst[i + 1] = av_bswap16(src[i + 1]); 00033 dst[i + 2] = av_bswap16(src[i + 2]); 00034 dst[i + 3] = av_bswap16(src[i + 3]); 00035 dst[i + 4] = av_bswap16(src[i + 4]); 00036 dst[i + 5] = av_bswap16(src[i + 5]); 00037 dst[i + 6] = av_bswap16(src[i + 6]); 00038 dst[i + 7] = av_bswap16(src[i + 7]); 00039 } 00040 for (; i < w; i++) 00041 dst[i + 0] = av_bswap16(src[i + 0]); 00042 }