Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(670)

Side by Side Diff: source/scale_msa.cc

Issue 2675583002: Fix dspr2 rename changes. Fix unused variables (Closed)
Patch Set: scale unused vars for msa removed Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/libyuv/version.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 The LibYuv Project Authors. All rights reserved. 2 * Copyright 2016 The LibYuv Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 216 }
217 217
218 void ScaleRowDown2Box_MSA(const uint8_t* src_ptr, 218 void ScaleRowDown2Box_MSA(const uint8_t* src_ptr,
219 ptrdiff_t src_stride, 219 ptrdiff_t src_stride,
220 uint8_t* dst, 220 uint8_t* dst,
221 int dst_width) { 221 int dst_width) {
222 int x; 222 int x;
223 const uint8_t* s = src_ptr; 223 const uint8_t* s = src_ptr;
224 const uint8_t* t = src_ptr + src_stride; 224 const uint8_t* t = src_ptr + src_stride;
225 v16u8 src0, src1, src2, src3, src4, src5, src6, src7, dst0, dst1; 225 v16u8 src0, src1, src2, src3, src4, src5, src6, src7, dst0, dst1;
226 v8u16 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; 226 v8u16 vec0, vec1, vec2, vec3;
227 227
228 for (x = 0; x < dst_width; x += 32) { 228 for (x = 0; x < dst_width; x += 32) {
229 src0 = (v16u8)__msa_ld_b((v16i8*)s, 0); 229 src0 = (v16u8)__msa_ld_b((v16i8*)s, 0);
230 src1 = (v16u8)__msa_ld_b((v16i8*)s, 16); 230 src1 = (v16u8)__msa_ld_b((v16i8*)s, 16);
231 src2 = (v16u8)__msa_ld_b((v16i8*)s, 32); 231 src2 = (v16u8)__msa_ld_b((v16i8*)s, 32);
232 src3 = (v16u8)__msa_ld_b((v16i8*)s, 48); 232 src3 = (v16u8)__msa_ld_b((v16i8*)s, 48);
233 src4 = (v16u8)__msa_ld_b((v16i8*)t, 0); 233 src4 = (v16u8)__msa_ld_b((v16i8*)t, 0);
234 src5 = (v16u8)__msa_ld_b((v16i8*)t, 16); 234 src5 = (v16u8)__msa_ld_b((v16i8*)t, 16);
235 src6 = (v16u8)__msa_ld_b((v16i8*)t, 32); 235 src6 = (v16u8)__msa_ld_b((v16i8*)t, 32);
236 src7 = (v16u8)__msa_ld_b((v16i8*)t, 48); 236 src7 = (v16u8)__msa_ld_b((v16i8*)t, 48);
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 s += 32; 514 s += 32;
515 t0 += 32; 515 t0 += 32;
516 t1 += 32; 516 t1 += 32;
517 dst_ptr += 12; 517 dst_ptr += 12;
518 } 518 }
519 } 519 }
520 520
521 void ScaleAddRow_MSA(const uint8_t* src_ptr, uint16_t* dst_ptr, int src_width) { 521 void ScaleAddRow_MSA(const uint8_t* src_ptr, uint16_t* dst_ptr, int src_width) {
522 int x; 522 int x;
523 v16u8 src0; 523 v16u8 src0;
524 v8u16 vec0, vec1, dst0, dst1; 524 v8u16 dst0, dst1;
525 v16i8 zero = {0}; 525 v16i8 zero = {0};
526 526
527 assert(src_width > 0); 527 assert(src_width > 0);
528 528
529 for (x = 0; x < src_width; x += 16) { 529 for (x = 0; x < src_width; x += 16) {
530 src0 = LD_UB(src_ptr); 530 src0 = LD_UB(src_ptr);
531 dst0 = (v8u16)__msa_ld_h((v8i16*)dst_ptr, 0); 531 dst0 = (v8u16)__msa_ld_h((v8i16*)dst_ptr, 0);
532 dst1 = (v8u16)__msa_ld_h((v8i16*)dst_ptr, 16); 532 dst1 = (v8u16)__msa_ld_h((v8i16*)dst_ptr, 16);
533 dst0 += (v8u16)__msa_ilvr_b(zero, (v16i8)src0); 533 dst0 += (v8u16)__msa_ilvr_b(zero, (v16i8)src0);
534 dst1 += (v8u16)__msa_ilvl_b(zero, (v16i8)src0); 534 dst1 += (v8u16)__msa_ilvl_b(zero, (v16i8)src0);
535 ST_UH2(dst0, dst1, dst_ptr, 8); 535 ST_UH2(dst0, dst1, dst_ptr, 8);
536 src_ptr += 16; 536 src_ptr += 16;
537 dst_ptr += 16; 537 dst_ptr += 16;
538 } 538 }
539 } 539 }
540 540
541 #ifdef __cplusplus 541 #ifdef __cplusplus
542 } // extern "C" 542 } // extern "C"
543 } // namespace libyuv 543 } // namespace libyuv
544 #endif 544 #endif
545 545
546 #endif // !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa) 546 #endif // !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa)
OLDNEW
« no previous file with comments | « include/libyuv/version.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698