annotate bfin/bswap.h @ 639:19d5f5c17725 libavutil

cosmetics: Move all #includes together at the beginning of the file.
author diego
date Fri, 30 Jan 2009 18:46:39 +0000
parents 57da90f7c680
children 70bdd5501662
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
582
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
1 /*
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
2 * Copyright (C) 2007 Marc Hoffman
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
3 *
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
4 * This file is part of FFmpeg.
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
5 *
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
6 * FFmpeg is free software; you can redistribute it and/or
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
9 * version 2.1 of the License, or (at your option) any later version.
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
10 *
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
11 * FFmpeg is distributed in the hope that it will be useful,
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
14 * Lesser General Public License for more details.
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
15 *
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
17 * License along with FFmpeg; if not, write to the Free Software
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
19 */
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
20
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
21 /**
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
22 * @file bswap.h
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
23 * byte swapping routines
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
24 */
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
25
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
26 #ifndef AVUTIL_BFIN_BSWAP_H
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
27 #define AVUTIL_BFIN_BSWAP_H
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
28
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
29 #include <stdint.h>
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
30 #include "config.h"
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
31 #include "libavutil/common.h"
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
32
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
33 #define bswap_32 bswap_32
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
34 static av_always_inline av_const uint32_t bswap_32(uint32_t x)
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
35 {
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
36 unsigned tmp;
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
37 __asm__("%1 = %0 >> 8 (V); \n\t"
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
38 "%0 = %0 << 8 (V); \n\t"
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
39 "%0 = %0 | %1; \n\t"
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
40 "%0 = PACK(%0.L, %0.H); \n\t"
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
41 : "+d"(x), "=&d"(tmp));
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
42 return x;
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
43 }
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
44
57da90f7c680 split bswap.h into per-arch files
mru
parents:
diff changeset
45 #endif /* AVUTIL_BFIN_BSWAP_H */