Changeset 06ff9b78d59171ce194af316dffbb62faf460c79
- 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
| r418f6bc |
r06ff9b7 |
|
| 363 | 363 | } |
|---|
| 364 | 364 | |
|---|
| 365 | | static void vlc_blend_packed( uint8_t *p_dst, const uint8_t *p_src, |
|---|
| | 365 | static void vlc_blend_packed( uint8_t *p_dst, |
|---|
| 366 | 366 | int i_offset0, int i_offset1, int i_offset2, |
|---|
| 367 | 367 | int c0, int c1, int c2, int i_alpha, |
|---|
| 368 | 368 | bool b_do12 ) |
|---|
| 369 | 369 | { |
|---|
| 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 ); |
|---|
| 371 | 371 | if( b_do12 ) |
|---|
| 372 | 372 | { |
|---|
| 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 | |
|---|
| | 378 | static void vlc_blend_rgb16( uint16_t *p_dst, |
|---|
| 379 | 379 | int R, int G, int B, int i_alpha, |
|---|
| 380 | 380 | const video_format_t *p_fmt ) |
|---|
| 381 | 381 | { |
|---|
| 382 | | const int i_pix = *p_src; |
|---|
| | 382 | const int i_pix = *p_dst; |
|---|
| 383 | 383 | const int r = ( i_pix & p_fmt->i_rmask ) >> p_fmt->i_lrshift; |
|---|
| 384 | 384 | const int g = ( i_pix & p_fmt->i_gmask ) >> p_fmt->i_lgshift; |
|---|
| … | … | |
| 518 | 518 | |
|---|
| 519 | 519 | vlc_blend_rgb16( (uint16_t*)&p_dst[i_x * i_pix_pitch], |
|---|
| 520 | | (const uint16_t*)&p_dst[i_x * i_pix_pitch], |
|---|
| 521 | 520 | r, g, b, i_trans, &p_filter->fmt_out.video ); |
|---|
| 522 | 521 | } |
|---|
| … | … | |
| 641 | 640 | |
|---|
| 642 | 641 | vlc_blend_packed( &p_dst[ i_x * i_pix_pitch], |
|---|
| 643 | | &p_dst[i_x * i_pix_pitch], |
|---|
| 644 | 642 | i_rindex, i_gindex, i_bindex, |
|---|
| 645 | 643 | r, g, b, i_alpha, true ); |
|---|
| … | … | |
| 713 | 711 | } |
|---|
| 714 | 712 | |
|---|
| 715 | | vlc_blend_packed( &p_dst[i_x * 2], &p_dst[i_x * 2], |
|---|
| | 713 | vlc_blend_packed( &p_dst[i_x * 2], |
|---|
| 716 | 714 | i_l_offset, i_u_offset, i_v_offset, |
|---|
| 717 | 715 | p_src_y[i_x], i_u, i_v, i_trans, true ); |
|---|
| … | … | |
| 900 | 898 | |
|---|
| 901 | 899 | vlc_blend_rgb16( (uint16_t*)&p_dst[i_x * i_pix_pitch], |
|---|
| 902 | | (const uint16_t*)&p_dst[i_x * i_pix_pitch], |
|---|
| 903 | 900 | r, g, b, i_alpha, &p_filter->fmt_out.video ); |
|---|
| 904 | 901 | } |
|---|
| … | … | |
| 955 | 952 | p_src_y[i_x], p_src_u[i_x/2], p_src_v[i_x/2] ); |
|---|
| 956 | 953 | |
|---|
| 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], |
|---|
| 958 | 955 | i_rindex, i_gindex, i_bindex, r, g, b, i_alpha, true ); |
|---|
| 959 | 956 | } |
|---|
| … | … | |
| 1010 | 1007 | |
|---|
| 1011 | 1008 | /* Blending */ |
|---|
| 1012 | | vlc_blend_packed( &p_dst[i_x * 2], &p_dst[i_x * 2], |
|---|
| | 1009 | vlc_blend_packed( &p_dst[i_x * 2], |
|---|
| 1013 | 1010 | i_l_offset, i_u_offset, i_v_offset, |
|---|
| 1014 | 1011 | p_src_y[i_x], p_src_u[i_x/2], p_src_v[i_x/2], i_alpha, b_even ); |
|---|
| … | … | |
| 1142 | 1139 | } |
|---|
| 1143 | 1140 | |
|---|
| 1144 | | vlc_blend_packed( &p_dst[i_x * 2], &p_dst[i_x * 2], |
|---|
| | 1141 | vlc_blend_packed( &p_dst[i_x * 2], |
|---|
| 1145 | 1142 | i_l_offset, i_u_offset, i_v_offset, |
|---|
| 1146 | 1143 | p_pal[p_src[i_x]][0], i_u, i_v, i_trans, true ); |
|---|
| … | … | |
| 1208 | 1205 | if( p_filter->fmt_out.video.i_chroma == FCC_RV15 || p_filter->fmt_out.video.i_chroma == FCC_RV16 ) |
|---|
| 1209 | 1206 | vlc_blend_rgb16( (uint16_t*)&p_dst[i_x * i_pix_pitch], |
|---|
| 1210 | | (const uint16_t*)&p_dst[i_x * i_pix_pitch], |
|---|
| 1211 | 1207 | rgbpal[p_src[i_x]][0], rgbpal[p_src[i_x]][1], rgbpal[p_src[i_x]][2], |
|---|
| 1212 | 1208 | i_trans, |
|---|
| 1213 | 1209 | &p_filter->fmt_out.video ); |
|---|
| 1214 | 1210 | 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], |
|---|
| 1216 | 1212 | i_rindex, i_gindex, i_bindex, |
|---|
| 1217 | 1213 | rgbpal[p_src[i_x]][0], rgbpal[p_src[i_x]][1], rgbpal[p_src[i_x]][2], |
|---|
| … | … | |
| 1337 | 1333 | |
|---|
| 1338 | 1334 | /* 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], |
|---|
| 1340 | 1336 | i_rindex, i_gindex, i_bindex, |
|---|
| 1341 | 1337 | R, G, B, i_trans, true ); |
|---|
| … | … | |
| 1383 | 1379 | /* Blending */ |
|---|
| 1384 | 1380 | vlc_blend_rgb16( (uint16_t*)&p_dst[i_x * i_pix_pitch], |
|---|
| 1385 | | (const uint16_t*)&p_dst[i_x * i_pix_pitch], |
|---|
| 1386 | 1381 | R, G, B, i_trans, &p_filter->fmt_out.video ); |
|---|
| 1387 | 1382 | } |
|---|
| … | … | |
| 1439 | 1434 | rgb_to_yuv( &y, &u, &v, R, G, B ); |
|---|
| 1440 | 1435 | |
|---|
| 1441 | | vlc_blend_packed( &p_dst[i_x * 2], &p_dst[i_x * 2], |
|---|
| | 1436 | vlc_blend_packed( &p_dst[i_x * 2], |
|---|
| 1442 | 1437 | i_l_offset, i_u_offset, i_v_offset, |
|---|
| 1443 | 1438 | y, u, v, i_trans, b_even ); |
|---|