History

Fix a bug in vp9_highbd_iht8x8_64_add_neon

This bug was introduced in 29b6a30c. BUG=webm:1403

Linfeng Zhang committed 8 years ago

Commit d8424d21 parent 88dc0d63 files · +37 −160Browse files

Unified · Split

3 files
  1. test/dct_test.cc +0 −4
  2. vp9/common/arm/neon/vp9_highbd_iht8x8_add_neon.c +36 −155
  3. vp9/common/vp9_rtcd_defs.pl +1 −1
test/dct_test.cc+0−4
@@ -631,12 +631,8 @@ static const FuncInfo ht_neon_func_info[] = { · 630 unmodified lines
631#if CONFIG_VP9_HIGHBITDEPTH631#if CONFIG_VP9_HIGHBITDEPTH
632 { &vp9_highbd_fht4x4_c, &highbd_iht_wrapper<vp9_highbd_iht4x4_16_add_neon>, 4,632 { &vp9_highbd_fht4x4_c, &highbd_iht_wrapper<vp9_highbd_iht4x4_16_add_neon>, 4,
633 2 },633 2 },
634// TODO(linfengz): reenable these functions once test vector failures are
635// addressed.
636#if 0
637 { &vp9_highbd_fht8x8_c, &highbd_iht_wrapper<vp9_highbd_iht8x8_64_add_neon>, 8,634 { &vp9_highbd_fht8x8_c, &highbd_iht_wrapper<vp9_highbd_iht8x8_64_add_neon>, 8,
638 2 },635 2 },
639#endif
640#endif636#endif
641 { &vp9_fht4x4_c, &iht_wrapper<vp9_iht4x4_16_add_neon>, 4, 1 },637 { &vp9_fht4x4_c, &iht_wrapper<vp9_iht4x4_16_add_neon>, 4, 1 },
642 { &vp9_fht8x8_c, &iht_wrapper<vp9_iht8x8_64_add_neon>, 8, 1 },638 { &vp9_fht8x8_c, &iht_wrapper<vp9_iht8x8_64_add_neon>, 8, 1 },
vp9/common/arm/neon/vp9_highbd_iht8x8_add_neon.c+36−155
@@ -132,84 +132,10 @@ static INLINE int32x4_t sub_dct_const_round_shift_low_8_bd12( · 131 unmodified lines
132 return vcombine_s32(out_lo, out_hi);132 return vcombine_s32(out_lo, out_hi);
133}133}
134 134
135static INLINE void iadst8_bd10(int32x4_t *const io0, int32x4_t *const io1,135static INLINE void highbd_iadst8(int32x4_t *const io0, int32x4_t *const io1,
136 int32x4_t *const io2, int32x4_t *const io3,136 int32x4_t *const io2, int32x4_t *const io3,
137 int32x4_t *const io4, int32x4_t *const io5,137 int32x4_t *const io4, int32x4_t *const io5,
138 int32x4_t *const io6, int32x4_t *const io7) {138 int32x4_t *const io6, int32x4_t *const io7) {
139 const int32x4_t c0 =
140 create_s32x4_neon(cospi_2_64, cospi_30_64, cospi_10_64, cospi_22_64);
141 const int32x4_t c1 =
142 create_s32x4_neon(cospi_18_64, cospi_14_64, cospi_26_64, cospi_6_64);
143 const int32x4_t c2 =
144 create_s32x4_neon(cospi_16_64, 0, cospi_8_64, cospi_24_64);
145 int32x4_t x[8], t[4];
146 int32x4_t s[8];
147
148 x[0] = *io7;
149 x[1] = *io0;
150 x[2] = *io5;
151 x[3] = *io2;
152 x[4] = *io3;
153 x[5] = *io4;
154 x[6] = *io1;
155 x[7] = *io6;
156
157 // stage 1
158 iadst_butterfly_lane_0_1_bd10_neon(x[0], x[1], vget_low_s32(c0), &s[0],
159 &s[1]);
160 iadst_butterfly_lane_0_1_bd10_neon(x[2], x[3], vget_high_s32(c0), &s[2],
161 &s[3]);
162 iadst_butterfly_lane_0_1_bd10_neon(x[4], x[5], vget_low_s32(c1), &s[4],
163 &s[5]);
164 iadst_butterfly_lane_0_1_bd10_neon(x[6], x[7], vget_high_s32(c1), &s[6],
165 &s[7]);
166
167 x[0] = add_dct_const_round_shift_low_8_bd10(s[0], s[4]);
168 x[1] = add_dct_const_round_shift_low_8_bd10(s[1], s[5]);
169 x[2] = add_dct_const_round_shift_low_8_bd10(s[2], s[6]);
170 x[3] = add_dct_const_round_shift_low_8_bd10(s[3], s[7]);
171 x[4] = sub_dct_const_round_shift_low_8_bd10(s[0], s[4]);
172 x[5] = sub_dct_const_round_shift_low_8_bd10(s[1], s[5]);
173 x[6] = sub_dct_const_round_shift_low_8_bd10(s[2], s[6]);
174 x[7] = sub_dct_const_round_shift_low_8_bd10(s[3], s[7]);
175
176 // stage 2
177 t[0] = x[0];
178 t[1] = x[1];
179 t[2] = x[2];
180 t[3] = x[3];
181 iadst_butterfly_lane_0_1_bd10_neon(x[4], x[5], vget_high_s32(c2), &s[4],
182 &s[5]);
183 iadst_butterfly_lane_1_0_bd10_neon(x[7], x[6], vget_high_s32(c2), &s[7],
184 &s[6]);
185
186 x[0] = vaddq_s32(t[0], t[2]);
187 x[1] = vaddq_s32(t[1], t[3]);
188 x[2] = vsubq_s32(t[0], t[2]);
189 x[3] = vsubq_s32(t[1], t[3]);
190 x[4] = add_dct_const_round_shift_low_8_bd10(s[4], s[6]);
191 x[5] = add_dct_const_round_shift_low_8_bd10(s[5], s[7]);
192 x[6] = sub_dct_const_round_shift_low_8_bd10(s[4], s[6]);
193 x[7] = sub_dct_const_round_shift_low_8_bd10(s[5], s[7]);
194
195 // stage 3
196 iadst_half_butterfly_bd10_neon(x + 2, vget_low_s32(c2));
197 iadst_half_butterfly_bd10_neon(x + 6, vget_low_s32(c2));
198
199 *io0 = x[0];
200 *io1 = vnegq_s32(x[4]);
201 *io2 = x[6];
202 *io3 = vnegq_s32(x[2]);
203 *io4 = x[3];
204 *io5 = vnegq_s32(x[7]);
205 *io6 = x[5];
206 *io7 = vnegq_s32(x[1]);
207}
208
209static INLINE void iadst8_bd12(int32x4_t *const io0, int32x4_t *const io1,
210 int32x4_t *const io2, int32x4_t *const io3,
211 int32x4_t *const io4, int32x4_t *const io5,
212 int32x4_t *const io6, int32x4_t *const io7) {
213 const int32x4_t c0 =139 const int32x4_t c0 =
214 create_s32x4_neon(cospi_2_64, cospi_30_64, cospi_10_64, cospi_22_64);140 create_s32x4_neon(cospi_2_64, cospi_30_64, cospi_10_64, cospi_22_64);
215 const int32x4_t c1 =141 const int32x4_t c1 =
@@ -394,31 +320,17 @@ void vp9_highbd_iht8x8_64_add_neon(const tran_low_t *input, uint16_t *dest, · 178 unmodified lines
394 const int32x4_t cospis1 =320 const int32x4_t cospis1 =
395 vld1q_s32(kCospi32 + 4); // cospi 4, 12, 20, 28321 vld1q_s32(kCospi32 + 4); // cospi 4, 12, 20, 28
396 322
397 if (bd == 10) {323 idct8x8_64_half1d_bd12(cospis0, cospis1, &a[0], &a[1], &a[2], &a[3],
398 idct8x8_64_half1d_bd10(cospis0, cospis1, &a[0], &a[1], &a[2], &a[3],324 &a[4], &a[5], &a[6], &a[7]);
399 &a[4], &a[5], &a[6], &a[7]);325 idct8x8_64_half1d_bd12(cospis0, cospis1, &a[8], &a[9], &a[10], &a[11],
400 idct8x8_64_half1d_bd10(cospis0, cospis1, &a[8], &a[9], &a[10], &a[11],326 &a[12], &a[13], &a[14], &a[15]);
401 &a[12], &a[13], &a[14], &a[15]);327 transpose_s32_8x4(&a[0], &a[8], &a[1], &a[9], &a[2], &a[10], &a[3],
402 transpose_s32_8x4(&a[0], &a[8], &a[1], &a[9], &a[2], &a[10], &a[3],328 &a[11]);
403 &a[11]);329 highbd_iadst8(&a[0], &a[8], &a[1], &a[9], &a[2], &a[10], &a[3], &a[11]);
404 iadst8_bd10(&a[0], &a[8], &a[1], &a[9], &a[2], &a[10], &a[3], &a[11]);330 transpose_s32_8x4(&a[4], &a[12], &a[5], &a[13], &a[6], &a[14], &a[7],
405 transpose_s32_8x4(&a[4], &a[12], &a[5], &a[13], &a[6], &a[14], &a[7],331 &a[15]);
406 &a[15]);332 highbd_iadst8(&a[4], &a[12], &a[5], &a[13], &a[6], &a[14], &a[7],
407 iadst8_bd10(&a[4], &a[12], &a[5], &a[13], &a[6], &a[14], &a[7],
408 &a[15]);333 &a[15]);
409 } else {
410 idct8x8_64_half1d_bd12(cospis0, cospis1, &a[0], &a[1], &a[2], &a[3],
411 &a[4], &a[5], &a[6], &a[7]);
412 idct8x8_64_half1d_bd12(cospis0, cospis1, &a[8], &a[9], &a[10], &a[11],
413 &a[12], &a[13], &a[14], &a[15]);
414 transpose_s32_8x4(&a[0], &a[8], &a[1], &a[9], &a[2], &a[10], &a[3],
415 &a[11]);
416 iadst8_bd12(&a[0], &a[8], &a[1], &a[9], &a[2], &a[10], &a[3], &a[11]);
417 transpose_s32_8x4(&a[4], &a[12], &a[5], &a[13], &a[6], &a[14], &a[7],
418 &a[15]);
419 iadst8_bd12(&a[4], &a[12], &a[5], &a[13], &a[6], &a[14], &a[7],
420 &a[15]);
421 }
422 break;334 break;
423 }335 }
424 336
@@ -427,67 +339,36 @@ void vp9_highbd_iht8x8_64_add_neon(const tran_low_t *input, uint16_t *dest, · 2 unmodified lines
427 const int32x4_t cospis1 =339 const int32x4_t cospis1 =
428 vld1q_s32(kCospi32 + 4); // cospi 4, 12, 20, 28340 vld1q_s32(kCospi32 + 4); // cospi 4, 12, 20, 28
429 341
430 if (bd == 10) {342 transpose_s32_8x4(&a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6],
431 transpose_s32_8x4(&a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6],343 &a[7]);
432 &a[7]);344 highbd_iadst8(&a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6], &a[7]);
433 iadst8_bd10(&a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6], &a[7]);345 transpose_s32_8x4(&a[8], &a[9], &a[10], &a[11], &a[12], &a[13], &a[14],
434 transpose_s32_8x4(&a[8], &a[9], &a[10], &a[11], &a[12], &a[13],346 &a[15]);
435 &a[14], &a[15]);347 highbd_iadst8(&a[8], &a[9], &a[10], &a[11], &a[12], &a[13], &a[14],
436 iadst8_bd10(&a[8], &a[9], &a[10], &a[11], &a[12], &a[13], &a[14],
437 &a[15]);348 &a[15]);
438 idct8x8_64_half1d_bd10(cospis0, cospis1, &a[0], &a[8], &a[1], &a[9],349 idct8x8_64_half1d_bd12(cospis0, cospis1, &a[0], &a[8], &a[1], &a[9],
439 &a[2], &a[10], &a[3], &a[11]);350 &a[2], &a[10], &a[3], &a[11]);
440 idct8x8_64_half1d_bd10(cospis0, cospis1, &a[4], &a[12], &a[5], &a[13],351 idct8x8_64_half1d_bd12(cospis0, cospis1, &a[4], &a[12], &a[5], &a[13],
441 &a[6], &a[14], &a[7], &a[15]);352 &a[6], &a[14], &a[7], &a[15]);
442 } else {
443 transpose_s32_8x4(&a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6],
444 &a[7]);
445 iadst8_bd12(&a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6], &a[7]);
446 transpose_s32_8x4(&a[8], &a[9], &a[10], &a[11], &a[12], &a[13],
447 &a[14], &a[15]);
448 iadst8_bd12(&a[8], &a[9], &a[10], &a[11], &a[12], &a[13], &a[14],
449 &a[15]);
450 idct8x8_64_half1d_bd12(cospis0, cospis1, &a[0], &a[8], &a[1], &a[9],
451 &a[2], &a[10], &a[3], &a[11]);
452 idct8x8_64_half1d_bd12(cospis0, cospis1, &a[4], &a[12], &a[5], &a[13],
453 &a[6], &a[14], &a[7], &a[15]);
454 }
455 break;353 break;
456 }354 }
457 355
458 default: {356 default: {
459 assert(tx_type == ADST_ADST);357 assert(tx_type == ADST_ADST);
460 if (bd == 10) {358 transpose_s32_8x4(&a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6],
461 transpose_s32_8x4(&a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6],359 &a[7]);
462 &a[7]);360 highbd_iadst8(&a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6], &a[7]);
463 iadst8_bd10(&a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6], &a[7]);361 transpose_s32_8x4(&a[8], &a[9], &a[10], &a[11], &a[12], &a[13], &a[14],
464 transpose_s32_8x4(&a[8], &a[9], &a[10], &a[11], &a[12], &a[13],362 &a[15]);
465 &a[14], &a[15]);363 highbd_iadst8(&a[8], &a[9], &a[10], &a[11], &a[12], &a[13], &a[14],
466 iadst8_bd10(&a[8], &a[9], &a[10], &a[11], &a[12], &a[13], &a[14],
467 &a[15]);364 &a[15]);
468 transpose_s32_8x4(&a[0], &a[8], &a[1], &a[9], &a[2], &a[10], &a[3],365 transpose_s32_8x4(&a[0], &a[8], &a[1], &a[9], &a[2], &a[10], &a[3],
469 &a[11]);366 &a[11]);
470 iadst8_bd10(&a[0], &a[8], &a[1], &a[9], &a[2], &a[10], &a[3], &a[11]);367 highbd_iadst8(&a[0], &a[8], &a[1], &a[9], &a[2], &a[10], &a[3], &a[11]);
471 transpose_s32_8x4(&a[4], &a[12], &a[5], &a[13], &a[6], &a[14], &a[7],368 transpose_s32_8x4(&a[4], &a[12], &a[5], &a[13], &a[6], &a[14], &a[7],
472 &a[15]);369 &a[15]);
473 iadst8_bd10(&a[4], &a[12], &a[5], &a[13], &a[6], &a[14], &a[7],370 highbd_iadst8(&a[4], &a[12], &a[5], &a[13], &a[6], &a[14], &a[7],
474 &a[15]);371 &a[15]);
475 } else {
476 transpose_s32_8x4(&a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6],
477 &a[7]);
478 iadst8_bd12(&a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6], &a[7]);
479 transpose_s32_8x4(&a[8], &a[9], &a[10], &a[11], &a[12], &a[13],
480 &a[14], &a[15]);
481 iadst8_bd12(&a[8], &a[9], &a[10], &a[11], &a[12], &a[13], &a[14],
482 &a[15]);
483 transpose_s32_8x4(&a[0], &a[8], &a[1], &a[9], &a[2], &a[10], &a[3],
484 &a[11]);
485 iadst8_bd12(&a[0], &a[8], &a[1], &a[9], &a[2], &a[10], &a[3], &a[11]);
486 transpose_s32_8x4(&a[4], &a[12], &a[5], &a[13], &a[6], &a[14], &a[7],
487 &a[15]);
488 iadst8_bd12(&a[4], &a[12], &a[5], &a[13], &a[6], &a[14], &a[7],
489 &a[15]);
490 }
491 break;372 break;
492 }373 }
493 }374 }
vp9/common/vp9_rtcd_defs.pl+1−1
@@ -104,7 +104,7 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") { · 103 unmodified lines
104 104
105 if (vpx_config("CONFIG_EMULATE_HARDWARE") ne "yes") {105 if (vpx_config("CONFIG_EMULATE_HARDWARE") ne "yes") {
106 specialize qw/vp9_highbd_iht4x4_16_add neon sse4_1/;106 specialize qw/vp9_highbd_iht4x4_16_add neon sse4_1/;
107 specialize qw/vp9_highbd_iht8x8_64_add sse4_1/;107 specialize qw/vp9_highbd_iht8x8_64_add neon sse4_1/;
108 specialize qw/vp9_highbd_iht16x16_256_add sse4_1/;108 specialize qw/vp9_highbd_iht16x16_256_add sse4_1/;
109 }109 }
110}110}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t