aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorJeff Downs <heydowns@somuchpressure.net>2011-07-06 11:54:36 -0400
committerJeff Downs <heydowns@somuchpressure.net>2011-07-28 15:11:16 -0400
commit4105443872be75a8d1141facc43b54641304c722 (patch)
treec035436f38999cd11992a050b80eee3d5b572ad7 /libavcodec
parente80e2d5ba1d8c699fa1cf0c329feb6e237362505 (diff)
downloadffmpeg-4105443872be75a8d1141facc43b54641304c722.tar.gz
h264 - Correct implicit weight table computation for long ref pics
Correct computation of implicit weight tables when referencing pictures that are marked for long reference.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 57711141ae..8dfb2b263e 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2174,9 +2174,10 @@ static void implicit_weight_table(H264Context *h, int field){
for(ref0=ref_start; ref0 < ref_count0; ref0++){
int poc0 = h->ref_list[0][ref0].poc;
for(ref1=ref_start; ref1 < ref_count1; ref1++){
+ int w= 32;
+ if (!h->ref_list[0][ref0].long_ref && !h->ref_list[1][ref1].long_ref){
int poc1 = h->ref_list[1][ref1].poc;
int td = av_clip(poc1 - poc0, -128, 127);
- int w= 32;
if(td){
int tb = av_clip(cur_poc - poc0, -128, 127);
int tx = (16384 + (FFABS(td) >> 1)) / td;
@@ -2184,6 +2185,7 @@ static void implicit_weight_table(H264Context *h, int field){
if(dist_scale_factor >= -64 && dist_scale_factor <= 128)
w = 64 - dist_scale_factor;
}
+ }
if(field<0){
h->implicit_weight[ref0][ref1][0]=
h->implicit_weight[ref0][ref1][1]= w;