• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

libavutil/bfin/bswap.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2007 Marc Hoffman
00003  *
00004  * This file is part of FFmpeg.
00005  *
00006  * FFmpeg is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * FFmpeg is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with FFmpeg; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00019  */
00020 
00026 #ifndef AVUTIL_BFIN_BSWAP_H
00027 #define AVUTIL_BFIN_BSWAP_H
00028 
00029 #include <stdint.h>
00030 #include "config.h"
00031 #include "libavutil/attributes.h"
00032 
00033 #define bswap_32 bswap_32
00034 static av_always_inline av_const uint32_t bswap_32(uint32_t x)
00035 {
00036     unsigned tmp;
00037     __asm__("%1 = %0 >> 8 (V);      \n\t"
00038             "%0 = %0 << 8 (V);      \n\t"
00039             "%0 = %0 | %1;          \n\t"
00040             "%0 = PACK(%0.L, %0.H); \n\t"
00041             : "+d"(x), "=&d"(tmp));
00042     return x;
00043 }
00044 
00045 #endif /* AVUTIL_BFIN_BSWAP_H */

Generated on Fri Sep 16 2011 17:17:51 for FFmpeg by  doxygen 1.7.1