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

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

Issue 554673004: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 3 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
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_ssim.h ('k') | source/libvpx/vp9/encoder/vp9_svc_layercontext.h » ('j') | 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 (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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 for (j = 0; j <= width - 8; j += 4) { 88 for (j = 0; j <= width - 8; j += 4) {
89 double v = ssim_8x8(img1 + j, stride_img1, img2 + j, stride_img2); 89 double v = ssim_8x8(img1 + j, stride_img1, img2 + j, stride_img2);
90 ssim_total += v; 90 ssim_total += v;
91 samples++; 91 samples++;
92 } 92 }
93 } 93 }
94 ssim_total /= samples; 94 ssim_total /= samples;
95 return ssim_total; 95 return ssim_total;
96 } 96 }
97 double vp9_calc_ssim(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest, 97 double vp9_calc_ssim(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest,
98 int lumamask, double *weight) { 98 double *weight) {
99 double a, b, c; 99 double a, b, c;
100 double ssimv; 100 double ssimv;
101 101
102 a = vp9_ssim2(source->y_buffer, dest->y_buffer, 102 a = vp9_ssim2(source->y_buffer, dest->y_buffer,
103 source->y_stride, dest->y_stride, 103 source->y_stride, dest->y_stride,
104 source->y_crop_width, source->y_crop_height); 104 source->y_crop_width, source->y_crop_height);
105 105
106 b = vp9_ssim2(source->u_buffer, dest->u_buffer, 106 b = vp9_ssim2(source->u_buffer, dest->u_buffer,
107 source->uv_stride, dest->uv_stride, 107 source->uv_stride, dest->uv_stride,
108 source->uv_crop_width, source->uv_crop_height); 108 source->uv_crop_width, source->uv_crop_height);
(...skipping 25 matching lines...) Expand all
134 c = vp9_ssim2(source->v_buffer, dest->v_buffer, 134 c = vp9_ssim2(source->v_buffer, dest->v_buffer,
135 source->uv_stride, dest->uv_stride, 135 source->uv_stride, dest->uv_stride,
136 source->uv_crop_width, source->uv_crop_height); 136 source->uv_crop_width, source->uv_crop_height);
137 *ssim_y = a; 137 *ssim_y = a;
138 *ssim_u = b; 138 *ssim_u = b;
139 *ssim_v = c; 139 *ssim_v = c;
140 ssim_all = (a * 4 + b + c) / 6; 140 ssim_all = (a * 4 + b + c) / 6;
141 141
142 return ssim_all; 142 return ssim_all;
143 } 143 }
OLDNEW
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_ssim.h ('k') | source/libvpx/vp9/encoder/vp9_svc_layercontext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698