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

Side by Side Diff: source/libvpx/vp9/common/vp9_postproc.c

Issue 415333002: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 5 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/common/vp9_onyxc_int.h ('k') | source/libvpx/vp9/decoder/vp9_decodeframe.c » ('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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 source->uv_stride, post->uv_stride, 256 source->uv_stride, post->uv_stride,
257 source->uv_height, source->uv_width, ppl); 257 source->uv_height, source->uv_width, ppl);
258 } 258 }
259 259
260 void vp9_deblock(const YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst, 260 void vp9_deblock(const YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst,
261 int q) { 261 int q) {
262 const int ppl = (int)(6.0e-05 * q * q * q - 0.0067 * q * q + 0.306 * q 262 const int ppl = (int)(6.0e-05 * q * q * q - 0.0067 * q * q + 0.306 * q
263 + 0.0065 + 0.5); 263 + 0.0065 + 0.5);
264 int i; 264 int i;
265 265
266 const uint8_t *const srcs[4] = {src->y_buffer, src->u_buffer, src->v_buffer, 266 const uint8_t *const srcs[3] = {src->y_buffer, src->u_buffer, src->v_buffer};
267 src->alpha_buffer}; 267 const int src_strides[3] = {src->y_stride, src->uv_stride, src->uv_stride};
268 const int src_strides[4] = {src->y_stride, src->uv_stride, src->uv_stride, 268 const int src_widths[3] = {src->y_width, src->uv_width, src->uv_width};
269 src->alpha_stride}; 269 const int src_heights[3] = {src->y_height, src->uv_height, src->uv_height};
270 const int src_widths[4] = {src->y_width, src->uv_width, src->uv_width,
271 src->alpha_width};
272 const int src_heights[4] = {src->y_height, src->uv_height, src->uv_height,
273 src->alpha_height};
274 270
275 uint8_t *const dsts[4] = {dst->y_buffer, dst->u_buffer, dst->v_buffer, 271 uint8_t *const dsts[3] = {dst->y_buffer, dst->u_buffer, dst->v_buffer};
276 dst->alpha_buffer}; 272 const int dst_strides[3] = {dst->y_stride, dst->uv_stride, dst->uv_stride};
277 const int dst_strides[4] = {dst->y_stride, dst->uv_stride, dst->uv_stride,
278 dst->alpha_stride};
279 273
280 for (i = 0; i < MAX_MB_PLANE; ++i) 274 for (i = 0; i < MAX_MB_PLANE; ++i)
281 vp9_post_proc_down_and_across(srcs[i], dsts[i], 275 vp9_post_proc_down_and_across(srcs[i], dsts[i],
282 src_strides[i], dst_strides[i], 276 src_strides[i], dst_strides[i],
283 src_heights[i], src_widths[i], ppl); 277 src_heights[i], src_widths[i], ppl);
284 } 278 }
285 279
286 void vp9_denoise(const YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst, 280 void vp9_denoise(const YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst,
287 int q) { 281 int q) {
288 const int ppl = (int)(6.0e-05 * q * q * q - 0.0067 * q * q + 0.306 * q 282 const int ppl = (int)(6.0e-05 * q * q * q - 0.0067 * q * q + 0.306 * q
289 + 0.0065 + 0.5); 283 + 0.0065 + 0.5);
290 int i; 284 int i;
291 285
292 const uint8_t *const srcs[4] = {src->y_buffer, src->u_buffer, src->v_buffer, 286 const uint8_t *const srcs[3] = {src->y_buffer, src->u_buffer, src->v_buffer};
293 src->alpha_buffer}; 287 const int src_strides[3] = {src->y_stride, src->uv_stride, src->uv_stride};
294 const int src_strides[4] = {src->y_stride, src->uv_stride, src->uv_stride, 288 const int src_widths[3] = {src->y_width, src->uv_width, src->uv_width};
295 src->alpha_stride}; 289 const int src_heights[3] = {src->y_height, src->uv_height, src->uv_height};
296 const int src_widths[4] = {src->y_width, src->uv_width, src->uv_width,
297 src->alpha_width};
298 const int src_heights[4] = {src->y_height, src->uv_height, src->uv_height,
299 src->alpha_height};
300 290
301 uint8_t *const dsts[4] = {dst->y_buffer, dst->u_buffer, dst->v_buffer, 291 uint8_t *const dsts[3] = {dst->y_buffer, dst->u_buffer, dst->v_buffer};
302 dst->alpha_buffer}; 292 const int dst_strides[3] = {dst->y_stride, dst->uv_stride, dst->uv_stride};
303 const int dst_strides[4] = {dst->y_stride, dst->uv_stride, dst->uv_stride,
304 dst->alpha_stride};
305 293
306 for (i = 0; i < MAX_MB_PLANE; ++i) { 294 for (i = 0; i < MAX_MB_PLANE; ++i) {
307 const int src_stride = src_strides[i]; 295 const int src_stride = src_strides[i];
308 const uint8_t *const src = srcs[i] + 2 * src_stride + 2; 296 const uint8_t *const src = srcs[i] + 2 * src_stride + 2;
309 const int src_width = src_widths[i] - 4; 297 const int src_width = src_widths[i] - 4;
310 const int src_height = src_heights[i] - 4; 298 const int src_height = src_heights[i] - 4;
311 299
312 const int dst_stride = dst_strides[i]; 300 const int dst_stride = dst_strides[i];
313 uint8_t *const dst = dsts[i] + 2 * dst_stride + 2; 301 uint8_t *const dst = dsts[i] + 2 * dst_stride + 2;
314 302
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 432
445 /* handle problem with extending borders */ 433 /* handle problem with extending borders */
446 dest->y_width = cm->width; 434 dest->y_width = cm->width;
447 dest->y_height = cm->height; 435 dest->y_height = cm->height;
448 dest->uv_width = dest->y_width >> cm->subsampling_x; 436 dest->uv_width = dest->y_width >> cm->subsampling_x;
449 dest->uv_height = dest->y_height >> cm->subsampling_y; 437 dest->uv_height = dest->y_height >> cm->subsampling_y;
450 438
451 return 0; 439 return 0;
452 } 440 }
453 #endif 441 #endif
OLDNEW
« no previous file with comments | « source/libvpx/vp9/common/vp9_onyxc_int.h ('k') | source/libvpx/vp9/decoder/vp9_decodeframe.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698