comparison h264_direct.c @ 11104:bb877c9cb102 libavcodec

Detect spatial direct MBs partitioned smaller than 16x16 that can be partitioned as 16x16 (except ones changing interlacing relative to the colocated MB). 20 cycles slower during MV generation 175 cycles faster during MC
author michael
date Mon, 08 Feb 2010 16:23:05 +0000
parents 3bc0125e19fe
children 77c5116751b7
comparison
equal deleted inserted replaced
11103:3bc0125e19fe 11104:bb877c9cb102
317 b= pack16to32(mv[1][0],mv[1][1]); 317 b= pack16to32(mv[1][0],mv[1][1]);
318 } 318 }
319 fill_rectangle(&h->mv_cache[0][scan8[0]], 4, 4, 8, a, 4); 319 fill_rectangle(&h->mv_cache[0][scan8[0]], 4, 4, 8, a, 4);
320 fill_rectangle(&h->mv_cache[1][scan8[0]], 4, 4, 8, b, 4); 320 fill_rectangle(&h->mv_cache[1][scan8[0]], 4, 4, 8, b, 4);
321 }else{ 321 }else{
322 int n=0;
322 for(i8=0; i8<4; i8++){ 323 for(i8=0; i8<4; i8++){
323 const int x8 = i8&1; 324 const int x8 = i8&1;
324 const int y8 = i8>>1; 325 const int y8 = i8>>1;
325 326
326 if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8])) 327 if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
342 if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){ 343 if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){
343 if(ref[0] == 0) 344 if(ref[0] == 0)
344 fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4); 345 fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4);
345 if(ref[1] == 0) 346 if(ref[1] == 0)
346 fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4); 347 fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4);
348 n+=4;
347 } 349 }
348 }else{ 350 }else{
349 int m=0; 351 int m=0;
350 for(i4=0; i4<4; i4++){ 352 for(i4=0; i4<4; i4++){
351 const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*b4_stride]; 353 const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*b4_stride];
357 m++; 359 m++;
358 } 360 }
359 } 361 }
360 if(!(m&3)) 362 if(!(m&3))
361 h->sub_mb_type[i8]+= MB_TYPE_16x16 - MB_TYPE_8x8; 363 h->sub_mb_type[i8]+= MB_TYPE_16x16 - MB_TYPE_8x8;
364 n+=m;
362 } 365 }
363 } 366 }
364 } 367 }
368 if(!is_b8x8 && !(n&15))
369 *mb_type= (*mb_type & ~(MB_TYPE_8x8|MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_P1L0|MB_TYPE_P1L1))|MB_TYPE_16x16|MB_TYPE_DIRECT2;
365 } 370 }
366 }else{ /* direct temporal mv pred */ 371 }else{ /* direct temporal mv pred */
367 const int *map_col_to_list0[2] = {h->map_col_to_list0[0], h->map_col_to_list0[1]}; 372 const int *map_col_to_list0[2] = {h->map_col_to_list0[0], h->map_col_to_list0[1]};
368 const int *dist_scale_factor = h->dist_scale_factor; 373 const int *dist_scale_factor = h->dist_scale_factor;
369 int ref_offset; 374 int ref_offset;