summaryrefslogtreecommitdiff
path: root/libavcodec/vc1dsp.c
diff options
context:
space:
mode:
authorChristophe Gisquet <christophe.gisquet@free.fr>2007-07-08 13:26:13 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2007-07-08 13:26:13 +0000
commit803b09044963734ecee76eb4d8313072d4045173 (patch)
tree3bcf2256799e4cb41b1d1e1dc1a1df5ae50ac7b7 /libavcodec/vc1dsp.c
parente95c953b5534bdd0ad796c9e5d903a4874c18852 (diff)
Replace function declarations with macro
Patch by by Christophe GISQUET ( echo $name| tr "[A-Z ]" "[a-z.]"|sed s/.*/&@free.fr/ ) Thread: [PATCH] Clean up in C VC-1 DSP functions Originally committed as revision 9536 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vc1dsp.c')
-rw-r--r--libavcodec/vc1dsp.c72
1 files changed, 18 insertions, 54 deletions
diff --git a/libavcodec/vc1dsp.c b/libavcodec/vc1dsp.c
index f0d9585a15..51403e6aae 100644
--- a/libavcodec/vc1dsp.c
+++ b/libavcodec/vc1dsp.c
@@ -375,65 +375,29 @@ static void vc1_mspel_mc(uint8_t *dst, const uint8_t *src, int stride, int mode,
/* this one is defined in dsputil.c */
void ff_put_vc1_mspel_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int rnd);
-static void put_vc1_mspel_mc10_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0x1, rnd);
+#define PUT_VC1_MSPEL(a, b)\
+static void put_vc1_mspel_mc ## a ## b ##_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { \
+ vc1_mspel_mc(dst, src, stride, (a)&((b<<2)), rnd); \
}
-static void put_vc1_mspel_mc20_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0x2, rnd);
-}
-
-static void put_vc1_mspel_mc30_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0x3, rnd);
-}
-
-static void put_vc1_mspel_mc01_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0x4, rnd);
-}
-
-static void put_vc1_mspel_mc11_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0x5, rnd);
-}
-
-static void put_vc1_mspel_mc21_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0x6, rnd);
-}
-
-static void put_vc1_mspel_mc31_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0x7, rnd);
-}
-
-static void put_vc1_mspel_mc02_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0x8, rnd);
-}
-
-static void put_vc1_mspel_mc12_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0x9, rnd);
-}
-
-static void put_vc1_mspel_mc22_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0xA, rnd);
-}
-
-static void put_vc1_mspel_mc32_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0xB, rnd);
-}
-
-static void put_vc1_mspel_mc03_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0xC, rnd);
-}
+PUT_VC1_MSPEL(1, 0)
+PUT_VC1_MSPEL(2, 0)
+PUT_VC1_MSPEL(3, 0)
-static void put_vc1_mspel_mc13_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0xD, rnd);
-}
+PUT_VC1_MSPEL(0, 1)
+PUT_VC1_MSPEL(1, 1)
+PUT_VC1_MSPEL(2, 1)
+PUT_VC1_MSPEL(3, 1)
-static void put_vc1_mspel_mc23_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0xE, rnd);
-}
+PUT_VC1_MSPEL(0, 2)
+PUT_VC1_MSPEL(1, 2)
+PUT_VC1_MSPEL(2, 2)
+PUT_VC1_MSPEL(3, 2)
-static void put_vc1_mspel_mc33_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0xF, rnd);
-}
+PUT_VC1_MSPEL(0, 3)
+PUT_VC1_MSPEL(1, 3)
+PUT_VC1_MSPEL(2, 3)
+PUT_VC1_MSPEL(3, 3)
void ff_vc1dsp_init(DSPContext* dsp, AVCodecContext *avctx) {
dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_c;