| 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 786 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 797         MODE_INFO *mi = oci->mi; | 797         MODE_INFO *mi = oci->mi; | 
| 798 | 798 | 
| 799         y_ptr = post->y_buffer + 4 * post->y_stride + 4; | 799         y_ptr = post->y_buffer + 4 * post->y_stride + 4; | 
| 800 | 800 | 
| 801         /* vp8_filter each macro block */ | 801         /* vp8_filter each macro block */ | 
| 802         for (i = 0; i < mb_rows; i++) | 802         for (i = 0; i < mb_rows; i++) | 
| 803         { | 803         { | 
| 804             for (j = 0; j < mb_cols; j++) | 804             for (j = 0; j < mb_cols; j++) | 
| 805             { | 805             { | 
| 806                 char zz[4]; | 806                 char zz[4]; | 
|  | 807                 int dc_diff = !(mi[mb_index].mbmi.mode != B_PRED && | 
|  | 808                               mi[mb_index].mbmi.mode != SPLITMV && | 
|  | 809                               mi[mb_index].mbmi.mb_skip_coeff); | 
| 807 | 810 | 
| 808                 if (oci->frame_type == KEY_FRAME) | 811                 if (oci->frame_type == KEY_FRAME) | 
| 809                     sprintf(zz, "a"); | 812                     sprintf(zz, "a"); | 
| 810                 else | 813                 else | 
| 811                     sprintf(zz, "%c", mi[mb_index].mbmi.dc_diff + '0'); | 814                     sprintf(zz, "%c", dc_diff + '0'); | 
| 812 | 815 | 
| 813                 vp8_blit_text(zz, y_ptr, post->y_stride); | 816                 vp8_blit_text(zz, y_ptr, post->y_stride); | 
| 814                 mb_index ++; | 817                 mb_index ++; | 
| 815                 y_ptr += 16; | 818                 y_ptr += 16; | 
| 816             } | 819             } | 
| 817 | 820 | 
| 818             mb_index ++; /* border */ | 821             mb_index ++; /* border */ | 
| 819             y_ptr += post->y_stride  * 16 - post->y_width; | 822             y_ptr += post->y_stride  * 16 - post->y_width; | 
| 820 | 823 | 
| 821         } | 824         } | 
| 822     } | 825     } | 
| 823 | 826 | 
| 824     if (flags & VP8D_DEBUG_TXT_RATE_INFO) | 827     if (flags & VP8D_DEBUG_TXT_RATE_INFO) | 
| 825     { | 828     { | 
| 826         char message[512]; | 829         char message[512]; | 
| 827         sprintf(message, "Bitrate: %10.2f frame_rate: %10.2f ", oci->bitrate, oc
      i->framerate); | 830         sprintf(message, "Bitrate: %10.2f frame_rate: %10.2f ", oci->bitrate, oc
      i->framerate); | 
| 828         vp8_blit_text(message, oci->post_proc_buffer.y_buffer, oci->post_proc_bu
      ffer.y_stride); | 831         vp8_blit_text(message, oci->post_proc_buffer.y_buffer, oci->post_proc_bu
      ffer.y_stride); | 
| 829     } | 832     } | 
| 830 | 833 | 
| 831     /* Draw motion vectors */ | 834     /* Draw motion vectors */ | 
| 832     if ((flags & VP8D_DEBUG_DRAW_MV) && ppflags->display_mv_flag) | 835     if ((flags & VP8D_DEBUG_DRAW_MV) && ppflags->display_mv_flag) | 
| 833     { | 836     { | 
| 834         YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer; | 837         YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer; | 
| 835         int width  = post->y_width; | 838         int width  = post->y_width; | 
| 836         int height = post->y_height; | 839         int height = post->y_height; | 
| 837         int mb_cols = width  >> 4; |  | 
| 838         unsigned char *y_buffer = oci->post_proc_buffer.y_buffer; | 840         unsigned char *y_buffer = oci->post_proc_buffer.y_buffer; | 
| 839         int y_stride = oci->post_proc_buffer.y_stride; | 841         int y_stride = oci->post_proc_buffer.y_stride; | 
| 840         MODE_INFO *mi = oci->mi; | 842         MODE_INFO *mi = oci->mi; | 
| 841         int x0, y0; | 843         int x0, y0; | 
| 842 | 844 | 
| 843         for (y0 = 0; y0 < height; y0 += 16) | 845         for (y0 = 0; y0 < height; y0 += 16) | 
| 844         { | 846         { | 
| 845             for (x0 = 0; x0 < width; x0 += 16) | 847             for (x0 = 0; x0 < width; x0 += 16) | 
| 846             { | 848             { | 
| 847                 int x1, y1; | 849                 int x1, y1; | 
| 848 | 850 | 
| 849                 if (!(ppflags->display_mv_flag & (1<<mi->mbmi.mode))) | 851                 if (!(ppflags->display_mv_flag & (1<<mi->mbmi.mode))) | 
| 850                 { | 852                 { | 
| 851                     mi++; | 853                     mi++; | 
| 852                     continue; | 854                     continue; | 
| 853                 } | 855                 } | 
| 854 | 856 | 
| 855                 if (mi->mbmi.mode == SPLITMV) | 857                 if (mi->mbmi.mode == SPLITMV) | 
| 856                 { | 858                 { | 
| 857                     switch (mi->mbmi.partitioning) | 859                     switch (mi->mbmi.partitioning) | 
| 858                     { | 860                     { | 
| 859                         case 0 :    /* mv_top_bottom */ | 861                         case 0 :    /* mv_top_bottom */ | 
| 860                         { | 862                         { | 
| 861                             B_MODE_INFO *bmi = &mi->bmi[0]; | 863                             union b_mode_info *bmi = &mi->bmi[0]; | 
| 862                             MV *mv = &bmi->mv.as_mv; | 864                             MV *mv = &bmi->mv.as_mv; | 
| 863 | 865 | 
| 864                             x1 = x0 + 8 + (mv->col >> 3); | 866                             x1 = x0 + 8 + (mv->col >> 3); | 
| 865                             y1 = y0 + 4 + (mv->row >> 3); | 867                             y1 = y0 + 4 + (mv->row >> 3); | 
| 866 | 868 | 
| 867                             constrain_line (x0+8, &x1, y0+4, &y1, width, height)
      ; | 869                             constrain_line (x0+8, &x1, y0+4, &y1, width, height)
      ; | 
| 868                             vp8_blit_line  (x0+8,  x1, y0+4,  y1, y_buffer, y_st
      ride); | 870                             vp8_blit_line  (x0+8,  x1, y0+4,  y1, y_buffer, y_st
      ride); | 
| 869 | 871 | 
| 870                             bmi = &mi->bmi[8]; | 872                             bmi = &mi->bmi[8]; | 
| 871 | 873 | 
| 872                             x1 = x0 + 8 + (mv->col >> 3); | 874                             x1 = x0 + 8 + (mv->col >> 3); | 
| 873                             y1 = y0 +12 + (mv->row >> 3); | 875                             y1 = y0 +12 + (mv->row >> 3); | 
| 874 | 876 | 
| 875                             constrain_line (x0+8, &x1, y0+12, &y1, width, height
      ); | 877                             constrain_line (x0+8, &x1, y0+12, &y1, width, height
      ); | 
| 876                             vp8_blit_line  (x0+8,  x1, y0+12,  y1, y_buffer, y_s
      tride); | 878                             vp8_blit_line  (x0+8,  x1, y0+12,  y1, y_buffer, y_s
      tride); | 
| 877 | 879 | 
| 878                             break; | 880                             break; | 
| 879                         } | 881                         } | 
| 880                         case 1 :    /* mv_left_right */ | 882                         case 1 :    /* mv_left_right */ | 
| 881                         { | 883                         { | 
| 882                             B_MODE_INFO *bmi = &mi->bmi[0]; | 884                             union b_mode_info *bmi = &mi->bmi[0]; | 
| 883                             MV *mv = &bmi->mv.as_mv; | 885                             MV *mv = &bmi->mv.as_mv; | 
| 884 | 886 | 
| 885                             x1 = x0 + 4 + (mv->col >> 3); | 887                             x1 = x0 + 4 + (mv->col >> 3); | 
| 886                             y1 = y0 + 8 + (mv->row >> 3); | 888                             y1 = y0 + 8 + (mv->row >> 3); | 
| 887 | 889 | 
| 888                             constrain_line (x0+4, &x1, y0+8, &y1, width, height)
      ; | 890                             constrain_line (x0+4, &x1, y0+8, &y1, width, height)
      ; | 
| 889                             vp8_blit_line  (x0+4,  x1, y0+8,  y1, y_buffer, y_st
      ride); | 891                             vp8_blit_line  (x0+4,  x1, y0+8,  y1, y_buffer, y_st
      ride); | 
| 890 | 892 | 
| 891                             bmi = &mi->bmi[2]; | 893                             bmi = &mi->bmi[2]; | 
| 892 | 894 | 
| 893                             x1 = x0 +12 + (mv->col >> 3); | 895                             x1 = x0 +12 + (mv->col >> 3); | 
| 894                             y1 = y0 + 8 + (mv->row >> 3); | 896                             y1 = y0 + 8 + (mv->row >> 3); | 
| 895 | 897 | 
| 896                             constrain_line (x0+12, &x1, y0+8, &y1, width, height
      ); | 898                             constrain_line (x0+12, &x1, y0+8, &y1, width, height
      ); | 
| 897                             vp8_blit_line  (x0+12,  x1, y0+8,  y1, y_buffer, y_s
      tride); | 899                             vp8_blit_line  (x0+12,  x1, y0+8,  y1, y_buffer, y_s
      tride); | 
| 898 | 900 | 
| 899                             break; | 901                             break; | 
| 900                         } | 902                         } | 
| 901                         case 2 :    /* mv_quarters   */ | 903                         case 2 :    /* mv_quarters   */ | 
| 902                         { | 904                         { | 
| 903                             B_MODE_INFO *bmi = &mi->bmi[0]; | 905                             union b_mode_info *bmi = &mi->bmi[0]; | 
| 904                             MV *mv = &bmi->mv.as_mv; | 906                             MV *mv = &bmi->mv.as_mv; | 
| 905 | 907 | 
| 906                             x1 = x0 + 4 + (mv->col >> 3); | 908                             x1 = x0 + 4 + (mv->col >> 3); | 
| 907                             y1 = y0 + 4 + (mv->row >> 3); | 909                             y1 = y0 + 4 + (mv->row >> 3); | 
| 908 | 910 | 
| 909                             constrain_line (x0+4, &x1, y0+4, &y1, width, height)
      ; | 911                             constrain_line (x0+4, &x1, y0+4, &y1, width, height)
      ; | 
| 910                             vp8_blit_line  (x0+4,  x1, y0+4,  y1, y_buffer, y_st
      ride); | 912                             vp8_blit_line  (x0+4,  x1, y0+4,  y1, y_buffer, y_st
      ride); | 
| 911 | 913 | 
| 912                             bmi = &mi->bmi[2]; | 914                             bmi = &mi->bmi[2]; | 
| 913 | 915 | 
| (...skipping 15 matching lines...) Expand all  Loading... | 
| 929 | 931 | 
| 930                             x1 = x0 +12 + (mv->col >> 3); | 932                             x1 = x0 +12 + (mv->col >> 3); | 
| 931                             y1 = y0 +12 + (mv->row >> 3); | 933                             y1 = y0 +12 + (mv->row >> 3); | 
| 932 | 934 | 
| 933                             constrain_line (x0+12, &x1, y0+12, &y1, width, heigh
      t); | 935                             constrain_line (x0+12, &x1, y0+12, &y1, width, heigh
      t); | 
| 934                             vp8_blit_line  (x0+12,  x1, y0+12,  y1, y_buffer, y_
      stride); | 936                             vp8_blit_line  (x0+12,  x1, y0+12,  y1, y_buffer, y_
      stride); | 
| 935                             break; | 937                             break; | 
| 936                         } | 938                         } | 
| 937                         default : | 939                         default : | 
| 938                         { | 940                         { | 
| 939                             B_MODE_INFO *bmi = mi->bmi; | 941                             union b_mode_info *bmi = mi->bmi; | 
| 940                             int bx0, by0; | 942                             int bx0, by0; | 
| 941 | 943 | 
| 942                             for (by0 = y0; by0 < (y0+16); by0 += 4) | 944                             for (by0 = y0; by0 < (y0+16); by0 += 4) | 
| 943                             { | 945                             { | 
| 944                                 for (bx0 = x0; bx0 < (x0+16); bx0 += 4) | 946                                 for (bx0 = x0; bx0 < (x0+16); bx0 += 4) | 
| 945                                 { | 947                                 { | 
| 946                                     MV *mv = &bmi->mv.as_mv; | 948                                     MV *mv = &bmi->mv.as_mv; | 
| 947 | 949 | 
| 948                                     x1 = bx0 + 2 + (mv->col >> 3); | 950                                     x1 = bx0 + 2 + (mv->col >> 3); | 
| 949                                     y1 = by0 + 2 + (mv->row >> 3); | 951                                     y1 = by0 + 2 + (mv->row >> 3); | 
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1002         { | 1004         { | 
| 1003             for (x = 0; x < width; x += 16) | 1005             for (x = 0; x < width; x += 16) | 
| 1004             { | 1006             { | 
| 1005                 int Y = 0, U = 0, V = 0; | 1007                 int Y = 0, U = 0, V = 0; | 
| 1006 | 1008 | 
| 1007                 if (mi->mbmi.mode == B_PRED && | 1009                 if (mi->mbmi.mode == B_PRED && | 
| 1008                     ((ppflags->display_mb_modes_flag & B_PRED) || ppflags->displ
      ay_b_modes_flag)) | 1010                     ((ppflags->display_mb_modes_flag & B_PRED) || ppflags->displ
      ay_b_modes_flag)) | 
| 1009                 { | 1011                 { | 
| 1010                     int by, bx; | 1012                     int by, bx; | 
| 1011                     unsigned char *yl, *ul, *vl; | 1013                     unsigned char *yl, *ul, *vl; | 
| 1012                     B_MODE_INFO *bmi = mi->bmi; | 1014                     union b_mode_info *bmi = mi->bmi; | 
| 1013 | 1015 | 
| 1014                     yl = y_ptr + x; | 1016                     yl = y_ptr + x; | 
| 1015                     ul = u_ptr + (x>>1); | 1017                     ul = u_ptr + (x>>1); | 
| 1016                     vl = v_ptr + (x>>1); | 1018                     vl = v_ptr + (x>>1); | 
| 1017 | 1019 | 
| 1018                     for (by = 0; by < 16; by += 4) | 1020                     for (by = 0; by < 16; by += 4) | 
| 1019                     { | 1021                     { | 
| 1020                         for (bx = 0; bx < 16; bx += 4) | 1022                         for (bx = 0; bx < 16; bx += 4) | 
| 1021                         { | 1023                         { | 
| 1022                             if ((ppflags->display_b_modes_flag & (1<<mi->mbmi.mo
      de)) | 1024                             if ((ppflags->display_b_modes_flag & (1<<mi->mbmi.mo
      de)) | 
| 1023                                 || (ppflags->display_mb_modes_flag & B_PRED)) | 1025                                 || (ppflags->display_mb_modes_flag & B_PRED)) | 
| 1024                             { | 1026                             { | 
| 1025                                 Y = B_PREDICTION_MODE_colors[bmi->mode][0]; | 1027                                 Y = B_PREDICTION_MODE_colors[bmi->as_mode][0]; | 
| 1026                                 U = B_PREDICTION_MODE_colors[bmi->mode][1]; | 1028                                 U = B_PREDICTION_MODE_colors[bmi->as_mode][1]; | 
| 1027                                 V = B_PREDICTION_MODE_colors[bmi->mode][2]; | 1029                                 V = B_PREDICTION_MODE_colors[bmi->as_mode][2]; | 
| 1028 | 1030 | 
| 1029                                 POSTPROC_INVOKE(RTCD_VTABLE(oci), blend_b) | 1031                                 POSTPROC_INVOKE(RTCD_VTABLE(oci), blend_b) | 
| 1030                                     (yl+bx, ul+(bx>>1), vl+(bx>>1), Y, U, V, 0xc
      000, y_stride); | 1032                                     (yl+bx, ul+(bx>>1), vl+(bx>>1), Y, U, V, 0xc
      000, y_stride); | 
| 1031                             } | 1033                             } | 
| 1032                             bmi++; | 1034                             bmi++; | 
| 1033                         } | 1035                         } | 
| 1034 | 1036 | 
| 1035                         yl += y_stride*4; | 1037                         yl += y_stride*4; | 
| 1036                         ul += y_stride*1; | 1038                         ul += y_stride*1; | 
| 1037                         vl += y_stride*1; | 1039                         vl += y_stride*1; | 
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1098 #endif | 1100 #endif | 
| 1099 | 1101 | 
| 1100     *dest = oci->post_proc_buffer; | 1102     *dest = oci->post_proc_buffer; | 
| 1101 | 1103 | 
| 1102     /* handle problem with extending borders */ | 1104     /* handle problem with extending borders */ | 
| 1103     dest->y_width = oci->Width; | 1105     dest->y_width = oci->Width; | 
| 1104     dest->y_height = oci->Height; | 1106     dest->y_height = oci->Height; | 
| 1105     dest->uv_height = dest->y_height / 2; | 1107     dest->uv_height = dest->y_height / 2; | 
| 1106     return 0; | 1108     return 0; | 
| 1107 } | 1109 } | 
| OLD | NEW | 
|---|