Mercurial > libavcodec.hg
comparison vc1dsp.c @ 5252:e4b9ca118ab1 libavcodec
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
author | kostya |
---|---|
date | Sun, 08 Jul 2007 13:26:13 +0000 |
parents | f2a1fa269c12 |
children | a69976bf878c |
comparison
equal
deleted
inserted
replaced
5251:f2a1fa269c12 | 5252:e4b9ca118ab1 |
---|---|
373 /* pixel functions - really are entry points to vc1_mspel_mc */ | 373 /* pixel functions - really are entry points to vc1_mspel_mc */ |
374 | 374 |
375 /* this one is defined in dsputil.c */ | 375 /* this one is defined in dsputil.c */ |
376 void ff_put_vc1_mspel_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int rnd); | 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) { | 378 #define PUT_VC1_MSPEL(a, b)\ |
379 vc1_mspel_mc(dst, src, stride, 0x1, rnd); | 379 static void put_vc1_mspel_mc ## a ## b ##_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { \ |
380 } | 380 vc1_mspel_mc(dst, src, stride, (a)&((b<<2)), rnd); \ |
381 | 381 } |
382 static void put_vc1_mspel_mc20_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { | 382 |
383 vc1_mspel_mc(dst, src, stride, 0x2, rnd); | 383 PUT_VC1_MSPEL(1, 0) |
384 } | 384 PUT_VC1_MSPEL(2, 0) |
385 | 385 PUT_VC1_MSPEL(3, 0) |
386 static void put_vc1_mspel_mc30_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { | 386 |
387 vc1_mspel_mc(dst, src, stride, 0x3, rnd); | 387 PUT_VC1_MSPEL(0, 1) |
388 } | 388 PUT_VC1_MSPEL(1, 1) |
389 | 389 PUT_VC1_MSPEL(2, 1) |
390 static void put_vc1_mspel_mc01_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { | 390 PUT_VC1_MSPEL(3, 1) |
391 vc1_mspel_mc(dst, src, stride, 0x4, rnd); | 391 |
392 } | 392 PUT_VC1_MSPEL(0, 2) |
393 | 393 PUT_VC1_MSPEL(1, 2) |
394 static void put_vc1_mspel_mc11_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { | 394 PUT_VC1_MSPEL(2, 2) |
395 vc1_mspel_mc(dst, src, stride, 0x5, rnd); | 395 PUT_VC1_MSPEL(3, 2) |
396 } | 396 |
397 | 397 PUT_VC1_MSPEL(0, 3) |
398 static void put_vc1_mspel_mc21_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) { | 398 PUT_VC1_MSPEL(1, 3) |
399 vc1_mspel_mc(dst, src, stride, 0x6, rnd); | 399 PUT_VC1_MSPEL(2, 3) |
400 } | 400 PUT_VC1_MSPEL(3, 3) |
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 } | |
425 | |
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 } | |
429 | |
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 } | |
433 | |
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 } | |
437 | 401 |
438 void ff_vc1dsp_init(DSPContext* dsp, AVCodecContext *avctx) { | 402 void ff_vc1dsp_init(DSPContext* dsp, AVCodecContext *avctx) { |
439 dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_c; | 403 dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_c; |
440 dsp->vc1_inv_trans_4x8 = vc1_inv_trans_4x8_c; | 404 dsp->vc1_inv_trans_4x8 = vc1_inv_trans_4x8_c; |
441 dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_c; | 405 dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_c; |