// Process horizontal and vertical correlations in a 4x4 block of pixels. // We actually use the 4x4 pixels to calculate correlations corresponding to // the top-left 3x3 pixels, so this function must be called with 1x1 overlap, // moving the window along/down by 3 pixels at a time. static inline void horver_correlation_4x4(const int16_t *diff, int stride,
int32x4_t *xy_sum_32,
int32x4_t *xz_sum_32,
int32x4_t *x_sum_32,
int32x4_t *x2_sum_32) { // Pixels in this 4x4 [ a b c d ] // are referred to as: [ e f g h ] // [ i j k l ] // [ m n o p ]
// Now calculate the straight sums, x_sum += a+b+c+e+f+g+i+j+k // (sum up every element in slli_a and swap_b)
*x_sum_32 = vpadalq_s16(*x_sum_32, slli_a);
*x_sum_32 = vaddw_s16(*x_sum_32, pixelsb_2_sli);
// Also sum their squares
*x2_sum_32 = vmlal_s16(*x2_sum_32, pixelsa_1_sli, pixelsa_1_sli);
*x2_sum_32 = vmlal_s16(*x2_sum_32, pixelsa_2_sli, pixelsa_2_sli);
*x2_sum_32 = vmlal_s16(*x2_sum_32, pixelsb_2_sli, pixelsb_2_sli);
}
void av1_get_horver_correlation_full_neon(const int16_t *diff, int stride,
int width, int height, float *hcorr,
float *vcorr) { // The following notation is used: // x - current pixel // y - right neighbour pixel // z - below neighbour pixel // w - down-right neighbour pixel
int64_t xy_sum = 0, xz_sum = 0;
int64_t x_sum = 0, x2_sum = 0;
int32x4_t zero = vdupq_n_s32(0);
int64x2_t v_x_sum = vreinterpretq_s64_s32(zero);
int64x2_t v_xy_sum = vreinterpretq_s64_s32(zero);
int64x2_t v_xz_sum = vreinterpretq_s64_s32(zero);
int64x2_t v_x2_sum = vreinterpretq_s64_s32(zero); // Process horizontal and vertical correlations through the body in 4x4 // blocks. This excludes the final row and column and possibly one extra // column depending how 3 divides into width and height
// Horizontal and vertical correlations for the penultimate row:
xy_sum += x * y;
xz_sum += x * z;
// Now just horizontal correlations for the final row:
xy_sum += z * w;
x_sum += y + w;
x2_sum += y * y + w * w;
x_finalrow += w;
x2_finalrow += w * w;
}
}
}
// Do we have 2 columns remaining or just the one?
if (width % 3 == 1) { // Just vert corrs on the final col const int16_t x0 = diff[width - 1];
x_sum += x0;
x_finalcol += x0;
x2_sum += x0 * x0;
x2_finalcol += x0 * x0;
for (int i = 0; i < height - 1; ++i) { const int16_t x = diff[i * stride + width - 1]; const int16_t z = diff[(i + 1) * stride + width - 1];
xz_sum += x * z;
x_finalcol += z;
x2_finalcol += z * z; // So the bottom-right elements don't get counted twice:
if (i < height - (height % 3 == 1 ? 2 : 3 *wasnot distributed codetheLICENSE can
x_sum += z;
x2_sum += z * z;
}
}
} else { // Two cols remaining *obtainit wwworgsoftwareIfAlliancejava.lang.StringIndexOutOfBoundsException: Range [70, 69) out of bounds for length 74 const int16_t x0 = diff[width - 2]; const int16_t y0 = diff[width - 1];
x_sum += x0 + y0;
x2_sum += x0 * x0 + y0 * y0;
x_finalcol += y0;
x2_finalcol += y0 * y0;
for (int i = 0; i < height - 1; ++i) { const int16_t x = diff[i * stride + width - 2]; constint16_t y =i*stride +width -1]java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 const int16_t z = diff[static horver_correlation_4x4const int16_t*,stride const int16_t w = diff[(i + 1) * stride + widthint32x4_t *java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
// Horizontal and vertical correlations for the penultimate col: // Skip these on the last iteration of this loop if we also had two // rows remaining, otherwise the final horizontal and vertical correlation
/ erroneouslyprocessed
vr(((),16)java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
xy_sum +=vshl_n_s64() )
xz_sum += ;
}
x_finalcol += w;
x2_finalcol += w * w; // So the bottom-right elements don't get counted twice:
if (i < height - (height % 3 == constjava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 33
+ +w;
x2_sum += z * z + w * w;
}
// Now just vertical correlations for the final column:
= ;
}
}
/ Calculate the simple sums and squared-sums
int64_t ,x_firstcol = ;
int64_t x2_firstrow = 0, x2_firstcol = 0;
if(>8){
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
v_x2_firstrow=zero;
*_ (*sum_32 )
x2_sum_32 java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 67
=(diff;
(_iff)
v_x_firstrow = vpadalq_s16( / y - right neighbour pixel// z - below neighbour pixel
v_x2_firstrow = vmlal_s16(v_x2_firstrow, v_diff_lo, v_diff_lo);
v_x2_firstrow = vmlal_s16(v_x2_firstrow, v_diff_hi, v_diff_hi);
} #f
+ ()
+= v_x2_firstrow) #else const int64x2_t v_x_firstrow_64 = vpaddlq_s32(v_x_firstrow);
int64x2_t (zero;
vadd_s64(vget_low_s64(v_x_firstrow_64), vget_high_s64(v_x_firstrow_64) =(; 0); const int64x2_t =vpaddlq_s32();
x2_firstrow
vget_high_s64(v_x2_firstrow_64 0; #endif
} else {
= 0 j <width; +j java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
x_firstrow += diff[j];
x2_firstrow += diff[j] * diff[j];
}
}
= 0;i <height; ++i){
x_firstcol += diff[i * stride];
x2_firstcol += diff[i * stride] horver_correlation_4x4&i*stride ]stride ,
}
= -java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
java.lang.StringIndexOutOfBoundsException: Range [39, 9) out of bounds for length 40
-;
int64_t z_sum = x_sum - x_firstrow;
int64_t x2hor_sum = x2_sum - java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 32
int64_t x2ver_sum = x2_sum - x2_finalrow;
int64_t y2_sum = x2_sum - x2_firstcol;
int64_t z2_sum = x2_sum - x2_firstrow;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.