Changeset 771

Show
Ignore:
Timestamp:
01/17/08 17:22:41 (9 months ago)
Author:
astrange
Message:

Backport a crash fix for h.264 from ffmpeg trunk.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/perian-1.1/ffmpeg-patch

    r721 r771  
    429429         ); 
    430430 } 
     431 
     432Index: libavcodec/dsputil.c 
     433=================================================================== 
     434--- libavcodec/dsputil.c        (revision 11192) 
     435+++ libavcodec/dsputil.c        (revision 11290) 
     436@@ -1440,6 +1440,7 @@ 
     437     \ 
     438     assert(x<8 && y<8 && x>=0 && y>=0);\ 
     439 \ 
     440+    if(D){\ 
     441     for(i=0; i<h; i++)\ 
     442     {\ 
     443         OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\ 
     444@@ -1447,6 +1448,17 @@ 
     445         dst+= stride;\ 
     446         src+= stride;\ 
     447     }\ 
     448+    }else{\ 
     449+        const int E= B+C;\ 
     450+        const int step= C ? stride : 1;\ 
     451+        for(i=0; i<h; i++)\ 
     452+        {\ 
     453+            OP(dst[0], (A*src[0] + E*src[step+0]));\ 
     454+            OP(dst[1], (A*src[1] + E*src[step+1]));\ 
     455+            dst+= stride;\ 
     456+            src+= stride;\ 
     457+        }\ 
     458+    }\ 
     459 }\ 
     460 \ 
     461 static void OPNAME ## h264_chroma_mc4_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){\ 
     462@@ -1458,6 +1470,7 @@ 
     463     \ 
     464     assert(x<8 && y<8 && x>=0 && y>=0);\ 
     465 \ 
     466+    if(D){\ 
     467     for(i=0; i<h; i++)\ 
     468     {\ 
     469         OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\ 
     470@@ -1467,6 +1480,19 @@ 
     471         dst+= stride;\ 
     472         src+= stride;\ 
     473     }\ 
     474+    }else{\ 
     475+        const int E= B+C;\ 
     476+        const int step= C ? stride : 1;\ 
     477+        for(i=0; i<h; i++)\ 
     478+        {\ 
     479+            OP(dst[0], (A*src[0] + E*src[step+0]));\ 
     480+            OP(dst[1], (A*src[1] + E*src[step+1]));\ 
     481+            OP(dst[2], (A*src[2] + E*src[step+2]));\ 
     482+            OP(dst[3], (A*src[3] + E*src[step+3]));\ 
     483+            dst+= stride;\ 
     484+            src+= stride;\ 
     485+        }\ 
     486+    }\ 
     487 }\ 
     488 \ 
     489 static void OPNAME ## h264_chroma_mc8_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){\ 
     490@@ -1478,6 +1504,7 @@ 
     491     \ 
     492     assert(x<8 && y<8 && x>=0 && y>=0);\ 
     493 \ 
     494+    if(D){\ 
     495     for(i=0; i<h; i++)\ 
     496     {\ 
     497         OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\ 
     498@@ -1491,6 +1518,23 @@ 
     499         dst+= stride;\ 
     500         src+= stride;\ 
     501     }\ 
     502+    }else{\ 
     503+        const int E= B+C;\ 
     504+        const int step= C ? stride : 1;\ 
     505+        for(i=0; i<h; i++)\ 
     506+        {\ 
     507+            OP(dst[0], (A*src[0] + E*src[step+0]));\ 
     508+            OP(dst[1], (A*src[1] + E*src[step+1]));\ 
     509+            OP(dst[2], (A*src[2] + E*src[step+2]));\ 
     510+            OP(dst[3], (A*src[3] + E*src[step+3]));\ 
     511+            OP(dst[4], (A*src[4] + E*src[step+4]));\ 
     512+            OP(dst[5], (A*src[5] + E*src[step+5]));\ 
     513+            OP(dst[6], (A*src[6] + E*src[step+6]));\ 
     514+            OP(dst[7], (A*src[7] + E*src[step+7]));\ 
     515+            dst+= stride;\ 
     516+            src+= stride;\ 
     517+        }\ 
     518+    }\ 
     519 } 
     520  
     521 #define op_avg(a, b) a = (((a)+(((b) + 32)>>6)+1)>>1)