comparison h264.c @ 8432:05465a76d699 libavcodec

Simplify ifs(), 8 cpu cycles faster on pentium dual
author michael
date Mon, 22 Dec 2008 15:54:27 +0000
parents 405a44077331
children 79bf8321e6fa
comparison
equal deleted inserted replaced
8431:405a44077331 8432:05465a76d699
133 const int topright_mb_frame_flag = !IS_INTERLACED(s->current_picture.mb_type[topright_pair_xy]); 133 const int topright_mb_frame_flag = !IS_INTERLACED(s->current_picture.mb_type[topright_pair_xy]);
134 const int left_mb_frame_flag = !IS_INTERLACED(s->current_picture.mb_type[pair_xy-1]); 134 const int left_mb_frame_flag = !IS_INTERLACED(s->current_picture.mb_type[pair_xy-1]);
135 const int curr_mb_frame_flag = !IS_INTERLACED(mb_type); 135 const int curr_mb_frame_flag = !IS_INTERLACED(mb_type);
136 const int bottom = (s->mb_y & 1); 136 const int bottom = (s->mb_y & 1);
137 tprintf(s->avctx, "fill_caches: curr_mb_frame_flag:%d, left_mb_frame_flag:%d, topleft_mb_frame_flag:%d, top_mb_frame_flag:%d, topright_mb_frame_flag:%d\n", curr_mb_frame_flag, left_mb_frame_flag, topleft_mb_frame_flag, top_mb_frame_flag, topright_mb_frame_flag); 137 tprintf(s->avctx, "fill_caches: curr_mb_frame_flag:%d, left_mb_frame_flag:%d, topleft_mb_frame_flag:%d, top_mb_frame_flag:%d, topright_mb_frame_flag:%d\n", curr_mb_frame_flag, left_mb_frame_flag, topleft_mb_frame_flag, top_mb_frame_flag, topright_mb_frame_flag);
138 if (bottom 138
139 ? !curr_mb_frame_flag // bottom macroblock 139 if (!curr_mb_frame_flag && (bottom || !top_mb_frame_flag)){
140 : (!curr_mb_frame_flag && !top_mb_frame_flag) // top macroblock
141 ) {
142 top_xy -= s->mb_stride; 140 top_xy -= s->mb_stride;
143 } 141 }
144 if (bottom 142 if (!curr_mb_frame_flag && (bottom || !topleft_mb_frame_flag)){
145 ? !curr_mb_frame_flag // bottom macroblock
146 : (!curr_mb_frame_flag && !topleft_mb_frame_flag) // top macroblock
147 ) {
148 topleft_xy -= s->mb_stride; 143 topleft_xy -= s->mb_stride;
149 } else if(bottom && curr_mb_frame_flag && !left_mb_frame_flag) { 144 } else if(bottom && curr_mb_frame_flag && !left_mb_frame_flag) {
150 topleft_xy += s->mb_stride; 145 topleft_xy += s->mb_stride;
151 // take top left mv from the middle of the mb, as opposed to all other modes which use the bottom right partition 146 // take top left mv from the middle of the mb, as opposed to all other modes which use the bottom right partition
152 topleft_partition = 0; 147 topleft_partition = 0;
153 } 148 }
154 if (bottom 149 if (!curr_mb_frame_flag && (bottom || !topright_mb_frame_flag)){
155 ? !curr_mb_frame_flag // bottom macroblock
156 : (!curr_mb_frame_flag && !topright_mb_frame_flag) // top macroblock
157 ) {
158 topright_xy -= s->mb_stride; 150 topright_xy -= s->mb_stride;
159 } 151 }
160 if (left_mb_frame_flag != curr_mb_frame_flag) { 152 if (left_mb_frame_flag != curr_mb_frame_flag) {
161 left_xy[1] = left_xy[0] = pair_xy - 1; 153 left_xy[1] = left_xy[0] = pair_xy - 1;
162 if (curr_mb_frame_flag) { 154 if (curr_mb_frame_flag) {