comparison mpegvideo.c @ 5286:4393e09e32ec libavcodec

move ff_h263_round_chroma() to mpegvideo.h as static inline
author mru
date Wed, 11 Jul 2007 21:04:53 +0000
parents c6bc608d2659
children 07844149dfa9
comparison
equal deleted inserted replaced
5285:6661692d34b4 5286:4393e09e32ec
67 /* enable all paranoid tests for rounding, overflows, etc... */ 67 /* enable all paranoid tests for rounding, overflows, etc... */
68 //#define PARANOID 68 //#define PARANOID
69 69
70 //#define DEBUG 70 //#define DEBUG
71 71
72
73 static const uint8_t h263_chroma_roundtab[16] = {
74 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
75 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
76 };
77 72
78 static const uint8_t ff_default_chroma_qscale_table[32]={ 73 static const uint8_t ff_default_chroma_qscale_table[32]={
79 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 74 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
80 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 75 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
81 }; 76 };
1590 pix_op[lowres](dest_cr, ptr_cr, uvlinesize, h >> s->chroma_y_shift, uvsx, uvsy); 1585 pix_op[lowres](dest_cr, ptr_cr, uvlinesize, h >> s->chroma_y_shift, uvsx, uvsy);
1591 } 1586 }
1592 //FIXME h261 lowres loop filter 1587 //FIXME h261 lowres loop filter
1593 } 1588 }
1594 1589
1595 inline int ff_h263_round_chroma(int x){
1596 if (x >= 0)
1597 return (h263_chroma_roundtab[x & 0xf] + ((x >> 3) & ~1));
1598 else {
1599 x = -x;
1600 return -(h263_chroma_roundtab[x & 0xf] + ((x >> 3) & ~1));
1601 }
1602 }
1603
1604 static inline void chroma_4mv_motion_lowres(MpegEncContext *s, 1590 static inline void chroma_4mv_motion_lowres(MpegEncContext *s,
1605 uint8_t *dest_cb, uint8_t *dest_cr, 1591 uint8_t *dest_cb, uint8_t *dest_cr,
1606 uint8_t **ref_picture, 1592 uint8_t **ref_picture,
1607 h264_chroma_mc_func *pix_op, 1593 h264_chroma_mc_func *pix_op,
1608 int mx, int my){ 1594 int mx, int my){