[FFmpeg-cvslog] r9536 - trunk/libavcodec/vc1dsp.c

kostya subversion
Sun Jul 8 15:26:13 CEST 2007


Author: kostya
Date: Sun Jul  8 15:26:13 2007
New Revision: 9536

Log:
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


Modified:
   trunk/libavcodec/vc1dsp.c

Modified: trunk/libavcodec/vc1dsp.c
==============================================================================
--- trunk/libavcodec/vc1dsp.c	(original)
+++ trunk/libavcodec/vc1dsp.c	Sun Jul  8 15:26:13 2007
@@ -375,65 +375,29 @@ static void vc1_mspel_mc(uint8_t *dst, c
 /* 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);
-}
-
-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);
+#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_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;




More information about the ffmpeg-cvslog mailing list