Mercurial > libavcodec.hg
annotate armv4l/dsputil_arm.c @ 1539:14d01ccc0081 libavcodec
picture buffer cleanup, this fixes a assertion failure (if assertion checking was manualy enabled for utils.c) and a memleak at least
author | michael |
---|---|
date | Thu, 16 Oct 2003 00:21:54 +0000 |
parents | cca26199ab17 |
children | aeea63c97878 |
rev | line source |
---|---|
61 | 1 /* |
2 * ARMv4L optimized DSP utils | |
3 * Copyright (c) 2001 Lionel Ulmer. | |
4 * | |
429 | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Lesser General Public | |
7 * License as published by the Free Software Foundation; either | |
8 * version 2 of the License, or (at your option) any later version. | |
61 | 9 * |
429 | 10 * This library is distributed in the hope that it will be useful, |
61 | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
429 | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Lesser General Public License for more details. | |
61 | 14 * |
429 | 15 * You should have received a copy of the GNU Lesser General Public |
16 * License along with this library; if not, write to the Free Software | |
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
61 | 18 */ |
19 | |
20 #include "../dsputil.h" | |
21 | |
22 extern void j_rev_dct_ARM(DCTELEM *data); | |
1347
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
23 extern void simple_idct_ARM(DCTELEM *data); |
61 | 24 |
1092 | 25 /* XXX: local hack */ |
26 static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size); | |
27 static void (*ff_add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size); | |
28 | |
29 /* XXX: those functions should be suppressed ASAP when all IDCTs are | |
30 converted */ | |
1347
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
31 static void j_rev_dct_ARM_put(uint8_t *dest, int line_size, DCTELEM *block) |
1092 | 32 { |
33 j_rev_dct_ARM (block); | |
34 ff_put_pixels_clamped(block, dest, line_size); | |
35 } | |
1347
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
36 static void j_rev_dct_ARM_add(uint8_t *dest, int line_size, DCTELEM *block) |
61 | 37 { |
1092 | 38 j_rev_dct_ARM (block); |
39 ff_add_pixels_clamped(block, dest, line_size); | |
61 | 40 } |
1347
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
41 static void simple_idct_ARM_put(uint8_t *dest, int line_size, DCTELEM *block) |
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
42 { |
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
43 simple_idct_ARM (block); |
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
44 ff_put_pixels_clamped(block, dest, line_size); |
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
45 } |
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
46 static void simple_idct_ARM_add(uint8_t *dest, int line_size, DCTELEM *block) |
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
47 { |
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
48 simple_idct_ARM (block); |
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
49 ff_add_pixels_clamped(block, dest, line_size); |
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
50 } |
1092 | 51 |
52 void dsputil_init_armv4l(DSPContext* c, AVCodecContext *avctx) | |
53 { | |
54 const int idct_algo= avctx->idct_algo; | |
55 | |
56 ff_put_pixels_clamped = c->put_pixels_clamped; | |
57 ff_add_pixels_clamped = c->add_pixels_clamped; | |
58 | |
59 if(idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_ARM){ | |
1347
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
60 c->idct_put= j_rev_dct_ARM_put; |
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
61 c->idct_add= j_rev_dct_ARM_add; |
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
62 c->idct = j_rev_dct_ARM; |
1092 | 63 c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;/* FF_NO_IDCT_PERM */ |
1347
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
64 } else if (idct_algo==FF_IDCT_SIMPLEARM){ |
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
65 c->idct_put= simple_idct_ARM_put; |
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
66 c->idct_add= simple_idct_ARM_add; |
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
67 c->idct = simple_idct_ARM; |
cca26199ab17
Optimized simple idct for arm by Frederic 'dilb' Boulay <dilb@handhelds.org>. Currently licensed under the GPLv2, but the author allowed to license it under the LGPL, feel free to change
al3x
parents:
1324
diff
changeset
|
68 c->idct_permutation_type= FF_NO_IDCT_PERM; |
1092 | 69 } |
70 } |