shithub: h264bsd

Download patch

ref: 8fdc35e038d065965a2d8730e0b2e7e8d1285e39
parent: c3340b05dbd4a6e4632e461284fe40a25dfad796
author: Sam Leitch <sam.leitch@calgaryscientific.com>
date: Mon Mar 17 12:52:35 EDT 2014

Revert Crossbridge optimizations since the new ones didn't work.

--- a/src/h264bsd_conceal.c
+++ b/src/h264bsd_conceal.c
@@ -39,10 +39,6 @@
 #include "h264bsd_reconstruct.h"
 #include "h264bsd_dpb.h"
 
-#ifdef FLASCC
-#include "AS3/AS3.h"
-#endif /* FLASCC */
-
 /*------------------------------------------------------------------------------
     2. External compiler flags
 --------------------------------------------------------------------------------
@@ -186,13 +182,11 @@
 #ifndef FLASCC
             memcpy(currImage->data, refData, width*height*384);
 #else
-            inline_as3(
-                "import flash.utils.ByteArray;\n"
-                "var temp:flash.utils.ByteArray = new flash.utils.ByteArray();\n"
-                "CModule.readBytes(%0, %2, temp);\n"
-                "temp.position = 0;\n"
-                "CModule.writeBytes(%1, %2, temp);" 
-                : : "r" (currImage->data), "r" (refData), "r" (width*height*384));
+            int ii = 0;
+            int size = width*height*384;
+            u8* curr_data = currImage->data;
+            for (ii = 0; ii < size;ii++);
+                curr_data[i] = refData[i];
 #endif
         }
 
--- a/src/h264bsd_reconstruct.c
+++ b/src/h264bsd_reconstruct.c
@@ -43,10 +43,6 @@
 #include "armVC.h"
 #endif /* H264DEC_OMXDL */
 
-#ifdef FLASCC
-#include "AS3/AS3.h"
-#endif /* FLASCC */
-
 /*------------------------------------------------------------------------------
     2. External compiler flags
 --------------------------------------------------------------------------------
@@ -2141,20 +2137,34 @@
   i32 center,
   i32 right)
 {
-
+#ifndef FLASCC
     ASSERT(ref);
     ASSERT(fill);
 
-#ifndef FLASCC
     memcpy(fill, ref, center);
 #else
-    inline_as3(
-        "import flash.utils.ByteArray;\n"
-        "var temp:ByteArray = new ByteArray();\n"
-        "CModule.readBytes(%0, %2, temp);\n"
-        "temp.position = 0;\n"
-        "CModule.writeBytes(%1, %2, temp);" 
-        : : "r" (fill), "r" (ref), "r" (center));
+    int i = 0;    
+    u8 *pdest = (u8*) fill;
+    u8 *psrc = (u8*) ref;
+    int loops = (center / sizeof(u32));
+
+    ASSERT(ref);
+    ASSERT(fill);
+
+    for(i = 0; i < loops; ++i)
+    {
+        *((u32*)pdest) = *((u32*)psrc);
+        pdest += sizeof(u32);
+        psrc += sizeof(u32);
+    }
+
+    loops = (center % sizeof(u32));
+    for (i = 0; i < loops; ++i)
+    {
+        *pdest = *psrc;
+        ++pdest;
+        ++psrc;
+    }
 #endif
 
     /*lint -e(715) */