<div dir="ltr">will apply our white space coding style and resend it again<div><br></div><div>Regards</div><div>Sumalatha</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Mar 14, 2014 at 10:48 PM, Steve Borho <span dir="ltr"><<a href="mailto:steve@borho.org" target="_blank">steve@borho.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Thu, Mar 13, 2014 at 6:08 AM, <<a href="mailto:sumalatha@multicorewareinc.com">sumalatha@multicorewareinc.com</a>> wrote:<br>
> # HG changeset patch<br>
> # User Sumalatha Polureddy<br>
> # Date 1394708875 -19800<br>
> # Node ID dae8674085419080a8bdfd102ed416621a23f164<br>
> # Parent 879151f659622ace9ddecec8d6e1a631849e2a04<br>
> psy-rd: ported hadamard_ac transform function to x265 for uniform blocksizes(8,16,32,64)<br>
><br>
> diff -r 879151f65962 -r dae867408541 source/common/pixel.cpp<br>
> --- a/source/common/pixel.cpp Thu Mar 13 03:25:06 2014 -0500<br>
> +++ b/source/common/pixel.cpp Thu Mar 13 16:37:55 2014 +0530<br>
> @@ -852,6 +852,70 @@<br>
> dst += dstStride;<br>
> }<br>
> }<br>
<br>
</div>these functions do not follow x265's white-space coding style<br>
<div><div class="h5"><br>
> +<br>
> +uint64_t pixel_hadamard_ac_8x8( pixel *pix, intptr_t stride )<br>
> +{<br>
> + sum2_t tmp[32];<br>
> + sum2_t a0, a1, a2, a3, dc;<br>
> + sum2_t sum4 = 0, sum8 = 0;<br>
> + for( int i = 0; i < 8; i++, pix+=stride )<br>
> + {<br>
> + sum2_t *t = tmp + (i&3) + (i&4)*4;<br>
> + a0 = (pix[0] + pix[1]) + ((sum2_t)(pix[0] - pix[1]) << BITS_PER_SUM);<br>
> + a1 = (pix[2] + pix[3]) + ((sum2_t)(pix[2] - pix[3]) << BITS_PER_SUM);<br>
> + t[0] = a0 + a1;<br>
> + t[4] = a0 - a1;<br>
> + a2 = (pix[4] + pix[5]) + ((sum2_t)(pix[4] - pix[5]) << BITS_PER_SUM);<br>
> + a3 = (pix[6] + pix[7]) + ((sum2_t)(pix[6] - pix[7]) << BITS_PER_SUM);<br>
> + t[8] = a2 + a3;<br>
> + t[12] = a2 - a3;<br>
> + }<br>
> + for( int i = 0; i < 8; i++ )<br>
> + {<br>
> + HADAMARD4(a0, a1, a2, a3, tmp[i * 4 + 0], tmp[i * 4 + 1], tmp[i * 4 + 2], tmp[i * 4 + 3]);<br>
> + tmp[i * 4 + 0] = a0;<br>
> + tmp[i * 4 + 1] = a1;<br>
> + tmp[i * 4 + 2] = a2;<br>
> + tmp[i * 4 + 3] = a3;<br>
> + sum4 += abs2(a0) + abs2(a1) + abs2(a2) + abs2(a3);<br>
> + }<br>
> + for( int i = 0; i < 8; i++ )<br>
> + {<br>
> + HADAMARD4(a0, a1, a2, a3, tmp[i], tmp[8 + i], tmp[16 + i], tmp[24 + i]);<br>
> + sum8 += abs2(a0) + abs2(a1) + abs2(a2) + abs2(a3);<br>
> + }<br>
> + dc = (sum_t)(tmp[0] + tmp[8] + tmp[16] + tmp[24]);<br>
> + sum4 = (sum_t)sum4 + (sum4 >> BITS_PER_SUM) - dc;<br>
> + sum8 = (sum_t)sum8 + (sum8 >> BITS_PER_SUM) - dc;<br>
> + return ((uint64_t)sum8 << 32) + sum4;<br>
> +}<br>
> +<br>
> +uint64_t pixel_hadamard_ac_16x16( pixel *pix, intptr_t stride )<br>
> +{<br>
> + uint64_t sum = pixel_hadamard_ac_8x8( pix, stride );<br>
> + sum += pixel_hadamard_ac_8x8( pix + 8, stride );<br>
> + sum += pixel_hadamard_ac_8x8( pix + 8 * stride, stride );<br>
> + sum += pixel_hadamard_ac_8x8( pix + 8 * stride + 8, stride );<br>
> + return ((sum >> 34) << 32) + ((uint32_t)sum >> 1);<br>
> +}<br>
> +uint64_t pixel_hadamard_ac_32x32( pixel *pix, intptr_t stride )<br>
> +{<br>
> + uint64_t sum = pixel_hadamard_ac_16x16( pix, stride );<br>
> + sum += pixel_hadamard_ac_16x16( pix + 16, stride );<br>
> + sum += pixel_hadamard_ac_16x16( pix + 16 * stride, stride );<br>
> + sum += pixel_hadamard_ac_16x16( pix + 16 * stride + 16, stride );<br>
> + return ((sum >> 34) << 32) + ((uint32_t)sum >> 1);<br>
> +}<br>
> +<br>
> +uint64_t pixel_hadamard_ac_64x64( pixel *pix, intptr_t stride )<br>
> +{<br>
> + uint64_t sum = pixel_hadamard_ac_32x32( pix, stride );<br>
> + sum += pixel_hadamard_ac_32x32( pix + 32, stride );<br>
> + sum += pixel_hadamard_ac_32x32( pix + 32 * stride, stride );<br>
> + sum += pixel_hadamard_ac_32x32( pix + 32 * stride + 16, stride );<br>
> + return ((sum >> 34) << 32) + ((uint32_t)sum >> 1);<br>
> +}<br>
> +<br>
> } // end anonymous namespace<br>
><br>
> namespace x265 {<br>
> @@ -1099,5 +1163,11 @@<br>
> p.var[BLOCK_32x32] = pixel_var<32>;<br>
> p.var[BLOCK_64x64] = pixel_var<64>;<br>
> p.plane_copy_deinterleave_c = plane_copy_deinterleave_chroma;<br>
> +<br>
> + p.pixel_hadamard_ac[LUMA_8x8] = pixel_hadamard_ac_8x8;<br>
> + p.pixel_hadamard_ac[LUMA_16x16] = pixel_hadamard_ac_16x16;<br>
> + p.pixel_hadamard_ac[LUMA_32x32] = pixel_hadamard_ac_32x32;<br>
> + p.pixel_hadamard_ac[LUMA_64x64] = pixel_hadamard_ac_64x64;<br>
> +<br>
> }<br>
> }<br>
> diff -r 879151f65962 -r dae867408541 source/common/primitives.h<br>
> --- a/source/common/primitives.h Thu Mar 13 03:25:06 2014 -0500<br>
> +++ b/source/common/primitives.h Thu Mar 13 16:37:55 2014 +0530<br>
> @@ -163,6 +163,7 @@<br>
> typedef void (*addAvg_t)(int16_t* src0, int16_t* src1, pixel* dst, intptr_t src0Stride, intptr_t src1Stride, intptr_t dstStride);<br>
><br>
> typedef void (*saoCuOrgE0_t)(pixel * rec, int8_t * offsetEo, int lcuWidth, int8_t signLeft);<br>
> +typedef uint64_t (*pixel_hadamard_ac_t)( pixel *pix, intptr_t stride );<br>
><br>
> /* Define a structure containing function pointers to optimized encoder<br>
> * primitives. Each pointer can reference either an assembly routine,<br>
> @@ -234,6 +235,8 @@<br>
> // sao primitives<br>
> saoCuOrgE0_t saoCuOrgE0;<br>
><br>
> + pixel_hadamard_ac_t pixel_hadamard_ac[NUM_LUMA_PARTITIONS];<br>
> +<br>
> struct<br>
> {<br>
> filter_pp_t filter_vpp[NUM_LUMA_PARTITIONS];<br>
</div></div>> _______________________________________________<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>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
Steve Borho<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>
</font></span></blockquote></div><br></div>