OLD | NEW |
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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 unsigned char *uvlptr = uvlimits; | 348 unsigned char *uvlptr = uvlimits; |
349 for (mbc = 0; mbc < cm->mb_cols; mbc++) | 349 for (mbc = 0; mbc < cm->mb_cols; mbc++) |
350 { | 350 { |
351 unsigned char mb_ppl; | 351 unsigned char mb_ppl; |
352 | 352 |
353 if (mode_info_context->mbmi.mb_skip_coeff) | 353 if (mode_info_context->mbmi.mb_skip_coeff) |
354 mb_ppl = (unsigned char)ppl >> 1; | 354 mb_ppl = (unsigned char)ppl >> 1; |
355 else | 355 else |
356 mb_ppl = (unsigned char)ppl; | 356 mb_ppl = (unsigned char)ppl; |
357 | 357 |
358 vpx_memset(ylptr, mb_ppl, 16); | 358 memset(ylptr, mb_ppl, 16); |
359 vpx_memset(uvlptr, mb_ppl, 8); | 359 memset(uvlptr, mb_ppl, 8); |
360 | 360 |
361 ylptr += 16; | 361 ylptr += 16; |
362 uvlptr += 8; | 362 uvlptr += 8; |
363 mode_info_context++; | 363 mode_info_context++; |
364 } | 364 } |
365 mode_info_context++; | 365 mode_info_context++; |
366 | 366 |
367 vp8_post_proc_down_and_across_mb_row( | 367 vp8_post_proc_down_and_across_mb_row( |
368 source->y_buffer + 16 * mbr * source->y_stride, | 368 source->y_buffer + 16 * mbr * source->y_stride, |
369 post->y_buffer + 16 * mbr * post->y_stride, source->y_stride, | 369 post->y_buffer + 16 * mbr * post->y_stride, source->y_stride, |
(...skipping 26 matching lines...) Expand all Loading... |
396 int mbr; | 396 int mbr; |
397 double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065; | 397 double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065; |
398 int ppl = (int)(level + .5); | 398 int ppl = (int)(level + .5); |
399 int mb_rows = cm->mb_rows; | 399 int mb_rows = cm->mb_rows; |
400 int mb_cols = cm->mb_cols; | 400 int mb_cols = cm->mb_cols; |
401 unsigned char *limits = cm->pp_limits_buffer;; | 401 unsigned char *limits = cm->pp_limits_buffer;; |
402 (void) post; | 402 (void) post; |
403 (void) low_var_thresh; | 403 (void) low_var_thresh; |
404 (void) flag; | 404 (void) flag; |
405 | 405 |
406 vpx_memset(limits, (unsigned char)ppl, 16 * mb_cols); | 406 memset(limits, (unsigned char)ppl, 16 * mb_cols); |
407 | 407 |
408 /* TODO: The original code don't filter the 2 outer rows and columns. */ | 408 /* TODO: The original code don't filter the 2 outer rows and columns. */ |
409 for (mbr = 0; mbr < mb_rows; mbr++) | 409 for (mbr = 0; mbr < mb_rows; mbr++) |
410 { | 410 { |
411 vp8_post_proc_down_and_across_mb_row( | 411 vp8_post_proc_down_and_across_mb_row( |
412 source->y_buffer + 16 * mbr * source->y_stride, | 412 source->y_buffer + 16 * mbr * source->y_stride, |
413 source->y_buffer + 16 * mbr * source->y_stride, | 413 source->y_buffer + 16 * mbr * source->y_stride, |
414 source->y_stride, source->y_stride, source->y_width, limits, 16); | 414 source->y_stride, source->y_stride, source->y_width, limits, 16); |
415 if (uvfilter == 1) { | 415 if (uvfilter == 1) { |
416 vp8_post_proc_down_and_across_mb_row( | 416 vp8_post_proc_down_and_across_mb_row( |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 if (vp8_yv12_alloc_frame_buffer(&oci->post_proc_buffer_int, | 756 if (vp8_yv12_alloc_frame_buffer(&oci->post_proc_buffer_int, |
757 width, height, VP8BORDERINPIXELS)) | 757 width, height, VP8BORDERINPIXELS)) |
758 vpx_internal_error(&oci->error, VPX_CODEC_MEM_ERROR, | 758 vpx_internal_error(&oci->error, VPX_CODEC_MEM_ERROR, |
759 "Failed to allocate MFQE framebuffer"); | 759 "Failed to allocate MFQE framebuffer"); |
760 | 760 |
761 oci->post_proc_buffer_int_used = 1; | 761 oci->post_proc_buffer_int_used = 1; |
762 | 762 |
763 /* insure that postproc is set to all 0's so that post proc | 763 /* insure that postproc is set to all 0's so that post proc |
764 * doesn't pull random data in from edge | 764 * doesn't pull random data in from edge |
765 */ | 765 */ |
766 vpx_memset((&oci->post_proc_buffer_int)->buffer_alloc,128,(&oci->pos
t_proc_buffer)->frame_size); | 766 memset((&oci->post_proc_buffer_int)->buffer_alloc,128,(&oci->post_pr
oc_buffer)->frame_size); |
767 | 767 |
768 } | 768 } |
769 } | 769 } |
770 | 770 |
771 vp8_clear_system_state(); | 771 vp8_clear_system_state(); |
772 | 772 |
773 if ((flags & VP8D_MFQE) && | 773 if ((flags & VP8D_MFQE) && |
774 oci->postproc_state.last_frame_valid && | 774 oci->postproc_state.last_frame_valid && |
775 oci->current_video_frame >= 2 && | 775 oci->current_video_frame >= 2 && |
776 oci->postproc_state.last_base_qindex < 60 && | 776 oci->postproc_state.last_base_qindex < 60 && |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 | 1197 |
1198 *dest = oci->post_proc_buffer; | 1198 *dest = oci->post_proc_buffer; |
1199 | 1199 |
1200 /* handle problem with extending borders */ | 1200 /* handle problem with extending borders */ |
1201 dest->y_width = oci->Width; | 1201 dest->y_width = oci->Width; |
1202 dest->y_height = oci->Height; | 1202 dest->y_height = oci->Height; |
1203 dest->uv_height = dest->y_height / 2; | 1203 dest->uv_height = dest->y_height / 2; |
1204 return 0; | 1204 return 0; |
1205 } | 1205 } |
1206 #endif | 1206 #endif |
OLD | NEW |