Mercurial > libavcodec.hg
comparison h264.c @ 7480:82918a570d86 libavcodec
Use ref_poc and ref_count from the correct field.
Fixes at least
MR8_BT_B.h264
author | michael |
---|---|
date | Mon, 04 Aug 2008 11:19:54 +0000 |
parents | 6abd94f87b45 |
children | ca205cc57734 |
comparison
equal
deleted
inserted
replaced
7479:6abd94f87b45 | 7480:82918a570d86 |
---|---|
899 MpegEncContext * const s = &h->s; | 899 MpegEncContext * const s = &h->s; |
900 Picture * const ref1 = &h->ref_list[1][0]; | 900 Picture * const ref1 = &h->ref_list[1][0]; |
901 Picture * const cur = s->current_picture_ptr; | 901 Picture * const cur = s->current_picture_ptr; |
902 int list, i, j; | 902 int list, i, j; |
903 int sidx= s->picture_structure&1; | 903 int sidx= s->picture_structure&1; |
904 int ref1sidx= ref1->reference&1; | |
904 if(cur->pict_type == FF_I_TYPE) | 905 if(cur->pict_type == FF_I_TYPE) |
905 cur->ref_count[sidx][0] = 0; | 906 cur->ref_count[sidx][0] = 0; |
906 if(cur->pict_type != FF_B_TYPE) | 907 if(cur->pict_type != FF_B_TYPE) |
907 cur->ref_count[sidx][1] = 0; | 908 cur->ref_count[sidx][1] = 0; |
908 for(list=0; list<2; list++){ | 909 for(list=0; list<2; list++){ |
911 cur->ref_poc[sidx][list][j] = h->ref_list[list][j].poc; | 912 cur->ref_poc[sidx][list][j] = h->ref_list[list][j].poc; |
912 } | 913 } |
913 if(cur->pict_type != FF_B_TYPE || h->direct_spatial_mv_pred) | 914 if(cur->pict_type != FF_B_TYPE || h->direct_spatial_mv_pred) |
914 return; | 915 return; |
915 for(list=0; list<2; list++){ | 916 for(list=0; list<2; list++){ |
916 for(i=0; i<ref1->ref_count[sidx][list]; i++){ | 917 for(i=0; i<ref1->ref_count[ref1sidx][list]; i++){ |
917 const int poc = ref1->ref_poc[sidx][list][i]; | 918 const int poc = ref1->ref_poc[ref1sidx][list][i]; |
918 h->map_col_to_list0[list][i] = 0; /* bogus; fills in for missing frames */ | 919 h->map_col_to_list0[list][i] = 0; /* bogus; fills in for missing frames */ |
919 for(j=0; j<h->ref_count[list]; j++) | 920 for(j=0; j<h->ref_count[list]; j++) |
920 if(h->ref_list[list][j].poc == poc){ | 921 if(h->ref_list[list][j].poc == poc){ |
921 h->map_col_to_list0[list][i] = j; | 922 h->map_col_to_list0[list][i] = j; |
922 break; | 923 break; |
923 } | 924 } |
924 } | 925 } |
925 } | 926 } |
926 if(FRAME_MBAFF){ | 927 if(FRAME_MBAFF){ |
927 for(list=0; list<2; list++){ | 928 for(list=0; list<2; list++){ |
928 for(i=0; i<ref1->ref_count[sidx][list]; i++){ | 929 for(i=0; i<ref1->ref_count[ref1sidx][list]; i++){ |
929 j = h->map_col_to_list0[list][i]; | 930 j = h->map_col_to_list0[list][i]; |
930 h->map_col_to_list0_field[list][2*i] = 2*j; | 931 h->map_col_to_list0_field[list][2*i] = 2*j; |
931 h->map_col_to_list0_field[list][2*i+1] = 2*j+1; | 932 h->map_col_to_list0_field[list][2*i+1] = 2*j+1; |
932 } | 933 } |
933 } | 934 } |