comparison cavs.c @ 11178:fda40558e98a libavcodec

avoid using DECLARE_ALIGNED on stack variable as suggested by Reimar
author stefang
date Mon, 15 Feb 2010 16:37:13 +0000
parents 34a65026fa06
children b94e1810ce4c
comparison
equal deleted inserted replaced
11177:69020e1846fe 11178:fda40558e98a
71 * 1 3 | 71 * 1 3 |
72 * --------- 72 * ---------
73 * 73 *
74 */ 74 */
75 void ff_cavs_filter(AVSContext *h, enum cavs_mb mb_type) { 75 void ff_cavs_filter(AVSContext *h, enum cavs_mb mb_type) {
76 DECLARE_ALIGNED_8(uint8_t, bs)[8]; 76 uint8_t bs[8];
77 int qp_avg, alpha, beta, tc; 77 int qp_avg, alpha, beta, tc;
78 int i; 78 int i;
79 79
80 /* save un-deblocked lines */ 80 /* save un-deblocked lines */
81 h->topleft_border_y = h->top_border_y[h->mbx*16+15]; 81 h->topleft_border_y = h->top_border_y[h->mbx*16+15];
91 h->left_border_v[i+1] = *(h->cv + 7 + i*h->c_stride); 91 h->left_border_v[i+1] = *(h->cv + 7 + i*h->c_stride);
92 } 92 }
93 if(!h->loop_filter_disable) { 93 if(!h->loop_filter_disable) {
94 /* determine bs */ 94 /* determine bs */
95 if(mb_type == I_8X8) 95 if(mb_type == I_8X8)
96 *((uint64_t *)bs) = 0x0202020202020202ULL; 96 memset(bs,2,8);
97 else{ 97 else{
98 *((uint64_t *)bs) = 0; 98 memset(bs,0,8);
99 if(ff_cavs_partition_flags[mb_type] & SPLITV){ 99 if(ff_cavs_partition_flags[mb_type] & SPLITV){
100 bs[2] = get_bs(&h->mv[MV_FWD_X0], &h->mv[MV_FWD_X1], mb_type > P_8X8); 100 bs[2] = get_bs(&h->mv[MV_FWD_X0], &h->mv[MV_FWD_X1], mb_type > P_8X8);
101 bs[3] = get_bs(&h->mv[MV_FWD_X2], &h->mv[MV_FWD_X3], mb_type > P_8X8); 101 bs[3] = get_bs(&h->mv[MV_FWD_X2], &h->mv[MV_FWD_X3], mb_type > P_8X8);
102 } 102 }
103 if(ff_cavs_partition_flags[mb_type] & SPLITH){ 103 if(ff_cavs_partition_flags[mb_type] & SPLITH){
107 bs[0] = get_bs(&h->mv[MV_FWD_A1], &h->mv[MV_FWD_X0], mb_type > P_8X8); 107 bs[0] = get_bs(&h->mv[MV_FWD_A1], &h->mv[MV_FWD_X0], mb_type > P_8X8);
108 bs[1] = get_bs(&h->mv[MV_FWD_A3], &h->mv[MV_FWD_X2], mb_type > P_8X8); 108 bs[1] = get_bs(&h->mv[MV_FWD_A3], &h->mv[MV_FWD_X2], mb_type > P_8X8);
109 bs[4] = get_bs(&h->mv[MV_FWD_B2], &h->mv[MV_FWD_X0], mb_type > P_8X8); 109 bs[4] = get_bs(&h->mv[MV_FWD_B2], &h->mv[MV_FWD_X0], mb_type > P_8X8);
110 bs[5] = get_bs(&h->mv[MV_FWD_B3], &h->mv[MV_FWD_X1], mb_type > P_8X8); 110 bs[5] = get_bs(&h->mv[MV_FWD_B3], &h->mv[MV_FWD_X1], mb_type > P_8X8);
111 } 111 }
112 if( *((uint64_t *)bs) ) { 112 if(AV_RN64(bs)) {
113 if(h->flags & A_AVAIL) { 113 if(h->flags & A_AVAIL) {
114 qp_avg = (h->qp + h->left_qp + 1) >> 1; 114 qp_avg = (h->qp + h->left_qp + 1) >> 1;
115 SET_PARAMS; 115 SET_PARAMS;
116 h->s.dsp.cavs_filter_lv(h->cy,h->l_stride,alpha,beta,tc,bs[0],bs[1]); 116 h->s.dsp.cavs_filter_lv(h->cy,h->l_stride,alpha,beta,tc,bs[0],bs[1]);
117 h->s.dsp.cavs_filter_cv(h->cu,h->c_stride,alpha,beta,tc,bs[0],bs[1]); 117 h->s.dsp.cavs_filter_cv(h->cu,h->c_stride,alpha,beta,tc,bs[0],bs[1]);