Mercurial > libavcodec.hg
comparison h264_direct.c @ 11105:77c5116751b7 libavcodec
Set partitioning to 16x16 for spatial direct MBs with mixed interlacing.
11cylcles slower MV generation
98cycles faster MC
author | michael |
---|---|
date | Mon, 08 Feb 2010 17:25:50 +0000 |
parents | bb877c9cb102 |
children | f85c5cb2c402 |
comparison
equal
deleted
inserted
replaced
11104:bb877c9cb102 | 11105:77c5116751b7 |
---|---|
268 *mb_type |= MB_TYPE_L0L1; | 268 *mb_type |= MB_TYPE_L0L1; |
269 sub_mb_type |= MB_TYPE_L0L1; | 269 sub_mb_type |= MB_TYPE_L0L1; |
270 } | 270 } |
271 | 271 |
272 if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col[0])){ | 272 if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col[0])){ |
273 int n=0; | |
273 for(i8=0; i8<4; i8++){ | 274 for(i8=0; i8<4; i8++){ |
274 int x8 = i8&1; | 275 int x8 = i8&1; |
275 int y8 = i8>>1; | 276 int y8 = i8>>1; |
276 int xy8 = x8+y8*b8_stride; | 277 int xy8 = x8+y8*b8_stride; |
277 int xy4 = 3*x8+y8*b4_stride; | 278 int xy4 = 3*x8+y8*b4_stride; |
289 a=b=0; | 290 a=b=0; |
290 if(ref[0] > 0) | 291 if(ref[0] > 0) |
291 a= pack16to32(mv[0][0],mv[0][1]); | 292 a= pack16to32(mv[0][0],mv[0][1]); |
292 if(ref[1] > 0) | 293 if(ref[1] > 0) |
293 b= pack16to32(mv[1][0],mv[1][1]); | 294 b= pack16to32(mv[1][0],mv[1][1]); |
295 n++; | |
294 }else{ | 296 }else{ |
295 a= pack16to32(mv[0][0],mv[0][1]); | 297 a= pack16to32(mv[0][0],mv[0][1]); |
296 b= pack16to32(mv[1][0],mv[1][1]); | 298 b= pack16to32(mv[1][0],mv[1][1]); |
297 } | 299 } |
298 fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, a, 4); | 300 fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, a, 4); |
299 fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, b, 4); | 301 fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, b, 4); |
300 } | 302 } |
303 if(!is_b8x8 && !(n&3)) | |
304 *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; | |
301 }else if(IS_16X16(*mb_type)){ | 305 }else if(IS_16X16(*mb_type)){ |
302 int a,b; | 306 int a,b; |
303 | 307 |
304 fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, (uint8_t)ref[0], 1); | 308 fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, (uint8_t)ref[0], 1); |
305 fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, (uint8_t)ref[1], 1); | 309 fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, (uint8_t)ref[1], 1); |