changeset 862:c531582449c4

Merged in deepthidevaki/xhevc_deepthid (pull request #94) Modified FIlter vec primitives
author nandaku2 <deepthi@multicorewareinc.com>
date Fri, 26 Apr 2013 17:39:38 +0530
parents 0e30f0ceb6c3 (current diff) b0115edcc276 (diff)
children aa94262bd0b9
files
diffstat 2 files changed, 36 insertions(+-), 12 deletions(-) [+]
line wrap: on
line diff
--- a/source/encoder/vec/interpolationfilter.inc	Fri Apr 26 17:12:27 2013 +0530
+++ b/source/encoder/vec/interpolationfilter.inc	Fri Apr 26 17:39:38 2013 +0530
@@ -440,6 +440,8 @@ void CDECL filterHorizontal_pel_short(in
 
 void CDECL filterConvertPelToShort(int bitDepth, pixel *src, int srcStride, short *dst, int dstStride, int width, int height)
 {
+    pixel* srcOrg = src;
+    short* dstOrg = dst;
     int shift = IF_INTERNAL_PREC - bitDepth;
     int row, col;
     Vec8s src_v, dst_v, val_v;
@@ -454,20 +456,32 @@ void CDECL filterConvertPelToShort(int b
             dst_v.store(dst + col);
         }
 
-        if (col < width)
+        src += srcStride;
+        dst += dstStride;
+    }
+
+    if (width % 8 != 0)
+    {
+        src = srcOrg;
+        dst = dstOrg;
+        col = width - (width % 8);
+        for (row = 0; row < height; row++)
         {
             src_v.load(src + col);
             val_v = src_v << shift;
             dst_v = val_v - IF_INTERNAL_OFFS;
             dst_v.store_partial(width - col, dst + col);
+
+            src += srcStride;
+            dst += dstStride;
         }
-        src += srcStride;
-        dst += dstStride;
     }
 }
 
 void CDECL filterConvertShortToPel(int bitDepth, short *src, int srcStride, pixel *dst, int dstStride, int width, int height)
 {
+    short* srcOrg = src;
+    pixel* dstOrg = dst;
     int shift = IF_INTERNAL_PREC - bitDepth;
     short offset = IF_INTERNAL_OFFS;
 
@@ -487,16 +501,26 @@ void CDECL filterConvertShortToPel(int b
             val_c.store(dst + col);
         }
 
-        if (col < width)
+        src += srcStride;
+        dst += dstStride;
+    }
+
+    if (width % 8 != 0)
+    {
+        src = srcOrg;
+        dst = dstOrg;
+        col = width - (width % 8);
+        for (row = 0; row < height; row++)
         {
             src_c.load(src + col);
             val_c = add_saturated(src_c, offset) >> shift;
             val_c = max(val_c, minVal);
             val_c = min(val_c, maxVal);
             val_c.store_partial(width - col, dst + col);
+
+            src += srcStride;
+            dst += dstStride;
         }
-        src += srcStride;
-        dst += dstStride;
     }
 }
 
--- a/source/test/ipfilterharness.cpp	Fri Apr 26 17:12:27 2013 +0530
+++ b/source/test/ipfilterharness.cpp	Fri Apr 26 17:39:38 2013 +0530
@@ -192,11 +192,11 @@ bool IPFilterHarness::check_IPFilter_pri
 
     for (int i = 0; i <= 100; i++)
     {
-        memset(IPF_vec_output_p, 0, ipf_t_size);      // Initialize output buffer to zero
-        memset(IPF_C_output_p, 0, ipf_t_size);        // Initialize output buffer to zero
+        memset(IPF_vec_output_s, 0, ipf_t_size);      // Initialize output buffer to zero
+        memset(IPF_C_output_s, 0, ipf_t_size);        // Initialize output buffer to zero
 
-        rand_srcStride = rand() % 100;              // Randomly generated srcStride
-        rand_dstStride = rand() % 100;              // Randomly generated dstStride
+        rand_srcStride = rand_width + rand() % 100;              // Randomly generated srcStride
+        rand_dstStride = rand_width + rand() % 100;              // Randomly generated dstStride
 
         opt(8, pixel_buff,
             rand_srcStride,
@@ -229,8 +229,8 @@ bool IPFilterHarness::check_IPFilter_pri
         memset(IPF_vec_output_p, 0, ipf_t_size);      // Initialize output buffer to zero
         memset(IPF_C_output_p, 0, ipf_t_size);        // Initialize output buffer to zero
 
-        rand_srcStride = rand() % 100;              // Randomly generated srcStride
-        rand_dstStride = rand() % 100;              // Randomly generated dstStride
+        rand_srcStride = rand_width + rand() % 100;              // Randomly generated srcStride
+        rand_dstStride = rand_width + rand() % 100;              // Randomly generated dstStride
 
         opt(8, short_buff,
             rand_srcStride,