comparison h264.h @ 11167:c163ffa8c59e libavcodec

Store sub_mb_type in direct_cache/direct_table. This is equal complexity but could be more usefull.
author michael
date Sun, 14 Feb 2010 14:41:27 +0000
parents 5bd834bd759b
children d1a855cb0a0c
comparison
equal deleted inserted replaced
11166:5bd834bd759b 11167:c163ffa8c59e
1058 *(uint32_t*)h->mvd_cache [list][scan8[13]+1]= //FIXME remove past 3 (init somewhere else) 1058 *(uint32_t*)h->mvd_cache [list][scan8[13]+1]= //FIXME remove past 3 (init somewhere else)
1059 *(uint32_t*)h->mvd_cache [list][scan8[4 ]]= 1059 *(uint32_t*)h->mvd_cache [list][scan8[4 ]]=
1060 *(uint32_t*)h->mvd_cache [list][scan8[12]]= 0; 1060 *(uint32_t*)h->mvd_cache [list][scan8[12]]= 0;
1061 1061
1062 if(h->slice_type_nos == FF_B_TYPE){ 1062 if(h->slice_type_nos == FF_B_TYPE){
1063 fill_rectangle(&h->direct_cache[scan8[0]], 4, 4, 8, 0, 1); 1063 fill_rectangle(&h->direct_cache[scan8[0]], 4, 4, 8, MB_TYPE_16x16>>1, 1);
1064 1064
1065 if(IS_DIRECT(top_type)){ 1065 if(IS_DIRECT(top_type)){
1066 *(uint32_t*)&h->direct_cache[scan8[0] - 1*8]= 0x01010101; 1066 *(uint32_t*)&h->direct_cache[scan8[0] - 1*8]= 0x01010101*(MB_TYPE_DIRECT2>>1);
1067 }else if(IS_8X8(top_type)){ 1067 }else if(IS_8X8(top_type)){
1068 int b8_xy = h->mb2b8_xy[top_xy] + h->b8_stride; 1068 int b8_xy = h->mb2b8_xy[top_xy] + h->b8_stride;
1069 h->direct_cache[scan8[0] + 0 - 1*8]= h->direct_table[b8_xy]; 1069 h->direct_cache[scan8[0] + 0 - 1*8]= h->direct_table[b8_xy];
1070 h->direct_cache[scan8[0] + 2 - 1*8]= h->direct_table[b8_xy + 1]; 1070 h->direct_cache[scan8[0] + 2 - 1*8]= h->direct_table[b8_xy + 1];
1071 }else{ 1071 }else{
1072 *(uint32_t*)&h->direct_cache[scan8[0] - 1*8]= 0; 1072 *(uint32_t*)&h->direct_cache[scan8[0] - 1*8]= 0x01010101*(MB_TYPE_16x16>>1);
1073 } 1073 }
1074 1074
1075 if(IS_DIRECT(left_type[0])) 1075 if(IS_DIRECT(left_type[0]))
1076 h->direct_cache[scan8[0] - 1 + 0*8]= 1; 1076 h->direct_cache[scan8[0] - 1 + 0*8]= MB_TYPE_DIRECT2>>1;
1077 else if(IS_8X8(left_type[0])) 1077 else if(IS_8X8(left_type[0]))
1078 h->direct_cache[scan8[0] - 1 + 0*8]= h->direct_table[h->mb2b8_xy[left_xy[0]] + 1 + h->b8_stride*(left_block[0]>>1)]; 1078 h->direct_cache[scan8[0] - 1 + 0*8]= h->direct_table[h->mb2b8_xy[left_xy[0]] + 1 + h->b8_stride*(left_block[0]>>1)];
1079 else 1079 else
1080 h->direct_cache[scan8[0] - 1 + 0*8]= 0; 1080 h->direct_cache[scan8[0] - 1 + 0*8]= MB_TYPE_16x16>>1;
1081 1081
1082 if(IS_DIRECT(left_type[1])) 1082 if(IS_DIRECT(left_type[1]))
1083 h->direct_cache[scan8[0] - 1 + 2*8]= 1; 1083 h->direct_cache[scan8[0] - 1 + 2*8]= MB_TYPE_DIRECT2>>1;
1084 else if(IS_8X8(left_type[1])) 1084 else if(IS_8X8(left_type[1]))
1085 h->direct_cache[scan8[0] - 1 + 2*8]= h->direct_table[h->mb2b8_xy[left_xy[1]] + 1 + h->b8_stride*(left_block[2]>>1)]; 1085 h->direct_cache[scan8[0] - 1 + 2*8]= h->direct_table[h->mb2b8_xy[left_xy[1]] + 1 + h->b8_stride*(left_block[2]>>1)];
1086 else 1086 else
1087 h->direct_cache[scan8[0] - 1 + 2*8]= 0; 1087 h->direct_cache[scan8[0] - 1 + 2*8]= MB_TYPE_16x16>>1;
1088 } 1088 }
1089 } 1089 }
1090 } 1090 }
1091 if(FRAME_MBAFF){ 1091 if(FRAME_MBAFF){
1092 #define MAP_MVS\ 1092 #define MAP_MVS\
1407 } 1407 }
1408 1408
1409 if(h->slice_type_nos == FF_B_TYPE && CABAC){ 1409 if(h->slice_type_nos == FF_B_TYPE && CABAC){
1410 if(IS_8X8(mb_type)){ 1410 if(IS_8X8(mb_type)){
1411 uint8_t *direct_table = &h->direct_table[b8_xy]; 1411 uint8_t *direct_table = &h->direct_table[b8_xy];
1412 direct_table[1+0*h->b8_stride] = IS_DIRECT(h->sub_mb_type[1]) ? 1 : 0; 1412 direct_table[1+0*h->b8_stride] = h->sub_mb_type[1]>>1;
1413 direct_table[0+1*h->b8_stride] = IS_DIRECT(h->sub_mb_type[2]) ? 1 : 0; 1413 direct_table[0+1*h->b8_stride] = h->sub_mb_type[2]>>1;
1414 direct_table[1+1*h->b8_stride] = IS_DIRECT(h->sub_mb_type[3]) ? 1 : 0; 1414 direct_table[1+1*h->b8_stride] = h->sub_mb_type[3]>>1;
1415 } 1415 }
1416 } 1416 }
1417 } 1417 }
1418 1418
1419 static inline int get_dct8x8_allowed(H264Context *h){ 1419 static inline int get_dct8x8_allowed(H264Context *h){