comparison snow.c @ 3057:8f78b00d1252 libavcodec

fix convergence of snow iterative_me
author lorenm
date Sat, 21 Jan 2006 02:35:03 +0000
parents 17494903551b
children f02d0b59279c
comparison
equal deleted inserted replaced
3056:17494903551b 3057:8f78b00d1252
3143 * .RXx. 3143 * .RXx.
3144 * rxx.. 3144 * rxx..
3145 */ 3145 */
3146 rate += get_block_bits(s, mb_x + (i&1) - (i>>1), mb_y + (i>>1), 1); 3146 rate += get_block_bits(s, mb_x + (i&1) - (i>>1), mb_y + (i>>1), 1);
3147 } 3147 }
3148 if(mb_x == b_stride-2)
3149 rate += get_block_bits(s, mb_x + 1, mb_y + 1, 1);
3148 } 3150 }
3149 return distortion + rate*penalty_factor; 3151 return distortion + rate*penalty_factor;
3150 } 3152 }
3151 3153
3152 static int get_4block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index){ 3154 static int get_4block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index){
3387 // intra(black) = neighbors' contribution to the current block 3389 // intra(black) = neighbors' contribution to the current block
3388 for(i=0; i<3; i++) 3390 for(i=0; i<3; i++)
3389 color[i]= get_dc(s, mb_x, mb_y, i); 3391 color[i]= get_dc(s, mb_x, mb_y, i);
3390 3392
3391 // get previous score (cant be cached due to OBMC) 3393 // get previous score (cant be cached due to OBMC)
3392 check_block_inter(s, mb_x, mb_y, block->mx, block->my, 0, *obmc_edged, &best_rd); 3394 if(pass > 0 && (block->type&BLOCK_INTRA)){
3395 int color0[3]= {block->color[0], block->color[1], block->color[2]};
3396 check_block(s, mb_x, mb_y, color0, 1, *obmc_edged, &best_rd);
3397 }else
3398 check_block_inter(s, mb_x, mb_y, block->mx, block->my, 0, *obmc_edged, &best_rd);
3399
3393 check_block_inter(s, mb_x, mb_y, 0, 0, 0, *obmc_edged, &best_rd); 3400 check_block_inter(s, mb_x, mb_y, 0, 0, 0, *obmc_edged, &best_rd);
3394 check_block_inter(s, mb_x, mb_y, tb->mx, tb->my, 0, *obmc_edged, &best_rd); 3401 check_block_inter(s, mb_x, mb_y, tb->mx, tb->my, 0, *obmc_edged, &best_rd);
3395 check_block_inter(s, mb_x, mb_y, lb->mx, lb->my, 0, *obmc_edged, &best_rd); 3402 check_block_inter(s, mb_x, mb_y, lb->mx, lb->my, 0, *obmc_edged, &best_rd);
3396 check_block_inter(s, mb_x, mb_y, rb->mx, rb->my, 0, *obmc_edged, &best_rd); 3403 check_block_inter(s, mb_x, mb_y, rb->mx, rb->my, 0, *obmc_edged, &best_rd);
3397 check_block_inter(s, mb_x, mb_y, bb->mx, bb->my, 0, *obmc_edged, &best_rd); 3404 check_block_inter(s, mb_x, mb_y, bb->mx, bb->my, 0, *obmc_edged, &best_rd);