Lines Matching refs:mb_y
278 s->m.mb_y= 0;
495 static int get_dc(SnowContext *s, int mb_x, int mb_y, int plane_index){
509 int index= mb_x + mb_y*b_stride;
523 int mb_y2= mb_y + (i>>1) - 1;
532 int index= x2-(block_w*mb_x - block_w/2) + (y2-(block_h*mb_y - block_h/2))*obmc_stride;
591 static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, uint8_t (*obmc_edged)[MB_SIZE * 2]){
611 int sy= block_h*mb_y - block_h/2;
620 ff_snow_pred_block(s, cur, tmp, ref_stride, sx, sy, block_w*2, block_h*2, &s->block[mb_x + mb_y*b_stride], plane_index, w, h);
642 && (mb_y == 0 || mb_y == b_height-1)){
647 if(mb_y == 0)
684 rate += get_block_bits(s, mb_x + (i&1) - (i>>1), mb_y + (i>>1), 1);
687 rate += get_block_bits(s, mb_x + 1, mb_y + 1, 1);
692 static int get_4block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index){
717 int mb_y2= mb_y + (i/3) - 1;
743 BlockNode *b= &s->block[mb_x+mb_y*b_stride];
752 rate = get_block_bits(s, mb_x, mb_y, 2);
755 rate += get_block_bits(s, mb_x + dxy[i][0], mb_y + dxy[i][1], 1);
888 static av_always_inline int check_block(SnowContext *s, int mb_x, int mb_y, int p[3], int intra, uint8_t (*obmc_edged)[MB_SIZE * 2], int *best_rd){
890 BlockNode *block= &s->block[mb_x + mb_y * b_stride];
895 av_assert2(mb_x>=0 && mb_y>=0);
915 rd= get_block_rd(s, mb_x, mb_y, 0, obmc_edged);
929 static av_always_inline int check_block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, uint8_t (*obmc_edged)[MB_SIZE * 2], int *best_rd){
931 return check_block(s, mb_x, mb_y, p, 0, obmc_edged, best_rd);
934 static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, int ref, int *best_rd){
936 BlockNode *block= &s->block[mb_x + mb_y * b_stride];
949 av_assert2(mb_x>=0 && mb_y>=0);
951 av_assert2(((mb_x|mb_y)&1) == 0);
965 rd= get_4block_rd(s, mb_x, mb_y, 0);
981 int pass, mb_x, mb_y;
991 for(mb_y= 0; mb_y<s->b_height; mb_y++)
993 encode_q_branch(s, 0, mb_x, mb_y);
1001 for(mb_y= 0; mb_y<b_height; mb_y++){
1006 const int index= mb_x + mb_y * b_stride;
1008 BlockNode *tb = mb_y ? &s->block[index-b_stride ] : NULL;
1011 BlockNode *bb = mb_y+1<b_height ? &s->block[index+b_stride ] : NULL;
1012 BlockNode *tlb= mb_x && mb_y ? &s->block[index-b_stride-1] : NULL;
1013 BlockNode *trb= mb_x+1<b_width && mb_y ? &s->block[index-b_stride+1] : NULL;
1014 BlockNode *blb= mb_x && mb_y+1<b_height ? &s->block[index+b_stride-1] : NULL;
1015 BlockNode *brb= mb_x+1<b_width && mb_y+1<b_height ? &s->block[index+b_stride+1] : NULL;
1040 if(mb_y==0){
1046 if(mb_y==b_height-1){
1055 if(mb_x==0 || mb_y==0 || mb_x==b_width-1 || mb_y==b_height-1){
1062 const int sy= block_h*mb_y - block_h/2;
1083 color[i]= get_dc(s, mb_x, mb_y, i);
1088 check_block(s, mb_x, mb_y, color0, 1, obmc_edged, &best_rd);
1090 check_block_inter(s, mb_x, mb_y, block->mx, block->my, obmc_edged, &best_rd);
1101 check_block_inter(s, mb_x, mb_y, mvr[0][0], mvr[0][1], obmc_edged, &best_rd);
1102 check_block_inter(s, mb_x, mb_y, 0, 0, obmc_edged, &best_rd);
1104 check_block_inter(s, mb_x, mb_y, mvr[-b_stride][0], mvr[-b_stride][1], obmc_edged, &best_rd);
1106 check_block_inter(s, mb_x, mb_y, mvr[-1][0], mvr[-1][1], obmc_edged, &best_rd);
1108 check_block_inter(s, mb_x, mb_y, mvr[1][0], mvr[1][1], obmc_edged, &best_rd);
1110 check_block_inter(s, mb_x, mb_y, mvr[b_stride][0], mvr[b_stride][1], obmc_edged, &best_rd);
1118 dia_change |= check_block_inter(s, mb_x, mb_y, block->mx+4*(i-j), block->my+(4*j), obmc_edged, &best_rd);
1119 dia_change |= check_block_inter(s, mb_x, mb_y, block->mx-4*(i-j), block->my-(4*j), obmc_edged, &best_rd);
1120 dia_change |= check_block_inter(s, mb_x, mb_y, block->mx+4*(i-j), block->my-(4*j), obmc_edged, &best_rd);
1121 dia_change |= check_block_inter(s, mb_x, mb_y, block->mx-4*(i-j), block->my+(4*j), obmc_edged, &best_rd);
1130 dia_change |= check_block_inter(s, mb_x, mb_y, block->mx+square[i][0], block->my+square[i][1], obmc_edged, &best_rd);
1143 check_block(s, mb_x, mb_y, color, 1, obmc_edged, &best_rd);
1165 for(mb_y= 0; mb_y<b_height; mb_y+=2){
1169 const int index= mb_x + mb_y * b_stride;
1185 init_rd= best_rd= get_4block_rd(s, mb_x, mb_y, 0);
1188 check_4block_inter(s, mb_x, mb_y,
1194 check_4block_inter(s, mb_x, mb_y, b[i]->mx, b[i]->my, b[i]->ref, &best_rd);