Mercurial > libavcodec.hg
comparison h264.c @ 7479:6abd94f87b45 libavcodec
Fix dist_scale_factor for long term reference pictures.
author | michael |
---|---|
date | Mon, 04 Aug 2008 11:17:22 +0000 |
parents | 9ed1ef44127b |
children | 82918a570d86 |
comparison
equal
deleted
inserted
replaced
7478:12d42593e467 | 7479:6abd94f87b45 |
---|---|
878 const int poc1 = h->ref_list[1][0].poc; | 878 const int poc1 = h->ref_list[1][0].poc; |
879 int i; | 879 int i; |
880 for(i=0; i<h->ref_count[0]; i++){ | 880 for(i=0; i<h->ref_count[0]; i++){ |
881 int poc0 = h->ref_list[0][i].poc; | 881 int poc0 = h->ref_list[0][i].poc; |
882 int td = av_clip(poc1 - poc0, -128, 127); | 882 int td = av_clip(poc1 - poc0, -128, 127); |
883 if(td == 0 /* FIXME || pic0 is a long-term ref */){ | 883 if(td == 0 || h->ref_list[0][i].long_ref){ |
884 h->dist_scale_factor[i] = 256; | 884 h->dist_scale_factor[i] = 256; |
885 }else{ | 885 }else{ |
886 int tb = av_clip(poc - poc0, -128, 127); | 886 int tb = av_clip(poc - poc0, -128, 127); |
887 int tx = (16384 + (FFABS(td) >> 1)) / td; | 887 int tx = (16384 + (FFABS(td) >> 1)) / td; |
888 h->dist_scale_factor[i] = av_clip((tb*tx + 32) >> 6, -1024, 1023); | 888 h->dist_scale_factor[i] = av_clip((tb*tx + 32) >> 6, -1024, 1023); |