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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 { RGB_TO_YUV(0x228B22) }, /* ForestGreen */ | 46 { RGB_TO_YUV(0x228B22) }, /* ForestGreen */ |
47 { RGB_TO_YUV(0x006400) }, /* DarkGreen */ | 47 { RGB_TO_YUV(0x006400) }, /* DarkGreen */ |
48 { RGB_TO_YUV(0x98F5FF) }, /* Cadet Blue */ | 48 { RGB_TO_YUV(0x98F5FF) }, /* Cadet Blue */ |
49 { RGB_TO_YUV(0x6CA6CD) }, /* Sky Blue */ | 49 { RGB_TO_YUV(0x6CA6CD) }, /* Sky Blue */ |
50 { RGB_TO_YUV(0x00008B) }, /* Dark blue */ | 50 { RGB_TO_YUV(0x00008B) }, /* Dark blue */ |
51 { RGB_TO_YUV(0x551A8B) }, /* Purple */ | 51 { RGB_TO_YUV(0x551A8B) }, /* Purple */ |
52 { RGB_TO_YUV(0xFF0000) } /* Red */ | 52 { RGB_TO_YUV(0xFF0000) } /* Red */ |
53 { RGB_TO_YUV(0xCC33FF) }, /* Magenta */ | 53 { RGB_TO_YUV(0xCC33FF) }, /* Magenta */ |
54 }; | 54 }; |
55 | 55 |
56 static const unsigned char B_PREDICTION_MODE_colors[VP9_INTRA_MODES][3] = { | 56 static const unsigned char B_PREDICTION_MODE_colors[INTRA_MODES][3] = { |
57 { RGB_TO_YUV(0x6633ff) }, /* Purple */ | 57 { RGB_TO_YUV(0x6633ff) }, /* Purple */ |
58 { RGB_TO_YUV(0xcc33ff) }, /* Magenta */ | 58 { RGB_TO_YUV(0xcc33ff) }, /* Magenta */ |
59 { RGB_TO_YUV(0xff33cc) }, /* Pink */ | 59 { RGB_TO_YUV(0xff33cc) }, /* Pink */ |
60 { RGB_TO_YUV(0xff3366) }, /* Coral */ | 60 { RGB_TO_YUV(0xff3366) }, /* Coral */ |
61 { RGB_TO_YUV(0x3366ff) }, /* Blue */ | 61 { RGB_TO_YUV(0x3366ff) }, /* Blue */ |
62 { RGB_TO_YUV(0xed00f5) }, /* Dark Blue */ | 62 { RGB_TO_YUV(0xed00f5) }, /* Dark Blue */ |
63 { RGB_TO_YUV(0x2e00b8) }, /* Dark Purple */ | 63 { RGB_TO_YUV(0x2e00b8) }, /* Dark Purple */ |
64 { RGB_TO_YUV(0xff6633) }, /* Orange */ | 64 { RGB_TO_YUV(0xff6633) }, /* Orange */ |
65 { RGB_TO_YUV(0x33ccff) }, /* Light Blue */ | 65 { RGB_TO_YUV(0x33ccff) }, /* Light Blue */ |
66 { RGB_TO_YUV(0x8ab800) }, /* Green */ | 66 { RGB_TO_YUV(0x8ab800) }, /* Green */ |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 dx = *x1 - x0; | 624 dx = *x1 - x0; |
625 dy = *y1 - y0; | 625 dy = *y1 - y0; |
626 | 626 |
627 *y1 = 0; | 627 *y1 = 0; |
628 if (dy) | 628 if (dy) |
629 *x1 = ((0 - y0) * dx) / dy + x0; | 629 *x1 = ((0 - y0) * dx) / dy + x0; |
630 } | 630 } |
631 } | 631 } |
632 | 632 |
633 int vp9_post_proc_frame(struct VP9Common *oci, | 633 int vp9_post_proc_frame(struct VP9Common *oci, |
634 struct loopfilter *lf, | 634 YV12_BUFFER_CONFIG *dest, vp9_ppflags_t *ppflags) { |
635 YV12_BUFFER_CONFIG *dest, | 635 int q = oci->lf.filter_level * 10 / 6; |
636 vp9_ppflags_t *ppflags) { | |
637 int q = lf->filter_level * 10 / 6; | |
638 int flags = ppflags->post_proc_flag; | 636 int flags = ppflags->post_proc_flag; |
639 int deblock_level = ppflags->deblocking_level; | 637 int deblock_level = ppflags->deblocking_level; |
640 int noise_level = ppflags->noise_level; | 638 int noise_level = ppflags->noise_level; |
641 | 639 |
642 if (!oci->frame_to_show) | 640 if (!oci->frame_to_show) |
643 return -1; | 641 return -1; |
644 | 642 |
645 if (q > 63) | 643 if (q > 63) |
646 q = 63; | 644 q = 63; |
647 | 645 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 MODE_INFO *mi = oci->mi; | 730 MODE_INFO *mi = oci->mi; |
733 | 731 |
734 y_ptr = post->y_buffer + 4 * post->y_stride + 4; | 732 y_ptr = post->y_buffer + 4 * post->y_stride + 4; |
735 | 733 |
736 /* vp9_filter each macro block */ | 734 /* vp9_filter each macro block */ |
737 for (i = 0; i < mb_rows; i++) { | 735 for (i = 0; i < mb_rows; i++) { |
738 for (j = 0; j < mb_cols; j++) { | 736 for (j = 0; j < mb_cols; j++) { |
739 char zz[4]; | 737 char zz[4]; |
740 int dc_diff = !(mi[mb_index].mbmi.mode != I4X4_PRED && | 738 int dc_diff = !(mi[mb_index].mbmi.mode != I4X4_PRED && |
741 mi[mb_index].mbmi.mode != SPLITMV && | 739 mi[mb_index].mbmi.mode != SPLITMV && |
742 mi[mb_index].mbmi.mb_skip_coeff); | 740 mi[mb_index].mbmi.skip_coeff); |
743 | 741 |
744 if (oci->frame_type == KEY_FRAME) | 742 if (oci->frame_type == KEY_FRAME) |
745 sprintf(zz, "a"); | 743 sprintf(zz, "a"); |
746 else | 744 else |
747 sprintf(zz, "%c", dc_diff + '0'); | 745 sprintf(zz, "%c", dc_diff + '0'); |
748 | 746 |
749 vp9_blit_text(zz, y_ptr, post->y_stride); | 747 vp9_blit_text(zz, y_ptr, post->y_stride); |
750 mb_index++; | 748 mb_index++; |
751 y_ptr += 16; | 749 y_ptr += 16; |
752 } | 750 } |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 y1 = by0 + 2 + (mv->row >> 3); | 873 y1 = by0 + 2 + (mv->row >> 3); |
876 | 874 |
877 constrain_line(bx0 + 2, &x1, by0 + 2, &y1, width, height); | 875 constrain_line(bx0 + 2, &x1, by0 + 2, &y1, width, height); |
878 vp9_blit_line(bx0 + 2, x1, by0 + 2, y1, y_buffer, y_stride); | 876 vp9_blit_line(bx0 + 2, x1, by0 + 2, y1, y_buffer, y_stride); |
879 | 877 |
880 bmi++; | 878 bmi++; |
881 } | 879 } |
882 } | 880 } |
883 } | 881 } |
884 } | 882 } |
885 } else if (mi->mbmi.mode >= NEARESTMV) { | 883 } else if (is_inter_mode(mi->mbmi.mode)) { |
886 MV *mv = &mi->mbmi.mv.as_mv; | 884 MV *mv = &mi->mbmi.mv.as_mv; |
887 const int lx0 = x0 + 8; | 885 const int lx0 = x0 + 8; |
888 const int ly0 = y0 + 8; | 886 const int ly0 = y0 + 8; |
889 | 887 |
890 x1 = lx0 + (mv->col >> 3); | 888 x1 = lx0 + (mv->col >> 3); |
891 y1 = ly0 + (mv->row >> 3); | 889 y1 = ly0 + (mv->row >> 3); |
892 | 890 |
893 if (x1 != lx0 && y1 != ly0) { | 891 if (x1 != lx0 && y1 != ly0) { |
894 constrain_line(lx0, &x1, ly0 - 1, &y1, width, height); | 892 constrain_line(lx0, &x1, ly0 - 1, &y1, width, height); |
895 vp9_blit_line(lx0, x1, ly0 - 1, y1, y_buffer, y_stride); | 893 vp9_blit_line(lx0, x1, ly0 - 1, y1, y_buffer, y_stride); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 | 1008 |
1011 *dest = oci->post_proc_buffer; | 1009 *dest = oci->post_proc_buffer; |
1012 | 1010 |
1013 /* handle problem with extending borders */ | 1011 /* handle problem with extending borders */ |
1014 dest->y_width = oci->width; | 1012 dest->y_width = oci->width; |
1015 dest->y_height = oci->height; | 1013 dest->y_height = oci->height; |
1016 dest->uv_height = dest->y_height / 2; | 1014 dest->uv_height = dest->y_height / 2; |
1017 | 1015 |
1018 return 0; | 1016 return 0; |
1019 } | 1017 } |
OLD | NEW |