comparison dv.c @ 4283:d6f83e2f8804 libavcodec

rename always_inline to av_always_inline and move to common.h
author mru
date Fri, 08 Dec 2006 00:35:08 +0000
parents 34fdffe98bd0
children 0ee71c12734e
comparison
equal deleted inserted replaced
4282:9d64f6eacc7b 4283:d6f83e2f8804
558 } 558 }
559 } 559 }
560 560
561 #ifdef DV_CODEC_TINY_TARGET 561 #ifdef DV_CODEC_TINY_TARGET
562 /* Converts run and level (where level != 0) pair into vlc, returning bit size */ 562 /* Converts run and level (where level != 0) pair into vlc, returning bit size */
563 static always_inline int dv_rl2vlc(int run, int level, int sign, uint32_t* vlc) 563 static av_always_inline int dv_rl2vlc(int run, int level, int sign, uint32_t* vlc)
564 { 564 {
565 int size; 565 int size;
566 if (run < DV_VLC_MAP_RUN_SIZE && level < DV_VLC_MAP_LEV_SIZE) { 566 if (run < DV_VLC_MAP_RUN_SIZE && level < DV_VLC_MAP_LEV_SIZE) {
567 *vlc = dv_vlc_map[run][level].vlc | sign; 567 *vlc = dv_vlc_map[run][level].vlc | sign;
568 size = dv_vlc_map[run][level].size; 568 size = dv_vlc_map[run][level].size;
583 } 583 }
584 584
585 return size; 585 return size;
586 } 586 }
587 587
588 static always_inline int dv_rl2vlc_size(int run, int level) 588 static av_always_inline int dv_rl2vlc_size(int run, int level)
589 { 589 {
590 int size; 590 int size;
591 591
592 if (run < DV_VLC_MAP_RUN_SIZE && level < DV_VLC_MAP_LEV_SIZE) { 592 if (run < DV_VLC_MAP_RUN_SIZE && level < DV_VLC_MAP_LEV_SIZE) {
593 size = dv_vlc_map[run][level].size; 593 size = dv_vlc_map[run][level].size;
599 } 599 }
600 } 600 }
601 return size; 601 return size;
602 } 602 }
603 #else 603 #else
604 static always_inline int dv_rl2vlc(int run, int l, int sign, uint32_t* vlc) 604 static av_always_inline int dv_rl2vlc(int run, int l, int sign, uint32_t* vlc)
605 { 605 {
606 *vlc = dv_vlc_map[run][l].vlc | sign; 606 *vlc = dv_vlc_map[run][l].vlc | sign;
607 return dv_vlc_map[run][l].size; 607 return dv_vlc_map[run][l].size;
608 } 608 }
609 609
610 static always_inline int dv_rl2vlc_size(int run, int l) 610 static av_always_inline int dv_rl2vlc_size(int run, int l)
611 { 611 {
612 return dv_vlc_map[run][l].size; 612 return dv_vlc_map[run][l].size;
613 } 613 }
614 #endif 614 #endif
615 615
625 uint8_t sign[64]; 625 uint8_t sign[64];
626 uint8_t partial_bit_count; 626 uint8_t partial_bit_count;
627 uint32_t partial_bit_buffer; /* we can't use uint16_t here */ 627 uint32_t partial_bit_buffer; /* we can't use uint16_t here */
628 } EncBlockInfo; 628 } EncBlockInfo;
629 629
630 static always_inline PutBitContext* dv_encode_ac(EncBlockInfo* bi, PutBitContext* pb_pool, 630 static av_always_inline PutBitContext* dv_encode_ac(EncBlockInfo* bi, PutBitContext* pb_pool,
631 PutBitContext* pb_end) 631 PutBitContext* pb_end)
632 { 632 {
633 int prev; 633 int prev;
634 int bits_left; 634 int bits_left;
635 PutBitContext* pb = pb_pool; 635 PutBitContext* pb = pb_pool;
668 } 668 }
669 } 669 }
670 return pb; 670 return pb;
671 } 671 }
672 672
673 static always_inline void dv_set_class_number(DCTELEM* blk, EncBlockInfo* bi, 673 static av_always_inline void dv_set_class_number(DCTELEM* blk, EncBlockInfo* bi,
674 const uint8_t* zigzag_scan, const int *weight, int bias) 674 const uint8_t* zigzag_scan, const int *weight, int bias)
675 { 675 {
676 int i, area; 676 int i, area;
677 /* We offer two different methods for class number assignment: the 677 /* We offer two different methods for class number assignment: the
678 method suggested in SMPTE 314M Table 22, and an improved 678 method suggested in SMPTE 314M Table 22, and an improved
740 } 740 }
741 } 741 }
742 742
743 //FIXME replace this by dsputil 743 //FIXME replace this by dsputil
744 #define SC(x, y) ((s[x] - s[y]) ^ ((s[x] - s[y]) >> 7)) 744 #define SC(x, y) ((s[x] - s[y]) ^ ((s[x] - s[y]) >> 7))
745 static always_inline int dv_guess_dct_mode(DCTELEM *blk) { 745 static av_always_inline int dv_guess_dct_mode(DCTELEM *blk) {
746 DCTELEM *s; 746 DCTELEM *s;
747 int score88 = 0; 747 int score88 = 0;
748 int score248 = 0; 748 int score248 = 0;
749 int i; 749 int i;
750 750