<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Oct 21, 2013 at 6:21 AM, <span dir="ltr"><<a href="mailto:shazeb@multicorewareinc.com" target="_blank">shazeb@multicorewareinc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Shazeb Nawaz Khan <<a href="mailto:shazeb@multicorewareinc.com">shazeb@multicorewareinc.com</a>><br>
# Date 1382354467 -19800<br>
# Mon Oct 21 16:51:07 2013 +0530<br>
# Node ID 3e732910246416da437183675b0892f6ebb43005<br>
# Parent f987c24c7bf2d3e6df0f96b2c75f3e71ab15a85e<br>
Adapting weightp primitive for pixel input<br><br></blockquote><div><br></div><div>queued, but I have a question</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
by simulating shift & round as in convertPixelToShort Primitive<br>
<br>
diff -r f987c24c7bf2 -r 3e7329102464 source/common/pixel.cpp<br>
--- a/source/common/pixel.cpp Mon Oct 21 16:15:22 2013 +0530<br>
+++ b/source/common/pixel.cpp Mon Oct 21 16:51:07 2013 +0530<br>
@@ -516,8 +516,7 @@<br>
}<br>
}<br>
<br>
-template<typename T><br>
-void weightUnidir(T *src, pixel *dst, intptr_t srcStride, intptr_t dstStride, int width, int height, int w0, int round, int shift, int offset)<br>
+void weightUnidir(int16_t *src, pixel *dst, intptr_t srcStride, intptr_t dstStride, int width, int height, int w0, int round, int shift, int offset)<br>
{<br>
int x, y;<br>
<br>
@@ -525,15 +524,31 @@<br>
{<br>
for (x = width - 1; x >= 0; )<br>
{<br>
- // note: luma min width is 4<br>
- dst[x] = (pixel)Clip3(0, ((1 << X265_DEPTH) - 1), ((w0 * (src[x] + IF_INTERNAL_OFFS) + round) >> shift) + offset);<br>
- x--;<br>
+ // note: width can be odd<br>
dst[x] = (pixel)Clip3(0, ((1 << X265_DEPTH) - 1), ((w0 * (src[x] + IF_INTERNAL_OFFS) + round) >> shift) + offset);<br>
x--;<br></blockquote><div><br></div><div>is there a reason the loop criteria are so wierd? If weights rows backwards (from right to left) and top to bottom but y counts from bottom to top?</div><div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
}<br>
<br>
src += srcStride;<br>
- dst += dstStride;<br>
+ dst += dstStride;<br>
+ }<br>
+}<br>
+<br>
+void weightUnidirPix(pixel *src, pixel *dst, intptr_t srcStride, intptr_t dstStride, int width, int height, int w0, int round, int shift, int offset)<br>
+{<br>
+ int x, y;<br>
+ for (y = height - 1; y >= 0; y--)<br>
+ {<br>
+ for (x = width - 1; x >= 0; )<br>
+ {<br>
+ // simulating pixel to short conversion<br>
+ short val = src[x] << (IF_INTERNAL_PREC - X265_DEPTH);<br>
+ dst[x] = (pixel) Clip3(0, ((1 << X265_DEPTH) - 1), ((w0 * (val) + round) >> shift) + offset);<br>
+ x--;<br>
+ }<br>
+<br>
+ src += srcStride;<br>
+ dst += dstStride;<br>
}<br>
}<br>
<br>
@@ -856,8 +871,8 @@<br>
p.transpose[3] = transpose<32>;<br>
p.transpose[4] = transpose<64>;<br>
<br>
- p.weightpUniPixel = weightUnidir<pixel>;<br>
- p.weightpUni = weightUnidir<int16_t>;<br>
+ p.weightpUniPixel = weightUnidirPix;<br>
+ p.weightpUni = weightUnidir;<br>
<br>
p.pixelsub_sp = pixelsub_sp_c;<br>
p.pixeladd_pp = pixeladd_pp_c;<br>
diff -r f987c24c7bf2 -r 3e7329102464 source/common/vec/pixel-sse41.cpp<br>
--- a/source/common/vec/pixel-sse41.cpp Mon Oct 21 16:15:22 2013 +0530<br>
+++ b/source/common/vec/pixel-sse41.cpp Mon Oct 21 16:51:07 2013 +0530<br>
@@ -5659,8 +5659,8 @@<br>
p.sse_pp[LUMA_64x48] = sse_pp_64<48>;<br>
p.sse_pp[LUMA_64x16] = sse_pp_64<16>;<br>
<br>
- p.weightpUniPixel = weightUnidirPixel;<br>
- p.weightpUni = weightUnidir;<br>
+// p.weightpUniPixel = weightUnidirPixel;<br>
+// p.weightpUni = weightUnidir;<br>
#endif /* !HIGH_BIT_DEPTH */<br>
}<br>
}<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Steve Borho
</div></div>