annotate integer.h @ 374:8805bba131a9 libavutil

Add attribute that forces alignment of stack to functions that need it. Necessary for systems that don't align by default to 16 bytes, required by some SSE instructions. Requires GCC >= 4.2. Based on patch by Ga¸«³l Chardon.
author ramiro
date Mon, 13 Aug 2007 15:28:29 +0000
parents f13e5473611e
children d0f3bb6e367e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
1 /*
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
2 * arbitrary precision integers
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
3 * Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
4 *
116
d76a36742464 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 15
diff changeset
5 * This file is part of FFmpeg.
d76a36742464 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 15
diff changeset
6 *
d76a36742464 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 15
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
0
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
116
d76a36742464 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 15
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
0
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
11 *
116
d76a36742464 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 15
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
0
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
15 * Lesser General Public License for more details.
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
16 *
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
116
d76a36742464 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 15
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
15
af59e84e283d Update licensing information: The FSF changed postal address.
diego
parents: 12
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
0
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
20 */
12
ce8f9f4390c3 COSMETICS: Remove all trailing whitespace.
diego
parents: 0
diff changeset
21
0
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
22 /**
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
23 * @file integer.h
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
24 * arbitrary precision integers
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
25 * @author Michael Niedermayer <michaelni@gmx.at>
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
26 */
12
ce8f9f4390c3 COSMETICS: Remove all trailing whitespace.
diego
parents: 0
diff changeset
27
0
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
28 #ifndef INTEGER_H
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
29 #define INTEGER_H
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
30
343
f21d1907d47c include all prerequisites in header files
mru
parents: 277
diff changeset
31 #include <stdint.h>
f21d1907d47c include all prerequisites in header files
mru
parents: 277
diff changeset
32
0
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
33 #define AV_INTEGER_SIZE 8
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
34
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
35 typedef struct AVInteger{
12
ce8f9f4390c3 COSMETICS: Remove all trailing whitespace.
diego
parents: 0
diff changeset
36 uint16_t v[AV_INTEGER_SIZE];
0
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
37 } AVInteger;
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
38
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
39 AVInteger av_add_i(AVInteger a, AVInteger b);
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
40 AVInteger av_sub_i(AVInteger a, AVInteger b);
277
d25ab70c93c4 Move av_log2_i()'s unaltered comments to the header file.
takis
parents: 276
diff changeset
41
d25ab70c93c4 Move av_log2_i()'s unaltered comments to the header file.
takis
parents: 276
diff changeset
42 /**
d25ab70c93c4 Move av_log2_i()'s unaltered comments to the header file.
takis
parents: 276
diff changeset
43 * returns the rounded down value of the logarithm of base 2 of the given AVInteger.
d25ab70c93c4 Move av_log2_i()'s unaltered comments to the header file.
takis
parents: 276
diff changeset
44 * this is simply the index of the most significant bit which is 1. Or 0 of all bits are 0
d25ab70c93c4 Move av_log2_i()'s unaltered comments to the header file.
takis
parents: 276
diff changeset
45 */
0
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
46 int av_log2_i(AVInteger a);
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
47 AVInteger av_mul_i(AVInteger a, AVInteger b);
274
57262361a75c Move av_cmp_i()'s unaltered comment to the header file.
takis
parents: 273
diff changeset
48
57262361a75c Move av_cmp_i()'s unaltered comment to the header file.
takis
parents: 273
diff changeset
49 /**
57262361a75c Move av_cmp_i()'s unaltered comment to the header file.
takis
parents: 273
diff changeset
50 * returns 0 if a==b, 1 if a>b and -1 if a<b.
57262361a75c Move av_cmp_i()'s unaltered comment to the header file.
takis
parents: 273
diff changeset
51 */
0
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
52 int av_cmp_i(AVInteger a, AVInteger b);
273
1907c66098b0 Move av_shr_i()'s unaltered comments to the header file.
takis
parents: 272
diff changeset
53
1907c66098b0 Move av_shr_i()'s unaltered comments to the header file.
takis
parents: 272
diff changeset
54 /**
1907c66098b0 Move av_shr_i()'s unaltered comments to the header file.
takis
parents: 272
diff changeset
55 * bitwise shift.
1907c66098b0 Move av_shr_i()'s unaltered comments to the header file.
takis
parents: 272
diff changeset
56 * @param s the number of bits by which the value should be shifted right, may be negative for shifting left
1907c66098b0 Move av_shr_i()'s unaltered comments to the header file.
takis
parents: 272
diff changeset
57 */
0
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
58 AVInteger av_shr_i(AVInteger a, int s);
271
38e9c99c3aad Move av_mod_i()'s comment to the header file. The moved comment is unmodified.
takis
parents: 116
diff changeset
59
38e9c99c3aad Move av_mod_i()'s comment to the header file. The moved comment is unmodified.
takis
parents: 116
diff changeset
60 /**
38e9c99c3aad Move av_mod_i()'s comment to the header file. The moved comment is unmodified.
takis
parents: 116
diff changeset
61 * returns a % b.
38e9c99c3aad Move av_mod_i()'s comment to the header file. The moved comment is unmodified.
takis
parents: 116
diff changeset
62 * @param quot a/b will be stored here
38e9c99c3aad Move av_mod_i()'s comment to the header file. The moved comment is unmodified.
takis
parents: 116
diff changeset
63 */
0
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
64 AVInteger av_mod_i(AVInteger *quot, AVInteger a, AVInteger b);
272
2bf3b2fee71a Move av_div_i()'s comments to the header file. The comments are unaltered.
takis
parents: 271
diff changeset
65
2bf3b2fee71a Move av_div_i()'s comments to the header file. The comments are unaltered.
takis
parents: 271
diff changeset
66 /**
2bf3b2fee71a Move av_div_i()'s comments to the header file. The comments are unaltered.
takis
parents: 271
diff changeset
67 * returns a/b.
2bf3b2fee71a Move av_div_i()'s comments to the header file. The comments are unaltered.
takis
parents: 271
diff changeset
68 */
0
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
69 AVInteger av_div_i(AVInteger a, AVInteger b);
275
14164ec1b454 Move av_int2i()'s unaltered comments to the header file.
takis
parents: 274
diff changeset
70
14164ec1b454 Move av_int2i()'s unaltered comments to the header file.
takis
parents: 274
diff changeset
71 /**
14164ec1b454 Move av_int2i()'s unaltered comments to the header file.
takis
parents: 274
diff changeset
72 * converts the given int64_t to an AVInteger.
14164ec1b454 Move av_int2i()'s unaltered comments to the header file.
takis
parents: 274
diff changeset
73 */
0
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
74 AVInteger av_int2i(int64_t a);
276
0df0d9771d02 Move av_i2int()'s unaltered comments to the header file.
takis
parents: 275
diff changeset
75
0df0d9771d02 Move av_i2int()'s unaltered comments to the header file.
takis
parents: 275
diff changeset
76 /**
0df0d9771d02 Move av_i2int()'s unaltered comments to the header file.
takis
parents: 275
diff changeset
77 * converts the given AVInteger to an int64_t.
0df0d9771d02 Move av_i2int()'s unaltered comments to the header file.
takis
parents: 275
diff changeset
78 * if the AVInteger is too large to fit into an int64_t,
0df0d9771d02 Move av_i2int()'s unaltered comments to the header file.
takis
parents: 275
diff changeset
79 * then only the least significant 64bit will be used
0df0d9771d02 Move av_i2int()'s unaltered comments to the header file.
takis
parents: 275
diff changeset
80 */
0
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
81 int64_t av_i2int(AVInteger a);
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
82
ee8f44bb7c4d libavutil: Utility code from libavcodec moved to a separate library.
al
parents:
diff changeset
83 #endif // INTEGER_H