comparison snow.c @ 3000:b333953b7e6f libavcodec

:%s/check_block_2p/check_block_inter/g
author mmu_man
date Fri, 30 Dec 2005 22:41:32 +0000
parents bc83e7a080a5
children 088920c095fc
comparison
equal deleted inserted replaced
2999:bc83e7a080a5 3000:b333953b7e6f
3135 return 0; 3135 return 0;
3136 } 3136 }
3137 } 3137 }
3138 3138
3139 /* special case for int[2] args we discard afterward, fixes compilation prob with gcc 2.95 */ 3139 /* special case for int[2] args we discard afterward, fixes compilation prob with gcc 2.95 */
3140 static always_inline int check_block_2p(SnowContext *s, int mb_x, int mb_y, int p0, int p1, int intra, int *best_rd){ 3140 static always_inline int check_block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, int intra, int *best_rd){
3141 int p[2] = {p0, p1}; 3141 int p[2] = {p0, p1};
3142 return check_block(s, mb_x, mb_y, p, intra, best_rd); 3142 return check_block(s, mb_x, mb_y, p, intra, best_rd);
3143 } 3143 }
3144 3144
3145 static void iterative_me(SnowContext *s){ 3145 static void iterative_me(SnowContext *s){
3177 if(!s->me_cache_generation) 3177 if(!s->me_cache_generation)
3178 memset(s->me_cache, 0, sizeof(s->me_cache)); 3178 memset(s->me_cache, 0, sizeof(s->me_cache));
3179 s->me_cache_generation += 1<<22; 3179 s->me_cache_generation += 1<<22;
3180 3180
3181 // get previous score (cant be cached due to OBMC) 3181 // get previous score (cant be cached due to OBMC)
3182 check_block_2p(s, mb_x, mb_y, block->mx, block->my, 0, &best_rd); 3182 check_block_inter(s, mb_x, mb_y, block->mx, block->my, 0, &best_rd);
3183 check_block_2p(s, mb_x, mb_y, 0, 0, 0, &best_rd); 3183 check_block_inter(s, mb_x, mb_y, 0, 0, 0, &best_rd);
3184 check_block_2p(s, mb_x, mb_y, tb->mx, tb->my, 0, &best_rd); 3184 check_block_inter(s, mb_x, mb_y, tb->mx, tb->my, 0, &best_rd);
3185 check_block_2p(s, mb_x, mb_y, lb->mx, lb->my, 0, &best_rd); 3185 check_block_inter(s, mb_x, mb_y, lb->mx, lb->my, 0, &best_rd);
3186 check_block_2p(s, mb_x, mb_y, rb->mx, rb->my, 0, &best_rd); 3186 check_block_inter(s, mb_x, mb_y, rb->mx, rb->my, 0, &best_rd);
3187 check_block_2p(s, mb_x, mb_y, bb->mx, bb->my, 0, &best_rd); 3187 check_block_inter(s, mb_x, mb_y, bb->mx, bb->my, 0, &best_rd);
3188 3188
3189 /* fullpel ME */ 3189 /* fullpel ME */
3190 //FIXME avoid subpel interpol / round to nearest integer 3190 //FIXME avoid subpel interpol / round to nearest integer
3191 do{ 3191 do{
3192 dia_change=0; 3192 dia_change=0;
3193 for(i=0; i<FFMAX(s->avctx->dia_size, 1); i++){ 3193 for(i=0; i<FFMAX(s->avctx->dia_size, 1); i++){
3194 for(j=0; j<i; j++){ 3194 for(j=0; j<i; j++){
3195 dia_change |= check_block_2p(s, mb_x, mb_y, block->mx+4*(i-j), block->my+(4*j), 0, &best_rd); 3195 dia_change |= check_block_inter(s, mb_x, mb_y, block->mx+4*(i-j), block->my+(4*j), 0, &best_rd);
3196 dia_change |= check_block_2p(s, mb_x, mb_y, block->mx-4*(i-j), block->my-(4*j), 0, &best_rd); 3196 dia_change |= check_block_inter(s, mb_x, mb_y, block->mx-4*(i-j), block->my-(4*j), 0, &best_rd);
3197 dia_change |= check_block_2p(s, mb_x, mb_y, block->mx+4*(i-j), block->my-(4*j), 0, &best_rd); 3197 dia_change |= check_block_inter(s, mb_x, mb_y, block->mx+4*(i-j), block->my-(4*j), 0, &best_rd);
3198 dia_change |= check_block_2p(s, mb_x, mb_y, block->mx-4*(i-j), block->my+(4*j), 0, &best_rd); 3198 dia_change |= check_block_inter(s, mb_x, mb_y, block->mx-4*(i-j), block->my+(4*j), 0, &best_rd);
3199 } 3199 }
3200 } 3200 }
3201 }while(dia_change); 3201 }while(dia_change);
3202 /* subpel ME */ 3202 /* subpel ME */
3203 do{ 3203 do{
3204 static const int square[8][2]= {{+1, 0},{-1, 0},{ 0,+1},{ 0,-1},{+1,+1},{-1,-1},{+1,-1},{-1,+1},}; 3204 static const int square[8][2]= {{+1, 0},{-1, 0},{ 0,+1},{ 0,-1},{+1,+1},{-1,-1},{+1,-1},{-1,+1},};
3205 dia_change=0; 3205 dia_change=0;
3206 for(i=0; i<8; i++) 3206 for(i=0; i<8; i++)
3207 dia_change |= check_block_2p(s, mb_x, mb_y, block->mx+square[i][0], block->my+square[i][1], 0, &best_rd); 3207 dia_change |= check_block_inter(s, mb_x, mb_y, block->mx+square[i][0], block->my+square[i][1], 0, &best_rd);
3208 }while(dia_change); 3208 }while(dia_change);
3209 //FIXME or try the standard 2 pass qpel or similar 3209 //FIXME or try the standard 2 pass qpel or similar
3210 #if 1 3210 #if 1
3211 for(i=0; i<3; i++){ 3211 for(i=0; i<3; i++){
3212 color[i]= get_dc(s, mb_x, mb_y, i); 3212 color[i]= get_dc(s, mb_x, mb_y, i);