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
... | ... |
@@ -375,65 +375,29 @@ static void vc1_mspel_mc(uint8_t *dst, const uint8_t *src, int stride, int mode, |
375 | 375 |
/* this one is defined in dsputil.c */ |
376 | 376 |
void ff_put_vc1_mspel_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int rnd); |
377 | 377 |
|
378 |
-static void put_vc1_mspel_mc10_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { |
|
379 |
- vc1_mspel_mc(dst, src, stride, 0x1, rnd); |
|
378 |
+#define PUT_VC1_MSPEL(a, b)\ |
|
379 |
+static void put_vc1_mspel_mc ## a ## b ##_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { \ |
|
380 |
+ vc1_mspel_mc(dst, src, stride, (a)&((b<<2)), rnd); \ |
|
380 | 381 |
} |
381 | 382 |
|
382 |
-static void put_vc1_mspel_mc20_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { |
|
383 |
- vc1_mspel_mc(dst, src, stride, 0x2, rnd); |
|
384 |
-} |
|
385 |
- |
|
386 |
-static void put_vc1_mspel_mc30_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { |
|
387 |
- vc1_mspel_mc(dst, src, stride, 0x3, rnd); |
|
388 |
-} |
|
389 |
- |
|
390 |
-static void put_vc1_mspel_mc01_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { |
|
391 |
- vc1_mspel_mc(dst, src, stride, 0x4, rnd); |
|
392 |
-} |
|
393 |
- |
|
394 |
-static void put_vc1_mspel_mc11_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { |
|
395 |
- vc1_mspel_mc(dst, src, stride, 0x5, rnd); |
|
396 |
-} |
|
397 |
- |
|
398 |
-static void put_vc1_mspel_mc21_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { |
|
399 |
- vc1_mspel_mc(dst, src, stride, 0x6, rnd); |
|
400 |
-} |
|
401 |
- |
|
402 |
-static void put_vc1_mspel_mc31_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { |
|
403 |
- vc1_mspel_mc(dst, src, stride, 0x7, rnd); |
|
404 |
-} |
|
405 |
- |
|
406 |
-static void put_vc1_mspel_mc02_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { |
|
407 |
- vc1_mspel_mc(dst, src, stride, 0x8, rnd); |
|
408 |
-} |
|
409 |
- |
|
410 |
-static void put_vc1_mspel_mc12_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { |
|
411 |
- vc1_mspel_mc(dst, src, stride, 0x9, rnd); |
|
412 |
-} |
|
413 |
- |
|
414 |
-static void put_vc1_mspel_mc22_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { |
|
415 |
- vc1_mspel_mc(dst, src, stride, 0xA, rnd); |
|
416 |
-} |
|
417 |
- |
|
418 |
-static void put_vc1_mspel_mc32_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { |
|
419 |
- vc1_mspel_mc(dst, src, stride, 0xB, rnd); |
|
420 |
-} |
|
421 |
- |
|
422 |
-static void put_vc1_mspel_mc03_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { |
|
423 |
- vc1_mspel_mc(dst, src, stride, 0xC, rnd); |
|
424 |
-} |
|
383 |
+PUT_VC1_MSPEL(1, 0) |
|
384 |
+PUT_VC1_MSPEL(2, 0) |
|
385 |
+PUT_VC1_MSPEL(3, 0) |
|
425 | 386 |
|
426 |
-static void put_vc1_mspel_mc13_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { |
|
427 |
- vc1_mspel_mc(dst, src, stride, 0xD, rnd); |
|
428 |
-} |
|
387 |
+PUT_VC1_MSPEL(0, 1) |
|
388 |
+PUT_VC1_MSPEL(1, 1) |
|
389 |
+PUT_VC1_MSPEL(2, 1) |
|
390 |
+PUT_VC1_MSPEL(3, 1) |
|
429 | 391 |
|
430 |
-static void put_vc1_mspel_mc23_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { |
|
431 |
- vc1_mspel_mc(dst, src, stride, 0xE, rnd); |
|
432 |
-} |
|
392 |
+PUT_VC1_MSPEL(0, 2) |
|
393 |
+PUT_VC1_MSPEL(1, 2) |
|
394 |
+PUT_VC1_MSPEL(2, 2) |
|
395 |
+PUT_VC1_MSPEL(3, 2) |
|
433 | 396 |
|
434 |
-static void put_vc1_mspel_mc33_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { |
|
435 |
- vc1_mspel_mc(dst, src, stride, 0xF, rnd); |
|
436 |
-} |
|
397 |
+PUT_VC1_MSPEL(0, 3) |
|
398 |
+PUT_VC1_MSPEL(1, 3) |
|
399 |
+PUT_VC1_MSPEL(2, 3) |
|
400 |
+PUT_VC1_MSPEL(3, 3) |
|
437 | 401 |
|
438 | 402 |
void ff_vc1dsp_init(DSPContext* dsp, AVCodecContext *avctx) { |
439 | 403 |
dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_c; |