[x265] [PATCH] added blockcopy_ps c primitive and function pointes

praveen at multicorewareinc.com praveen at multicorewareinc.com
Mon Nov 11 07:12:03 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1384150311 -19800
# Node ID e21aad3dd866f16281b27e8c743065de835e205d
# Parent  9d74638c3640679d09264b793afdf3ffc58a9107
added  blockcopy_ps c primitive and function pointes

diff -r 9d74638c3640 -r e21aad3dd866 source/common/pixel.cpp
--- a/source/common/pixel.cpp	Sat Nov 09 20:14:24 2013 -0600
+++ b/source/common/pixel.cpp	Mon Nov 11 11:41:51 2013 +0530
@@ -763,6 +763,21 @@
         b += strideb;
     }
 }
+
+template<int bx, int by>
+void blockcopy_ps_c(int16_t *a, intptr_t stridea, pixel *b, intptr_t strideb)
+{
+    for (int y = 0; y < by; y++)
+    {
+        for (int x = 0; x < bx; x++)
+        {
+            a[x] = (int16_t)b[x];
+        }
+
+        a += stridea;
+        b += strideb;
+    }
+}
 }  // end anonymous namespace
 
 namespace x265 {
@@ -805,10 +820,13 @@
 
 #define CHROMA(W, H) \
     p.chroma_copy_pp[CHROMA_ ## W ## x ## H] = blockcopy_pp_c<W, H>; \
-    p.chroma_copy_sp[CHROMA_ ## W ## x ## H] = blockcopy_sp_c<W, H>;
+    p.chroma_copy_sp[CHROMA_ ## W ## x ## H] = blockcopy_sp_c<W, H>; \
+    p.chroma_copy_ps[CHROMA_ ## W ## x ## H] = blockcopy_ps_c<W, H>;
+
 #define LUMA(W, H) \
     p.luma_copy_pp[LUMA_ ## W ## x ## H] = blockcopy_pp_c<W, H>; \
-    p.luma_copy_sp[LUMA_ ## W ## x ## H] = blockcopy_sp_c<W, H>;
+    p.luma_copy_sp[LUMA_ ## W ## x ## H] = blockcopy_sp_c<W, H>; \
+    p.luma_copy_ps[LUMA_ ## W ## x ## H] = blockcopy_ps_c<W, H>;
 
     LUMA(4, 4);
     LUMA(8, 8);
diff -r 9d74638c3640 -r e21aad3dd866 source/common/primitives.h
--- a/source/common/primitives.h	Sat Nov 09 20:14:24 2013 -0600
+++ b/source/common/primitives.h	Mon Nov 11 11:41:51 2013 +0530
@@ -204,6 +204,7 @@
 
 typedef void (*copy_pp_t)(pixel *dst, intptr_t dstride, pixel *src, intptr_t sstride); // dst is aligned
 typedef void (*copy_sp_t)(pixel *dst, intptr_t dstStride, int16_t *src, intptr_t srcStride);
+typedef void (*copy_ps_t)(int16_t *dst, intptr_t dstStride, pixel *src, intptr_t srcStride);
 
 /* Define a structure containing function pointers to optimized encoder
  * primitives.  Each pointer can reference either an assembly routine,
@@ -232,6 +233,8 @@
     copy_pp_t       chroma_copy_pp[NUM_CHROMA_PARTITIONS];
     copy_sp_t       luma_copy_sp[NUM_LUMA_PARTITIONS];
     copy_sp_t       chroma_copy_sp[NUM_CHROMA_PARTITIONS];
+    copy_ps_t       luma_copy_ps[NUM_LUMA_PARTITIONS];
+    copy_ps_t       chroma_copy_ps[NUM_CHROMA_PARTITIONS];
 
     ipfilter_ps_t   ipfilter_ps[NUM_IPFILTER_P_S];
     ipfilter_sp_t   ipfilter_sp[NUM_IPFILTER_S_P];


More information about the x265-devel mailing list