comparison h264.c @ 3003:5411789c5f19 libavcodec

direct mvs in B_8x8 mbs were set too early.
author lorenm
date Sat, 31 Dec 2005 11:31:53 +0000
parents 68d252a8ecd2
children a22cf6e46b0e
comparison
equal deleted inserted replaced
3002:68d252a8ecd2 3003:5411789c5f19
4870 } 4870 }
4871 sub_partition_count[i]= b_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count; 4871 sub_partition_count[i]= b_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count;
4872 h->sub_mb_type[i]= b_sub_mb_type_info[ h->sub_mb_type[i] ].type; 4872 h->sub_mb_type[i]= b_sub_mb_type_info[ h->sub_mb_type[i] ].type;
4873 } 4873 }
4874 if( IS_DIRECT(h->sub_mb_type[0]) || IS_DIRECT(h->sub_mb_type[1]) 4874 if( IS_DIRECT(h->sub_mb_type[0]) || IS_DIRECT(h->sub_mb_type[1])
4875 || IS_DIRECT(h->sub_mb_type[2]) || IS_DIRECT(h->sub_mb_type[3])) 4875 || IS_DIRECT(h->sub_mb_type[2]) || IS_DIRECT(h->sub_mb_type[3])) {
4876 pred_direct_motion(h, &mb_type); 4876 pred_direct_motion(h, &mb_type);
4877 h->ref_cache[0][scan8[4]] =
4878 h->ref_cache[1][scan8[4]] =
4879 h->ref_cache[0][scan8[12]] =
4880 h->ref_cache[1][scan8[12]] = PART_NOT_AVAILABLE;
4881 }
4877 }else{ 4882 }else{
4878 assert(h->slice_type == P_TYPE || h->slice_type == SP_TYPE); //FIXME SP correct ? 4883 assert(h->slice_type == P_TYPE || h->slice_type == SP_TYPE); //FIXME SP correct ?
4879 for(i=0; i<4; i++){ 4884 for(i=0; i<4; i++){
4880 h->sub_mb_type[i]= get_ue_golomb(&s->gb); 4885 h->sub_mb_type[i]= get_ue_golomb(&s->gb);
4881 if(h->sub_mb_type[i] >=4){ 4886 if(h->sub_mb_type[i] >=4){
4910 for(list=0; list<2; list++){ 4915 for(list=0; list<2; list++){
4911 const int ref_count= IS_REF0(mb_type) ? 1 : h->ref_count[list]; 4916 const int ref_count= IS_REF0(mb_type) ? 1 : h->ref_count[list];
4912 if(ref_count == 0) continue; 4917 if(ref_count == 0) continue;
4913 4918
4914 for(i=0; i<4; i++){ 4919 for(i=0; i<4; i++){
4915 if(IS_DIRECT(h->sub_mb_type[i])) continue; 4920 if(IS_DIRECT(h->sub_mb_type[i])) {
4921 h->ref_cache[list][ scan8[4*i] ] = h->ref_cache[list][ scan8[4*i]+1 ];
4922 continue;
4923 }
4916 h->ref_cache[list][ scan8[4*i] ]=h->ref_cache[list][ scan8[4*i]+1 ]= 4924 h->ref_cache[list][ scan8[4*i] ]=h->ref_cache[list][ scan8[4*i]+1 ]=
4917 h->ref_cache[list][ scan8[4*i]+8 ]=h->ref_cache[list][ scan8[4*i]+9 ]= ref[list][i]; 4925 h->ref_cache[list][ scan8[4*i]+8 ]=h->ref_cache[list][ scan8[4*i]+9 ]= ref[list][i];
4918 4926
4919 if(IS_DIR(h->sub_mb_type[i], 0, list)){ 4927 if(IS_DIR(h->sub_mb_type[i], 0, list)){
4920 const int sub_mb_type= h->sub_mb_type[i]; 4928 const int sub_mb_type= h->sub_mb_type[i];