Changeset 06ff9b78d59171ce194af316dffbb62faf460c79

Show
Ignore:
Timestamp:
05/09/08 00:44:01 (3 months ago)
Author:
Antoine Cellerier <dionoea@videolan.org>
git-committer:
Antoine Cellerier <dionoea@videolan.org> 1220568241 +0200
git-parent:

[418f6bcaa716dc0ff522a261909b805f33d847da]

git-author:
Antoine Cellerier <dionoea@videolan.org> 1220568241 +0200
Message:

Simplify.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/video_filter/blend.c

    r418f6bc r06ff9b7  
    363363} 
    364364 
    365 static void vlc_blend_packed( uint8_t *p_dst, const uint8_t *p_src, 
     365static void vlc_blend_packed( uint8_t *p_dst, 
    366366                              int i_offset0, int i_offset1, int i_offset2, 
    367367                              int c0, int c1, int c2, int i_alpha, 
    368368                              bool b_do12 ) 
    369369{ 
    370     p_dst[i_offset0] = vlc_blend( c0, p_src[i_offset0], i_alpha ); 
     370    p_dst[i_offset0] = vlc_blend( c0, p_dst[i_offset0], i_alpha ); 
    371371    if( b_do12 ) 
    372372    { 
    373         p_dst[i_offset1] = vlc_blend( c1, p_src[i_offset1], i_alpha ); 
    374         p_dst[i_offset2] = vlc_blend( c2, p_src[i_offset2], i_alpha ); 
    375     } 
    376 } 
    377  
    378 static void vlc_blend_rgb16( uint16_t *p_dst, const uint16_t *p_src, 
     373        p_dst[i_offset1] = vlc_blend( c1, p_dst[i_offset1], i_alpha ); 
     374        p_dst[i_offset2] = vlc_blend( c2, p_dst[i_offset2], i_alpha ); 
     375    } 
     376} 
     377 
     378static void vlc_blend_rgb16( uint16_t *p_dst, 
    379379                             int R, int G, int B, int i_alpha, 
    380380                             const video_format_t *p_fmt ) 
    381381{ 
    382     const int i_pix = *p_src
     382    const int i_pix = *p_dst
    383383    const int r = ( i_pix & p_fmt->i_rmask ) >> p_fmt->i_lrshift; 
    384384    const int g = ( i_pix & p_fmt->i_gmask ) >> p_fmt->i_lgshift; 
     
    518518 
    519519            vlc_blend_rgb16( (uint16_t*)&p_dst[i_x * i_pix_pitch], 
    520                              (const uint16_t*)&p_dst[i_x * i_pix_pitch], 
    521520                             r, g, b, i_trans, &p_filter->fmt_out.video ); 
    522521        } 
     
    641640 
    642641                vlc_blend_packed( &p_dst[ i_x * i_pix_pitch], 
    643                                   &p_dst[i_x * i_pix_pitch], 
    644642                                  i_rindex, i_gindex, i_bindex, 
    645643                                  r, g, b, i_alpha, true ); 
     
    713711                } 
    714712 
    715                 vlc_blend_packed( &p_dst[i_x * 2], &p_dst[i_x * 2], 
     713                vlc_blend_packed( &p_dst[i_x * 2], 
    716714                                  i_l_offset, i_u_offset, i_v_offset, 
    717715                                  p_src_y[i_x], i_u, i_v, i_trans, true ); 
     
    900898 
    901899            vlc_blend_rgb16( (uint16_t*)&p_dst[i_x * i_pix_pitch], 
    902                              (const uint16_t*)&p_dst[i_x * i_pix_pitch], 
    903900                             r, g, b, i_alpha, &p_filter->fmt_out.video ); 
    904901        } 
     
    955952                        p_src_y[i_x], p_src_u[i_x/2], p_src_v[i_x/2] ); 
    956953 
    957             vlc_blend_packed( &p_dst[i_x * i_pix_pitch], &p_dst[i_x * i_pix_pitch], 
     954            vlc_blend_packed( &p_dst[i_x * i_pix_pitch], 
    958955                              i_rindex, i_gindex, i_bindex, r, g, b, i_alpha, true ); 
    959956        } 
     
    10101007 
    10111008            /* Blending */ 
    1012             vlc_blend_packed( &p_dst[i_x * 2], &p_dst[i_x * 2], 
     1009            vlc_blend_packed( &p_dst[i_x * 2], 
    10131010                              i_l_offset, i_u_offset, i_v_offset, 
    10141011                              p_src_y[i_x], p_src_u[i_x/2], p_src_v[i_x/2], i_alpha, b_even ); 
     
    11421139                } 
    11431140 
    1144                 vlc_blend_packed( &p_dst[i_x * 2], &p_dst[i_x * 2], 
     1141                vlc_blend_packed( &p_dst[i_x * 2], 
    11451142                                  i_l_offset, i_u_offset, i_v_offset, 
    11461143                                  p_pal[p_src[i_x]][0], i_u, i_v, i_trans, true ); 
     
    12081205            if( p_filter->fmt_out.video.i_chroma == FCC_RV15 || p_filter->fmt_out.video.i_chroma == FCC_RV16 ) 
    12091206                vlc_blend_rgb16( (uint16_t*)&p_dst[i_x * i_pix_pitch], 
    1210                                  (const uint16_t*)&p_dst[i_x * i_pix_pitch], 
    12111207                                  rgbpal[p_src[i_x]][0], rgbpal[p_src[i_x]][1], rgbpal[p_src[i_x]][2], 
    12121208                                  i_trans, 
    12131209                                  &p_filter->fmt_out.video ); 
    12141210            else 
    1215                 vlc_blend_packed( &p_dst[i_x * i_pix_pitch], &p_dst[i_x * i_pix_pitch], 
     1211                vlc_blend_packed( &p_dst[i_x * i_pix_pitch], 
    12161212                                  i_rindex, i_gindex, i_bindex, 
    12171213                                  rgbpal[p_src[i_x]][0], rgbpal[p_src[i_x]][1], rgbpal[p_src[i_x]][2], 
     
    13371333 
    13381334            /* Blending */ 
    1339             vlc_blend_packed( &p_dst[i_x * i_pix_pitch], &p_dst[i_x * i_pix_pitch], 
     1335            vlc_blend_packed( &p_dst[i_x * i_pix_pitch], 
    13401336                              i_rindex, i_gindex, i_bindex, 
    13411337                              R, G, B, i_trans, true ); 
     
    13831379            /* Blending */ 
    13841380            vlc_blend_rgb16( (uint16_t*)&p_dst[i_x * i_pix_pitch], 
    1385                              (const uint16_t*)&p_dst[i_x * i_pix_pitch], 
    13861381                             R, G, B, i_trans, &p_filter->fmt_out.video ); 
    13871382        } 
     
    14391434            rgb_to_yuv( &y, &u, &v, R, G, B ); 
    14401435 
    1441             vlc_blend_packed( &p_dst[i_x * 2], &p_dst[i_x * 2], 
     1436            vlc_blend_packed( &p_dst[i_x * 2], 
    14421437                              i_l_offset, i_u_offset, i_v_offset, 
    14431438                              y, u, v, i_trans, b_even );