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

Side by Side Diff: source/libvpx/vp9/encoder/vp9_variance.c

Issue 232133009: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2010 The WebM 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 uint8_t temp2[68 * 64]; 209 uint8_t temp2[68 * 64];
210 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 64 * 64); // compound pred buffer 210 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 64 * 64); // compound pred buffer
211 const int16_t *hfilter, *vfilter; 211 const int16_t *hfilter, *vfilter;
212 212
213 hfilter = BILINEAR_FILTERS_2TAP(xoffset); 213 hfilter = BILINEAR_FILTERS_2TAP(xoffset);
214 vfilter = BILINEAR_FILTERS_2TAP(yoffset); 214 vfilter = BILINEAR_FILTERS_2TAP(yoffset);
215 215
216 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line, 216 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
217 1, 33, 64, hfilter); 217 1, 33, 64, hfilter);
218 var_filter_block2d_bil_second_pass(fdata3, temp2, 64, 64, 32, 64, vfilter); 218 var_filter_block2d_bil_second_pass(fdata3, temp2, 64, 64, 32, 64, vfilter);
219 comp_avg_pred(temp3, second_pred, 64, 32, temp2, 64); 219 vp9_comp_avg_pred(temp3, second_pred, 64, 32, temp2, 64);
220 return vp9_variance64x32(temp3, 64, dst_ptr, dst_pixels_per_line, sse); 220 return vp9_variance64x32(temp3, 64, dst_ptr, dst_pixels_per_line, sse);
221 } 221 }
222 222
223 unsigned int vp9_variance32x64_c(const uint8_t *src_ptr, 223 unsigned int vp9_variance32x64_c(const uint8_t *src_ptr,
224 int source_stride, 224 int source_stride,
225 const uint8_t *ref_ptr, 225 const uint8_t *ref_ptr,
226 int recon_stride, 226 int recon_stride,
227 unsigned int *sse) { 227 unsigned int *sse) {
228 unsigned int var; 228 unsigned int var;
229 int avg; 229 int avg;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 uint8_t temp2[68 * 64]; 266 uint8_t temp2[68 * 64];
267 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 32 * 64); // compound pred buffer 267 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 32 * 64); // compound pred buffer
268 const int16_t *hfilter, *vfilter; 268 const int16_t *hfilter, *vfilter;
269 269
270 hfilter = BILINEAR_FILTERS_2TAP(xoffset); 270 hfilter = BILINEAR_FILTERS_2TAP(xoffset);
271 vfilter = BILINEAR_FILTERS_2TAP(yoffset); 271 vfilter = BILINEAR_FILTERS_2TAP(yoffset);
272 272
273 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line, 273 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
274 1, 65, 32, hfilter); 274 1, 65, 32, hfilter);
275 var_filter_block2d_bil_second_pass(fdata3, temp2, 32, 32, 64, 32, vfilter); 275 var_filter_block2d_bil_second_pass(fdata3, temp2, 32, 32, 64, 32, vfilter);
276 comp_avg_pred(temp3, second_pred, 32, 64, temp2, 32); 276 vp9_comp_avg_pred(temp3, second_pred, 32, 64, temp2, 32);
277 return vp9_variance32x64(temp3, 32, dst_ptr, dst_pixels_per_line, sse); 277 return vp9_variance32x64(temp3, 32, dst_ptr, dst_pixels_per_line, sse);
278 } 278 }
279 279
280 unsigned int vp9_variance32x16_c(const uint8_t *src_ptr, 280 unsigned int vp9_variance32x16_c(const uint8_t *src_ptr,
281 int source_stride, 281 int source_stride,
282 const uint8_t *ref_ptr, 282 const uint8_t *ref_ptr,
283 int recon_stride, 283 int recon_stride,
284 unsigned int *sse) { 284 unsigned int *sse) {
285 unsigned int var; 285 unsigned int var;
286 int avg; 286 int avg;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 uint8_t temp2[36 * 32]; 323 uint8_t temp2[36 * 32];
324 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 32 * 16); // compound pred buffer 324 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 32 * 16); // compound pred buffer
325 const int16_t *hfilter, *vfilter; 325 const int16_t *hfilter, *vfilter;
326 326
327 hfilter = BILINEAR_FILTERS_2TAP(xoffset); 327 hfilter = BILINEAR_FILTERS_2TAP(xoffset);
328 vfilter = BILINEAR_FILTERS_2TAP(yoffset); 328 vfilter = BILINEAR_FILTERS_2TAP(yoffset);
329 329
330 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line, 330 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
331 1, 17, 32, hfilter); 331 1, 17, 32, hfilter);
332 var_filter_block2d_bil_second_pass(fdata3, temp2, 32, 32, 16, 32, vfilter); 332 var_filter_block2d_bil_second_pass(fdata3, temp2, 32, 32, 16, 32, vfilter);
333 comp_avg_pred(temp3, second_pred, 32, 16, temp2, 32); 333 vp9_comp_avg_pred(temp3, second_pred, 32, 16, temp2, 32);
334 return vp9_variance32x16(temp3, 32, dst_ptr, dst_pixels_per_line, sse); 334 return vp9_variance32x16(temp3, 32, dst_ptr, dst_pixels_per_line, sse);
335 } 335 }
336 336
337 unsigned int vp9_variance16x32_c(const uint8_t *src_ptr, 337 unsigned int vp9_variance16x32_c(const uint8_t *src_ptr,
338 int source_stride, 338 int source_stride,
339 const uint8_t *ref_ptr, 339 const uint8_t *ref_ptr,
340 int recon_stride, 340 int recon_stride,
341 unsigned int *sse) { 341 unsigned int *sse) {
342 unsigned int var; 342 unsigned int var;
343 int avg; 343 int avg;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 uint8_t temp2[36 * 32]; 380 uint8_t temp2[36 * 32];
381 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 16 * 32); // compound pred buffer 381 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 16 * 32); // compound pred buffer
382 const int16_t *hfilter, *vfilter; 382 const int16_t *hfilter, *vfilter;
383 383
384 hfilter = BILINEAR_FILTERS_2TAP(xoffset); 384 hfilter = BILINEAR_FILTERS_2TAP(xoffset);
385 vfilter = BILINEAR_FILTERS_2TAP(yoffset); 385 vfilter = BILINEAR_FILTERS_2TAP(yoffset);
386 386
387 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line, 387 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
388 1, 33, 16, hfilter); 388 1, 33, 16, hfilter);
389 var_filter_block2d_bil_second_pass(fdata3, temp2, 16, 16, 32, 16, vfilter); 389 var_filter_block2d_bil_second_pass(fdata3, temp2, 16, 16, 32, 16, vfilter);
390 comp_avg_pred(temp3, second_pred, 16, 32, temp2, 16); 390 vp9_comp_avg_pred(temp3, second_pred, 16, 32, temp2, 16);
391 return vp9_variance16x32(temp3, 16, dst_ptr, dst_pixels_per_line, sse); 391 return vp9_variance16x32(temp3, 16, dst_ptr, dst_pixels_per_line, sse);
392 } 392 }
393 393
394 unsigned int vp9_variance64x64_c(const uint8_t *src_ptr, 394 unsigned int vp9_variance64x64_c(const uint8_t *src_ptr,
395 int source_stride, 395 int source_stride,
396 const uint8_t *ref_ptr, 396 const uint8_t *ref_ptr,
397 int recon_stride, 397 int recon_stride,
398 unsigned int *sse) { 398 unsigned int *sse) {
399 unsigned int var; 399 unsigned int var;
400 int avg; 400 int avg;
401 401
402 variance(src_ptr, source_stride, ref_ptr, recon_stride, 64, 64, &var, &avg); 402 variance(src_ptr, source_stride, ref_ptr, recon_stride, 64, 64, &var, &avg);
403 *sse = var; 403 *sse = var;
404 return (var - (((int64_t)avg * avg) >> 12)); 404 return (var - (((int64_t)avg * avg) >> 12));
405 } 405 }
406 406
407 unsigned int vp9_variance32x32_c(const uint8_t *src_ptr, 407 unsigned int vp9_variance32x32_c(const uint8_t *src_ptr,
408 int source_stride, 408 int source_stride,
409 const uint8_t *ref_ptr, 409 const uint8_t *ref_ptr,
410 int recon_stride, 410 int recon_stride,
411 unsigned int *sse) { 411 unsigned int *sse) {
412 unsigned int var; 412 unsigned int var;
413 int avg; 413 int avg;
414 414
415 variance(src_ptr, source_stride, ref_ptr, recon_stride, 32, 32, &var, &avg); 415 variance(src_ptr, source_stride, ref_ptr, recon_stride, 32, 32, &var, &avg);
416 *sse = var; 416 *sse = var;
417 return (var - (((int64_t)avg * avg) >> 10)); 417 return (var - (((int64_t)avg * avg) >> 10));
418 } 418 }
419 419
420 void vp9_get_sse_sum_16x16_c(const uint8_t *src_ptr, int source_stride,
421 const uint8_t *ref_ptr, int ref_stride,
422 unsigned int *sse, int *sum) {
423 variance(src_ptr, source_stride, ref_ptr, ref_stride, 16, 16, sse, sum);
424 }
425
420 unsigned int vp9_variance16x16_c(const uint8_t *src_ptr, 426 unsigned int vp9_variance16x16_c(const uint8_t *src_ptr,
421 int source_stride, 427 int source_stride,
422 const uint8_t *ref_ptr, 428 const uint8_t *ref_ptr,
423 int recon_stride, 429 int recon_stride,
424 unsigned int *sse) { 430 unsigned int *sse) {
425 unsigned int var; 431 unsigned int var;
426 int avg; 432 int avg;
427 433
428 variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 16, &var, &avg); 434 variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 16, &var, &avg);
429 *sse = var; 435 *sse = var;
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 613
608 hfilter = BILINEAR_FILTERS_2TAP(xoffset); 614 hfilter = BILINEAR_FILTERS_2TAP(xoffset);
609 vfilter = BILINEAR_FILTERS_2TAP(yoffset); 615 vfilter = BILINEAR_FILTERS_2TAP(yoffset);
610 616
611 // First filter 1d Horizontal 617 // First filter 1d Horizontal
612 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line, 618 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
613 1, 5, 4, hfilter); 619 1, 5, 4, hfilter);
614 620
615 // Now filter Verticaly 621 // Now filter Verticaly
616 var_filter_block2d_bil_second_pass(fdata3, temp2, 4, 4, 4, 4, vfilter); 622 var_filter_block2d_bil_second_pass(fdata3, temp2, 4, 4, 4, 4, vfilter);
617 comp_avg_pred(temp3, second_pred, 4, 4, temp2, 4); 623 vp9_comp_avg_pred(temp3, second_pred, 4, 4, temp2, 4);
618 return vp9_variance4x4(temp3, 4, dst_ptr, dst_pixels_per_line, sse); 624 return vp9_variance4x4(temp3, 4, dst_ptr, dst_pixels_per_line, sse);
619 } 625 }
620 626
621 unsigned int vp9_sub_pixel_variance8x8_c(const uint8_t *src_ptr, 627 unsigned int vp9_sub_pixel_variance8x8_c(const uint8_t *src_ptr,
622 int src_pixels_per_line, 628 int src_pixels_per_line,
623 int xoffset, 629 int xoffset,
624 int yoffset, 630 int yoffset,
625 const uint8_t *dst_ptr, 631 const uint8_t *dst_ptr,
626 int dst_pixels_per_line, 632 int dst_pixels_per_line,
627 unsigned int *sse) { 633 unsigned int *sse) {
(...skipping 23 matching lines...) Expand all
651 uint8_t temp2[20 * 16]; 657 uint8_t temp2[20 * 16];
652 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 8 * 8); // compound pred buffer 658 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 8 * 8); // compound pred buffer
653 const int16_t *hfilter, *vfilter; 659 const int16_t *hfilter, *vfilter;
654 660
655 hfilter = BILINEAR_FILTERS_2TAP(xoffset); 661 hfilter = BILINEAR_FILTERS_2TAP(xoffset);
656 vfilter = BILINEAR_FILTERS_2TAP(yoffset); 662 vfilter = BILINEAR_FILTERS_2TAP(yoffset);
657 663
658 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line, 664 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
659 1, 9, 8, hfilter); 665 1, 9, 8, hfilter);
660 var_filter_block2d_bil_second_pass(fdata3, temp2, 8, 8, 8, 8, vfilter); 666 var_filter_block2d_bil_second_pass(fdata3, temp2, 8, 8, 8, 8, vfilter);
661 comp_avg_pred(temp3, second_pred, 8, 8, temp2, 8); 667 vp9_comp_avg_pred(temp3, second_pred, 8, 8, temp2, 8);
662 return vp9_variance8x8(temp3, 8, dst_ptr, dst_pixels_per_line, sse); 668 return vp9_variance8x8(temp3, 8, dst_ptr, dst_pixels_per_line, sse);
663 } 669 }
664 670
665 unsigned int vp9_sub_pixel_variance16x16_c(const uint8_t *src_ptr, 671 unsigned int vp9_sub_pixel_variance16x16_c(const uint8_t *src_ptr,
666 int src_pixels_per_line, 672 int src_pixels_per_line,
667 int xoffset, 673 int xoffset,
668 int yoffset, 674 int yoffset,
669 const uint8_t *dst_ptr, 675 const uint8_t *dst_ptr,
670 int dst_pixels_per_line, 676 int dst_pixels_per_line,
671 unsigned int *sse) { 677 unsigned int *sse) {
(...skipping 24 matching lines...) Expand all
696 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 16 * 16); // compound pred buffer 702 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 16 * 16); // compound pred buffer
697 const int16_t *hfilter, *vfilter; 703 const int16_t *hfilter, *vfilter;
698 704
699 hfilter = BILINEAR_FILTERS_2TAP(xoffset); 705 hfilter = BILINEAR_FILTERS_2TAP(xoffset);
700 vfilter = BILINEAR_FILTERS_2TAP(yoffset); 706 vfilter = BILINEAR_FILTERS_2TAP(yoffset);
701 707
702 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line, 708 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
703 1, 17, 16, hfilter); 709 1, 17, 16, hfilter);
704 var_filter_block2d_bil_second_pass(fdata3, temp2, 16, 16, 16, 16, vfilter); 710 var_filter_block2d_bil_second_pass(fdata3, temp2, 16, 16, 16, 16, vfilter);
705 711
706 comp_avg_pred(temp3, second_pred, 16, 16, temp2, 16); 712 vp9_comp_avg_pred(temp3, second_pred, 16, 16, temp2, 16);
707 return vp9_variance16x16(temp3, 16, dst_ptr, dst_pixels_per_line, sse); 713 return vp9_variance16x16(temp3, 16, dst_ptr, dst_pixels_per_line, sse);
708 } 714 }
709 715
710 unsigned int vp9_sub_pixel_variance64x64_c(const uint8_t *src_ptr, 716 unsigned int vp9_sub_pixel_variance64x64_c(const uint8_t *src_ptr,
711 int src_pixels_per_line, 717 int src_pixels_per_line,
712 int xoffset, 718 int xoffset,
713 int yoffset, 719 int yoffset,
714 const uint8_t *dst_ptr, 720 const uint8_t *dst_ptr,
715 int dst_pixels_per_line, 721 int dst_pixels_per_line,
716 unsigned int *sse) { 722 unsigned int *sse) {
(...skipping 23 matching lines...) Expand all
740 uint8_t temp2[68 * 64]; 746 uint8_t temp2[68 * 64];
741 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 64 * 64); // compound pred buffer 747 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 64 * 64); // compound pred buffer
742 const int16_t *hfilter, *vfilter; 748 const int16_t *hfilter, *vfilter;
743 749
744 hfilter = BILINEAR_FILTERS_2TAP(xoffset); 750 hfilter = BILINEAR_FILTERS_2TAP(xoffset);
745 vfilter = BILINEAR_FILTERS_2TAP(yoffset); 751 vfilter = BILINEAR_FILTERS_2TAP(yoffset);
746 752
747 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line, 753 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
748 1, 65, 64, hfilter); 754 1, 65, 64, hfilter);
749 var_filter_block2d_bil_second_pass(fdata3, temp2, 64, 64, 64, 64, vfilter); 755 var_filter_block2d_bil_second_pass(fdata3, temp2, 64, 64, 64, 64, vfilter);
750 comp_avg_pred(temp3, second_pred, 64, 64, temp2, 64); 756 vp9_comp_avg_pred(temp3, second_pred, 64, 64, temp2, 64);
751 return vp9_variance64x64(temp3, 64, dst_ptr, dst_pixels_per_line, sse); 757 return vp9_variance64x64(temp3, 64, dst_ptr, dst_pixels_per_line, sse);
752 } 758 }
753 759
754 unsigned int vp9_sub_pixel_variance32x32_c(const uint8_t *src_ptr, 760 unsigned int vp9_sub_pixel_variance32x32_c(const uint8_t *src_ptr,
755 int src_pixels_per_line, 761 int src_pixels_per_line,
756 int xoffset, 762 int xoffset,
757 int yoffset, 763 int yoffset,
758 const uint8_t *dst_ptr, 764 const uint8_t *dst_ptr,
759 int dst_pixels_per_line, 765 int dst_pixels_per_line,
760 unsigned int *sse) { 766 unsigned int *sse) {
(...skipping 23 matching lines...) Expand all
784 uint8_t temp2[36 * 32]; 790 uint8_t temp2[36 * 32];
785 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 32 * 32); // compound pred buffer 791 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 32 * 32); // compound pred buffer
786 const int16_t *hfilter, *vfilter; 792 const int16_t *hfilter, *vfilter;
787 793
788 hfilter = BILINEAR_FILTERS_2TAP(xoffset); 794 hfilter = BILINEAR_FILTERS_2TAP(xoffset);
789 vfilter = BILINEAR_FILTERS_2TAP(yoffset); 795 vfilter = BILINEAR_FILTERS_2TAP(yoffset);
790 796
791 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line, 797 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
792 1, 33, 32, hfilter); 798 1, 33, 32, hfilter);
793 var_filter_block2d_bil_second_pass(fdata3, temp2, 32, 32, 32, 32, vfilter); 799 var_filter_block2d_bil_second_pass(fdata3, temp2, 32, 32, 32, 32, vfilter);
794 comp_avg_pred(temp3, second_pred, 32, 32, temp2, 32); 800 vp9_comp_avg_pred(temp3, second_pred, 32, 32, temp2, 32);
795 return vp9_variance32x32(temp3, 32, dst_ptr, dst_pixels_per_line, sse); 801 return vp9_variance32x32(temp3, 32, dst_ptr, dst_pixels_per_line, sse);
796 } 802 }
797 803
798 unsigned int vp9_variance_halfpixvar16x16_h_c(const uint8_t *src_ptr, 804 unsigned int vp9_variance_halfpixvar16x16_h_c(const uint8_t *src_ptr,
799 int source_stride, 805 int source_stride,
800 const uint8_t *ref_ptr, 806 const uint8_t *ref_ptr,
801 int recon_stride, 807 int recon_stride,
802 unsigned int *sse) { 808 unsigned int *sse) {
803 return vp9_sub_pixel_variance16x16_c(src_ptr, source_stride, 8, 0, 809 return vp9_sub_pixel_variance16x16_c(src_ptr, source_stride, 8, 0,
804 ref_ptr, recon_stride, sse); 810 ref_ptr, recon_stride, sse);
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 uint8_t temp2[20 * 16]; 954 uint8_t temp2[20 * 16];
949 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 16 * 8); // compound pred buffer 955 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 16 * 8); // compound pred buffer
950 const int16_t *hfilter, *vfilter; 956 const int16_t *hfilter, *vfilter;
951 957
952 hfilter = BILINEAR_FILTERS_2TAP(xoffset); 958 hfilter = BILINEAR_FILTERS_2TAP(xoffset);
953 vfilter = BILINEAR_FILTERS_2TAP(yoffset); 959 vfilter = BILINEAR_FILTERS_2TAP(yoffset);
954 960
955 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line, 961 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
956 1, 9, 16, hfilter); 962 1, 9, 16, hfilter);
957 var_filter_block2d_bil_second_pass(fdata3, temp2, 16, 16, 8, 16, vfilter); 963 var_filter_block2d_bil_second_pass(fdata3, temp2, 16, 16, 8, 16, vfilter);
958 comp_avg_pred(temp3, second_pred, 16, 8, temp2, 16); 964 vp9_comp_avg_pred(temp3, second_pred, 16, 8, temp2, 16);
959 return vp9_variance16x8(temp3, 16, dst_ptr, dst_pixels_per_line, sse); 965 return vp9_variance16x8(temp3, 16, dst_ptr, dst_pixels_per_line, sse);
960 } 966 }
961 967
962 unsigned int vp9_sub_pixel_variance8x16_c(const uint8_t *src_ptr, 968 unsigned int vp9_sub_pixel_variance8x16_c(const uint8_t *src_ptr,
963 int src_pixels_per_line, 969 int src_pixels_per_line,
964 int xoffset, 970 int xoffset,
965 int yoffset, 971 int yoffset,
966 const uint8_t *dst_ptr, 972 const uint8_t *dst_ptr,
967 int dst_pixels_per_line, 973 int dst_pixels_per_line,
968 unsigned int *sse) { 974 unsigned int *sse) {
(...skipping 23 matching lines...) Expand all
992 uint8_t temp2[20 * 16]; 998 uint8_t temp2[20 * 16];
993 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 8 * 16); // compound pred buffer 999 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 8 * 16); // compound pred buffer
994 const int16_t *hfilter, *vfilter; 1000 const int16_t *hfilter, *vfilter;
995 1001
996 hfilter = BILINEAR_FILTERS_2TAP(xoffset); 1002 hfilter = BILINEAR_FILTERS_2TAP(xoffset);
997 vfilter = BILINEAR_FILTERS_2TAP(yoffset); 1003 vfilter = BILINEAR_FILTERS_2TAP(yoffset);
998 1004
999 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line, 1005 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
1000 1, 17, 8, hfilter); 1006 1, 17, 8, hfilter);
1001 var_filter_block2d_bil_second_pass(fdata3, temp2, 8, 8, 16, 8, vfilter); 1007 var_filter_block2d_bil_second_pass(fdata3, temp2, 8, 8, 16, 8, vfilter);
1002 comp_avg_pred(temp3, second_pred, 8, 16, temp2, 8); 1008 vp9_comp_avg_pred(temp3, second_pred, 8, 16, temp2, 8);
1003 return vp9_variance8x16(temp3, 8, dst_ptr, dst_pixels_per_line, sse); 1009 return vp9_variance8x16(temp3, 8, dst_ptr, dst_pixels_per_line, sse);
1004 } 1010 }
1005 1011
1006 unsigned int vp9_sub_pixel_variance8x4_c(const uint8_t *src_ptr, 1012 unsigned int vp9_sub_pixel_variance8x4_c(const uint8_t *src_ptr,
1007 int src_pixels_per_line, 1013 int src_pixels_per_line,
1008 int xoffset, 1014 int xoffset,
1009 int yoffset, 1015 int yoffset,
1010 const uint8_t *dst_ptr, 1016 const uint8_t *dst_ptr,
1011 int dst_pixels_per_line, 1017 int dst_pixels_per_line,
1012 unsigned int *sse) { 1018 unsigned int *sse) {
(...skipping 23 matching lines...) Expand all
1036 uint8_t temp2[20 * 16]; 1042 uint8_t temp2[20 * 16];
1037 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 8 * 4); // compound pred buffer 1043 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 8 * 4); // compound pred buffer
1038 const int16_t *hfilter, *vfilter; 1044 const int16_t *hfilter, *vfilter;
1039 1045
1040 hfilter = BILINEAR_FILTERS_2TAP(xoffset); 1046 hfilter = BILINEAR_FILTERS_2TAP(xoffset);
1041 vfilter = BILINEAR_FILTERS_2TAP(yoffset); 1047 vfilter = BILINEAR_FILTERS_2TAP(yoffset);
1042 1048
1043 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line, 1049 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
1044 1, 5, 8, hfilter); 1050 1, 5, 8, hfilter);
1045 var_filter_block2d_bil_second_pass(fdata3, temp2, 8, 8, 4, 8, vfilter); 1051 var_filter_block2d_bil_second_pass(fdata3, temp2, 8, 8, 4, 8, vfilter);
1046 comp_avg_pred(temp3, second_pred, 8, 4, temp2, 8); 1052 vp9_comp_avg_pred(temp3, second_pred, 8, 4, temp2, 8);
1047 return vp9_variance8x4(temp3, 8, dst_ptr, dst_pixels_per_line, sse); 1053 return vp9_variance8x4(temp3, 8, dst_ptr, dst_pixels_per_line, sse);
1048 } 1054 }
1049 1055
1050 unsigned int vp9_sub_pixel_variance4x8_c(const uint8_t *src_ptr, 1056 unsigned int vp9_sub_pixel_variance4x8_c(const uint8_t *src_ptr,
1051 int src_pixels_per_line, 1057 int src_pixels_per_line,
1052 int xoffset, 1058 int xoffset,
1053 int yoffset, 1059 int yoffset,
1054 const uint8_t *dst_ptr, 1060 const uint8_t *dst_ptr,
1055 int dst_pixels_per_line, 1061 int dst_pixels_per_line,
1056 unsigned int *sse) { 1062 unsigned int *sse) {
(...skipping 25 matching lines...) Expand all
1082 uint8_t temp2[20 * 16]; 1088 uint8_t temp2[20 * 16];
1083 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 4 * 8); // compound pred buffer 1089 DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 4 * 8); // compound pred buffer
1084 const int16_t *hfilter, *vfilter; 1090 const int16_t *hfilter, *vfilter;
1085 1091
1086 hfilter = BILINEAR_FILTERS_2TAP(xoffset); 1092 hfilter = BILINEAR_FILTERS_2TAP(xoffset);
1087 vfilter = BILINEAR_FILTERS_2TAP(yoffset); 1093 vfilter = BILINEAR_FILTERS_2TAP(yoffset);
1088 1094
1089 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line, 1095 var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
1090 1, 9, 4, hfilter); 1096 1, 9, 4, hfilter);
1091 var_filter_block2d_bil_second_pass(fdata3, temp2, 4, 4, 8, 4, vfilter); 1097 var_filter_block2d_bil_second_pass(fdata3, temp2, 4, 4, 8, 4, vfilter);
1092 comp_avg_pred(temp3, second_pred, 4, 8, temp2, 4); 1098 vp9_comp_avg_pred(temp3, second_pred, 4, 8, temp2, 4);
1093 return vp9_variance4x8(temp3, 4, dst_ptr, dst_pixels_per_line, sse); 1099 return vp9_variance4x8(temp3, 4, dst_ptr, dst_pixels_per_line, sse);
1094 } 1100 }
1101
1102
1103 void vp9_comp_avg_pred(uint8_t *comp_pred, const uint8_t *pred, int width,
1104 int height, const uint8_t *ref, int ref_stride) {
1105 int i, j;
1106
1107 for (i = 0; i < height; i++) {
1108 for (j = 0; j < width; j++) {
1109 int tmp;
1110 tmp = pred[j] + ref[j];
1111 comp_pred[j] = (tmp + 1) >> 1;
1112 }
1113 comp_pred += width;
1114 pred += width;
1115 ref += ref_stride;
1116 }
1117 }
OLDNEW
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_variance.h ('k') | source/libvpx/vp9/encoder/vp9_write_bit_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698