Changeset 05f98788679813a111a48589f12699043e461313
- Timestamp:
- 01/01/04 16:56:56
(5 years ago)
- Author:
- Rocky Bernstein <rocky@videolan.org>
- git-committer:
- Rocky Bernstein <rocky@videolan.org> 1072972616 +0000
- git-parent:
[7d705ffcb6bb575f483569b75885b1b4fe263467]
- git-author:
- Rocky Bernstein <rocky@videolan.org> 1072972616 +0000
- Message:
RenderRV16 handles scaling. But seems to slow to render subtitles.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r9d12fa3 |
r05f9878 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2003 VideoLAN |
|---|
| 5 | | * $Id: render.c,v 1.6 2004/01/01 13:51:38 rocky Exp $ |
|---|
| | 5 | * $Id: render.c,v 1.7 2004/01/01 15:56:56 rocky Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Author: Rocky Bernstein |
|---|
| … | … | |
| 315 | 315 | /* Common variables */ |
|---|
| 316 | 316 | uint8_t *p_pixel_base; |
|---|
| 317 | | ogt_yuvt_t *p_source = (ogt_yuvt_t *)p_spu->p_sys->p_data; |
|---|
| | 317 | ogt_yuvt_t *p_src_start = (ogt_yuvt_t *)p_spu->p_sys->p_data; |
|---|
| | 318 | ogt_yuvt_t *p_src_end = &p_src_start[p_spu->i_height * p_spu->i_width]; |
|---|
| 318 | 319 | |
|---|
| 319 | 320 | int i_x, i_y; |
|---|
| … | … | |
| 324 | 325 | /* Crop-specific */ |
|---|
| 325 | 326 | int i_x_start, i_y_start, i_x_end, i_y_end; |
|---|
| | 327 | |
|---|
| | 328 | struct subpicture_sys_t *p_sys = p_spu->p_sys; |
|---|
| | 329 | |
|---|
| | 330 | dbg_print( (DECODE_DBG_CALL|DECODE_DBG_RENDER), |
|---|
| | 331 | "spu width: %d, height %d, scaled (%d, %d)", |
|---|
| | 332 | p_spu->i_width, p_spu->i_height, |
|---|
| | 333 | p_vout->output.i_width, p_vout->output.i_height ); |
|---|
| 326 | 334 | |
|---|
| 327 | 335 | i_xscale = ( p_vout->output.i_width << 6 ) / p_vout->render.i_width; |
|---|
| … | … | |
| 344 | 352 | for( i_y = 0 ; i_y < i_height ; ) |
|---|
| 345 | 353 | { |
|---|
| | 354 | int i_y_src = (i_y / i_yscale) * p_spu->i_width; |
|---|
| 346 | 355 | i_ytmp = i_y >> 6; |
|---|
| 347 | 356 | i_y += i_yscale; |
|---|
| | 357 | |
|---|
| 348 | 358 | |
|---|
| 349 | 359 | /* Check whether we need to draw one line or more than one */ |
|---|
| 350 | 360 | if( i_ytmp + 1 >= ( i_y >> 6 ) ) |
|---|
| 351 | 361 | { |
|---|
| | 362 | |
|---|
| 352 | 363 | /* Just one line : we precalculate i_y >> 6 */ |
|---|
| 353 | 364 | i_yreal = p_pic->p->i_pitch * i_ytmp; |
|---|
| 354 | 365 | |
|---|
| 355 | 366 | /* Draw until we reach the end of the line */ |
|---|
| 356 | | for( i_x = i_width ; i_x ; i_x--, p_source++ ) |
|---|
| | 367 | for( i_x = i_width ; i_x ; i_x-- ) |
|---|
| 357 | 368 | { |
|---|
| | 369 | ogt_yuvt_t *p_source; |
|---|
| | 370 | |
|---|
| 358 | 371 | if( b_crop |
|---|
| 359 | 372 | && ( i_x < i_x_start || i_x > i_x_end |
|---|
| … | … | |
| 362 | 375 | continue; |
|---|
| 363 | 376 | } |
|---|
| | 377 | |
|---|
| | 378 | p_source = &p_src_start[i_y_src + ((i_width - i_x) / i_xscale)]; |
|---|
| | 379 | |
|---|
| | 380 | if (p_source >= p_src_end) { |
|---|
| | 381 | msg_Err( p_vout, "Trying to access beyond subtitle %d x %d %d", |
|---|
| | 382 | (i_width - i_x) / i_xscale, i_y / i_yscale, i_height); |
|---|
| | 383 | return; |
|---|
| | 384 | } |
|---|
| 364 | 385 | |
|---|
| 365 | 386 | switch( p_source->s.t ) |
|---|
| … | … | |
| 405 | 426 | |
|---|
| 406 | 427 | /* Draw until we reach the end of the line */ |
|---|
| 407 | | for( i_x = i_width ; i_x ; i_x--, p_source++ ) |
|---|
| | 428 | for( i_x = i_width ; i_x ; i_x-- ) |
|---|
| 408 | 429 | { |
|---|
| | 430 | ogt_yuvt_t *p_source; |
|---|
| | 431 | |
|---|
| 409 | 432 | if( b_crop |
|---|
| 410 | 433 | && ( i_x < i_x_start || i_x > i_x_end |
|---|
| … | … | |
| 413 | 436 | continue; |
|---|
| 414 | 437 | } |
|---|
| | 438 | |
|---|
| | 439 | p_source = &p_src_start[i_y_src + ((i_width - i_x) / i_xscale)]; |
|---|
| | 440 | |
|---|
| | 441 | if (p_source >= p_src_end) { |
|---|
| | 442 | msg_Err( p_vout, "Trying to access beyond subtitle %d x %d %d", |
|---|
| | 443 | (i_width - i_x) / i_xscale, i_y / i_yscale, i_height); |
|---|
| | 444 | return; |
|---|
| | 445 | } |
|---|
| 415 | 446 | |
|---|
| 416 | 447 | switch( p_source->s.t ) |
|---|