~noskcaj/ubuntu/saucy/libav/merge0.8.7-1

« back to all changes in this revision

Viewing changes to debian/patches/post-0.7.1/0035-h264-correct-implicit-weight-table-computation-for-l.patch

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2011-09-28 09:18:34 UTC
  • mfrom: (1.3.7 sid)
  • Revision ID: package-import@ubuntu.com-20110928091834-w415mnuh06h4zpvc
Tags: 4:0.7.1-7ubuntu2
Revert "Convert package to include multiarch support."

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 45b3f7c71ec213a2f4177e866586660fcbc68ecd Mon Sep 17 00:00:00 2001
 
2
From: Jeff Downs <heydowns@somuchpressure.net>
 
3
Date: Wed, 6 Jul 2011 11:54:36 -0400
 
4
Subject: [PATCH 35/70] h264: correct implicit weight table computation for long ref pics
 
5
 
 
6
Correct computation of implicit weight tables when referencing pictures
 
7
that are marked for long reference.
 
8
 
 
9
Signed-off-by: Diego Biurrun <diego@biurrun.de>
 
10
(cherry picked from commit 87cf70eb237e7586cc7399627dafa1b980ec0b7d)
 
11
 
 
12
Signed-off-by: Anton Khirnov <anton@khirnov.net>
 
13
---
 
14
 libavcodec/h264.c |   20 +++++++++++---------
 
15
 1 files changed, 11 insertions(+), 9 deletions(-)
 
16
 
 
17
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
 
18
index 99be210..1c60de7 100644
 
19
--- a/libavcodec/h264.c
 
20
+++ b/libavcodec/h264.c
 
21
@@ -2198,15 +2198,17 @@ static void implicit_weight_table(H264Context *h, int field){
 
22
     for(ref0=ref_start; ref0 < ref_count0; ref0++){
 
23
         int poc0 = h->ref_list[0][ref0].poc;
 
24
         for(ref1=ref_start; ref1 < ref_count1; ref1++){
 
25
-            int poc1 = h->ref_list[1][ref1].poc;
 
26
-            int td = av_clip(poc1 - poc0, -128, 127);
 
27
-            int w= 32;
 
28
-            if(td){
 
29
-                int tb = av_clip(cur_poc - poc0, -128, 127);
 
30
-                int tx = (16384 + (FFABS(td) >> 1)) / td;
 
31
-                int dist_scale_factor = (tb*tx + 32) >> 8;
 
32
-                if(dist_scale_factor >= -64 && dist_scale_factor <= 128)
 
33
-                    w = 64 - dist_scale_factor;
 
34
+            int w = 32;
 
35
+            if (!h->ref_list[0][ref0].long_ref && !h->ref_list[1][ref1].long_ref) {
 
36
+                int poc1 = h->ref_list[1][ref1].poc;
 
37
+                int td = av_clip(poc1 - poc0, -128, 127);
 
38
+                if(td){
 
39
+                    int tb = av_clip(cur_poc - poc0, -128, 127);
 
40
+                    int tx = (16384 + (FFABS(td) >> 1)) / td;
 
41
+                    int dist_scale_factor = (tb*tx + 32) >> 8;
 
42
+                    if(dist_scale_factor >= -64 && dist_scale_factor <= 128)
 
43
+                        w = 64 - dist_scale_factor;
 
44
+                }
 
45
             }
 
46
             if(field<0){
 
47
                 h->implicit_weight[ref0][ref1][0]=
 
48
-- 
 
49
1.7.4.1
 
50