Changeset 079a1818dc58b9dc81ca92b5217da2a8d599572f
- Timestamp:
- 29/01/08 14:34:30
(10 months ago)
- Author:
- Rafaël Carré <funman@videolan.org>
- git-committer:
- Rafaël Carré <funman@videolan.org> 1201613670 +0000
- git-parent:
[c4802454727f939844aaf4d44e49e7fa7c31f32b]
- git-author:
- Rafaël Carré <funman@videolan.org> 1201613670 +0000
- Message:
codecs & packetizers: fix warnings
use size_t instead of int to represent sizes
removes unused parameters from:
block_BytestreamInit()
mpeg4_audio/LOASSyncInfo()
cinepak/cinepak_Getv1()
speex/SendPacket()
subsass/ParseColor()
ffmpeg/postprocess/InitPostproc() & PostprocPict?()
dvbsub/YuvaYuvp() & encode_pixel_line_{2,4,8}bp()
faad/DoReordering()
vlc_block_helper.h:
use size_t, removes unused parameter from block_BytestreamInit()
struct filter_t:
removes unused parameters from pf_picture_link() & pf_picture_unlink()
cmml: fix a segfault (p_item isn't an input item, despite the name) present for some months, proving that nobody did use that code ?
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rfbf4c80 |
r079a181 |
|
| 35 | 35 | block_t *p_chain; |
|---|
| 36 | 36 | block_t *p_block; |
|---|
| 37 | | int i_offset; |
|---|
| | 37 | size_t i_offset; |
|---|
| 38 | 38 | |
|---|
| 39 | 39 | } block_bytestream_t; |
|---|
| 40 | | |
|---|
| 41 | | #define block_BytestreamInit( a ) __block_BytestreamInit( VLC_OBJECT(a) ) |
|---|
| 42 | 40 | |
|---|
| 43 | 41 | /***************************************************************************** |
|---|
| 44 | 42 | * block_bytestream_t management |
|---|
| 45 | 43 | *****************************************************************************/ |
|---|
| 46 | | static inline block_bytestream_t __block_BytestreamInit( vlc_object_t *p_obj ) |
|---|
| | 44 | static inline block_bytestream_t block_BytestreamInit( void ) |
|---|
| 47 | 45 | { |
|---|
| 48 | 46 | block_bytestream_t bytestream; |
|---|
| … | … | |
| 217 | 215 | |
|---|
| 218 | 216 | static inline int block_WaitBytes( block_bytestream_t *p_bytestream, |
|---|
| 219 | | int i_data ) |
|---|
| | 217 | size_t i_data ) |
|---|
| 220 | 218 | { |
|---|
| 221 | 219 | block_t *p_block; |
|---|
| 222 | | int i_offset, i_copy, i_size; |
|---|
| | 220 | size_t i_offset, i_copy, i_size; |
|---|
| 223 | 221 | |
|---|
| 224 | 222 | /* Check we have that much data */ |
|---|
| … | … | |
| 245 | 243 | |
|---|
| 246 | 244 | static inline int block_SkipBytes( block_bytestream_t *p_bytestream, |
|---|
| 247 | | int i_data ) |
|---|
| | 245 | size_t i_data ) |
|---|
| 248 | 246 | { |
|---|
| 249 | 247 | block_t *p_block; |
|---|
| 250 | | int i_offset, i_copy; |
|---|
| | 248 | size_t i_offset, i_copy; |
|---|
| 251 | 249 | |
|---|
| 252 | 250 | /* Check we have that much data */ |
|---|
| … | … | |
| 276 | 274 | |
|---|
| 277 | 275 | static inline int block_PeekBytes( block_bytestream_t *p_bytestream, |
|---|
| 278 | | uint8_t *p_data, int i_data ) |
|---|
| | 276 | uint8_t *p_data, size_t i_data ) |
|---|
| 279 | 277 | { |
|---|
| 280 | 278 | block_t *p_block; |
|---|
| 281 | | int i_offset, i_copy, i_size; |
|---|
| | 279 | size_t i_offset, i_copy, i_size; |
|---|
| 282 | 280 | |
|---|
| 283 | 281 | /* Check we have that much data */ |
|---|
| … | … | |
| 326 | 324 | |
|---|
| 327 | 325 | static inline int block_GetBytes( block_bytestream_t *p_bytestream, |
|---|
| 328 | | uint8_t *p_data, int i_data ) |
|---|
| | 326 | uint8_t *p_data, size_t i_data ) |
|---|
| 329 | 327 | { |
|---|
| 330 | 328 | block_t *p_block; |
|---|
| 331 | | int i_offset, i_copy, i_size; |
|---|
| | 329 | size_t i_offset, i_copy, i_size; |
|---|
| 332 | 330 | |
|---|
| 333 | 331 | /* Check we have that much data */ |
|---|
| … | … | |
| 380 | 378 | |
|---|
| 381 | 379 | static inline int block_PeekOffsetBytes( block_bytestream_t *p_bytestream, |
|---|
| 382 | | int i_peek_offset, uint8_t *p_data, int i_data ) |
|---|
| | 380 | size_t i_peek_offset, uint8_t *p_data, size_t i_data ) |
|---|
| 383 | 381 | { |
|---|
| 384 | 382 | block_t *p_block; |
|---|
| 385 | | int i_offset, i_copy, i_size; |
|---|
| | 383 | size_t i_offset, i_copy, i_size; |
|---|
| 386 | 384 | |
|---|
| 387 | 385 | /* Check we have that much data */ |
|---|
| … | … | |
| 444 | 442 | |
|---|
| 445 | 443 | static inline int block_FindStartcodeFromOffset( |
|---|
| 446 | | block_bytestream_t *p_bytestream, int *pi_offset, |
|---|
| | 444 | block_bytestream_t *p_bytestream, size_t *pi_offset, |
|---|
| 447 | 445 | uint8_t *p_startcode, int i_startcode_length ) |
|---|
| 448 | 446 | { |
|---|
| 449 | 447 | block_t *p_block, *p_block_backup = 0; |
|---|
| 450 | | int i_size, i_offset, i_offset_backup = 0; |
|---|
| | 448 | int i_size = 0; |
|---|
| | 449 | size_t i_offset, i_offset_backup = 0; |
|---|
| 451 | 450 | int i_caller_offset_backup = 0, i_match; |
|---|
| 452 | 451 | |
|---|
| … | … | |
| 469 | 468 | * We first look for an occurrence of the 1st startcode byte and |
|---|
| 470 | 469 | * if found, we do a more thorough check. */ |
|---|
| 471 | | i_size = p_block->i_buffer + i_size; |
|---|
| | 470 | i_size += p_block->i_buffer; |
|---|
| 472 | 471 | *pi_offset -= i_size; |
|---|
| 473 | 472 | i_match = 0; |
|---|
| rcf9e0c8 |
r079a181 |
|
| 82 | 82 | picture_t * ( * pf_vout_buffer_new) ( filter_t * ); |
|---|
| 83 | 83 | void ( * pf_vout_buffer_del) ( filter_t *, picture_t * ); |
|---|
| 84 | | void ( * pf_picture_link) ( filter_t *, picture_t * ); |
|---|
| 85 | | void ( * pf_picture_unlink) ( filter_t *, picture_t * ); |
|---|
| | 84 | void ( * pf_picture_link) ( picture_t * ); |
|---|
| | 85 | void ( * pf_picture_unlink) ( picture_t * ); |
|---|
| 86 | 86 | |
|---|
| 87 | 87 | /* SPU output callbacks */ |
|---|
| r99fab90 |
r079a181 |
|
| 134 | 134 | aout_DateSet( &p_sys->end_date, 0 ); |
|---|
| 135 | 135 | |
|---|
| 136 | | p_sys->bytestream = block_BytestreamInit( p_dec ); |
|---|
| | 136 | p_sys->bytestream = block_BytestreamInit(); |
|---|
| 137 | 137 | p_sys->i_input_rate = INPUT_RATE_DEFAULT; |
|---|
| 138 | 138 | |
|---|
| r99fab90 |
r079a181 |
|
| 69 | 69 | enum adpcm_codec_e codec; |
|---|
| 70 | 70 | |
|---|
| 71 | | int i_block; |
|---|
| 72 | | int i_samplesperblock; |
|---|
| | 71 | size_t i_block; |
|---|
| | 72 | size_t i_samplesperblock; |
|---|
| 73 | 73 | |
|---|
| 74 | 74 | audio_date_t end_date; |
|---|
| … | … | |
| 619 | 619 | decoder_sys_t *p_sys = p_dec->p_sys; |
|---|
| 620 | 620 | adpcm_ima_wav_channel_t channel[2]; |
|---|
| 621 | | int i_nibbles; |
|---|
| | 621 | size_t i_nibbles; |
|---|
| 622 | 622 | int b_stereo; |
|---|
| 623 | 623 | |
|---|
| r99fab90 |
r079a181 |
|
| 1464 | 1464 | static void EncoderClose ( vlc_object_t *p_this ) |
|---|
| 1465 | 1465 | { |
|---|
| 1466 | | return; |
|---|
| | 1466 | VLC_UNUSED(p_this); |
|---|
| 1467 | 1467 | } |
|---|
| 1468 | 1468 | |
|---|
| ra0e5fe3 |
r079a181 |
|
| 227 | 227 | static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block ) |
|---|
| 228 | 228 | { |
|---|
| 229 | | decoder_sys_t *p_sys = p_dec->p_sys; |
|---|
| 230 | | |
|---|
| 231 | 229 | if( pp_block && *pp_block ) |
|---|
| 232 | 230 | { |
|---|
| r418f8da |
r079a181 |
|
| 67 | 67 | static inline void cc_Exit( cc_data_t *c ) |
|---|
| 68 | 68 | { |
|---|
| | 69 | VLC_UNUSED(c); |
|---|
| 69 | 70 | return; |
|---|
| 70 | 71 | } |
|---|
| r99fab90 |
r079a181 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2007 Laurent Aimar |
|---|
| 5 | | * $Id: $ |
|---|
| | 5 | * $Id$ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Laurent Aimar <fenrir # via.ecp.fr> |
|---|
| … | … | |
| 195 | 195 | { |
|---|
| 196 | 196 | const int i_color = p_data[0]&0x0f; |
|---|
| | 197 | #if 0 |
|---|
| 197 | 198 | const int i_repeat= p_data[1]&0x0f; |
|---|
| 198 | | |
|---|
| | 199 | #endif |
|---|
| 199 | 200 | /* if i_repeat > 0 we could ignore it if we have a reliable stream */ |
|---|
| 200 | 201 | ScreenFill( p_cdg, 0, 0, CDG_SCREEN_WIDTH, CDG_SCREEN_HEIGHT, i_color ); |
|---|
| r99fab90 |
r079a181 |
|
| 279 | 279 | static void cinepak_Getv4( cinepak_context_t *p_context, |
|---|
| 280 | 280 | int i_strip, int i_x, int i_y, |
|---|
| 281 | | int i_x2, int i_y2, uint8_t *p_data ) |
|---|
| | 281 | uint8_t *p_data ) |
|---|
| 282 | 282 | { |
|---|
| 283 | 283 | uint8_t i_index[4]; |
|---|
| … | … | |
| 326 | 326 | static void cinepak_Getv1( cinepak_context_t *p_context, |
|---|
| 327 | 327 | int i_strip, int i_x, int i_y, |
|---|
| 328 | | int i_x2, int i_y2, uint8_t *p_data ) |
|---|
| | 328 | uint8_t *p_data ) |
|---|
| 329 | 329 | { |
|---|
| 330 | 330 | uint8_t i_index; |
|---|
| … | … | |
| 588 | 588 | i_strip_x1 + i_x, |
|---|
| 589 | 589 | i_strip_y1 + i_y, |
|---|
| 590 | | i_strip_x2, i_strip_y2, |
|---|
| 591 | 590 | p_data ); |
|---|
| 592 | 591 | p_data += 4; |
|---|
| … | … | |
| 599 | 598 | i_strip_x1 + i_x, |
|---|
| 600 | 599 | i_strip_y1 + i_y, |
|---|
| 601 | | i_strip_x2, i_strip_y2, |
|---|
| 602 | 600 | p_data ); |
|---|
| 603 | 601 | p_data++; |
|---|
| … | … | |
| 647 | 645 | i_strip_x1 + i_x, |
|---|
| 648 | 646 | i_strip_y1 + i_y, |
|---|
| 649 | | i_strip_x2, i_strip_y2, |
|---|
| 650 | 647 | p_data ); |
|---|
| 651 | 648 | p_data += 4; |
|---|
| … | … | |
| 659 | 656 | i_strip_x1 + i_x, |
|---|
| 660 | 657 | i_strip_y1 + i_y, |
|---|
| 661 | | i_strip_x2, i_strip_y2, |
|---|
| 662 | 658 | p_data ); |
|---|
| 663 | 659 | p_data++; |
|---|
| … | … | |
| 685 | 681 | i_strip_x1 + i_x, |
|---|
| 686 | 682 | i_strip_y1 + i_y, |
|---|
| 687 | | i_strip_x2, i_strip_y2, |
|---|
| 688 | 683 | p_data ); |
|---|
| 689 | 684 | p_data++; |
|---|
| r99fab90 |
r079a181 |
|
| 120 | 120 | else |
|---|
| 121 | 121 | { |
|---|
| 122 | | char *psz_uri = input_item_GetURI( p_item ); |
|---|
| 123 | 122 | fprintf( stderr, "HISTORY: [%d] %p (%p->%s)\n", i, p_item, |
|---|
| 124 | | psz_uri, psz_uri ); |
|---|
| 125 | | free( psz_uri ); |
|---|
| | 123 | p_item->psz_uri, p_item->psz_uri ); |
|---|
| 126 | 124 | } |
|---|
| 127 | 125 | } |
|---|
| r99fab90 |
r079a181 |
|
| 79 | 79 | * Local prototypes. |
|---|
| 80 | 80 | *****************************************************************************/ |
|---|
| | 81 | |
|---|
| | 82 | int E_(OpenIntf) ( vlc_object_t * ); |
|---|
| | 83 | void E_(CloseIntf) ( vlc_object_t * ); |
|---|
| | 84 | |
|---|
| 81 | 85 | static int InitThread ( intf_thread_t * ); |
|---|
| 82 | 86 | static int MouseEvent ( vlc_object_t *, char const *, |
|---|
| … | … | |
| 401 | 405 | vlc_value_t oldval, vlc_value_t newval, void *p_data ) |
|---|
| 402 | 406 | { |
|---|
| | 407 | VLC_UNUSED(p_this); VLC_UNUSED(psz_var); |
|---|
| | 408 | VLC_UNUSED(oldval); VLC_UNUSED(newval); |
|---|
| | 409 | VLC_UNUSED(p_data); |
|---|
| 403 | 410 | /* TODO: handle mouse clicks on the anchor text */ |
|---|
| 404 | 411 | |
|---|
| … | … | |
| 412 | 419 | vlc_value_t oldval, vlc_value_t newval, void *p_data ) |
|---|
| 413 | 420 | { |
|---|
| | 421 | VLC_UNUSED(p_this); VLC_UNUSED(psz_var); |
|---|
| | 422 | VLC_UNUSED(oldval); VLC_UNUSED(newval); |
|---|
| 414 | 423 | intf_thread_t *p_intf = (intf_thread_t *)p_data; |
|---|
| 415 | 424 | vlc_mutex_lock( &p_intf->change_lock ); |
|---|
| … | … | |
| 577 | 586 | return psz_return_value; |
|---|
| 578 | 587 | #else |
|---|
| | 588 | VLC_UNUSED(p_intf); |
|---|
| 579 | 589 | void *p; |
|---|
| 580 | 590 | |
|---|
| … | … | |
| 617 | 627 | vlc_value_t oldval, vlc_value_t newval, void *p_data ) |
|---|
| 618 | 628 | { |
|---|
| | 629 | VLC_UNUSED(p_this); VLC_UNUSED(psz_var); |
|---|
| | 630 | VLC_UNUSED(oldval); VLC_UNUSED(newval); |
|---|
| 619 | 631 | intf_thread_t *p_intf = (intf_thread_t *) p_data; |
|---|
| 620 | 632 | GoBack( p_intf ); |
|---|
| … | … | |
| 626 | 638 | vlc_value_t oldval, vlc_value_t newval, void *p_data ) |
|---|
| 627 | 639 | { |
|---|
| | 640 | VLC_UNUSED(p_this); VLC_UNUSED(psz_var); |
|---|
| | 641 | VLC_UNUSED(oldval); VLC_UNUSED(newval); |
|---|
| 628 | 642 | intf_thread_t *p_intf = (intf_thread_t *) p_data; |
|---|
| 629 | 643 | GoForward( p_intf ); |
|---|
| … | … | |
| 636 | 650 | void *p_data ) |
|---|
| 637 | 651 | { |
|---|
| | 652 | VLC_UNUSED(p_this); VLC_UNUSED(psz_var); |
|---|
| | 653 | VLC_UNUSED(oldval); VLC_UNUSED(newval); |
|---|
| 638 | 654 | intf_thread_t *p_intf = (intf_thread_t *) p_data; |
|---|
| 639 | 655 | FollowAnchor( p_intf ); |
|---|
| r99fab90 |
r079a181 |
|
| 33 | 33 | #include "xarray.h" |
|---|
| 34 | 34 | |
|---|
| | 35 | /* local prototypes */ |
|---|
| | 36 | XSTATIC XArray * xarray_New (unsigned int); |
|---|
| | 37 | |
|---|
| | 38 | |
|---|
| 35 | 39 | #define XARRAY_ASSERT_NOT_NULL(xarray) \ |
|---|
| 36 | 40 | { \ |
|---|
| … | … | |
| 40 | 44 | #define XARRAY_BOUNDS_CHECK(xarray, index) \ |
|---|
| 41 | 45 | { \ |
|---|
| 42 | | if (index < 0) \ |
|---|
| 43 | | return XARRAY_ENEGATIVEINDEX; \ |
|---|
| 44 | | else if (xarray->last_valid_element != -1 && \ |
|---|
| | 46 | if (xarray->last_valid_element != -1 && \ |
|---|
| 45 | 47 | (int) index > xarray->last_valid_element) \ |
|---|
| 46 | 48 | return XARRAY_EINDEXTOOLARGE; \ |
|---|
| … | … | |
| 62 | 64 | if (new_xarray == NULL) return NULL; |
|---|
| 63 | 65 | |
|---|
| 64 | | if (initial_size_hint <= 0) |
|---|
| | 66 | if (initial_size_hint == 0) |
|---|
| 65 | 67 | initial_size = XARRAY_DEFAULT_SIZE; |
|---|
| 66 | 68 | else |
|---|
| r99fab90 |
r079a181 |
|
| 82 | 82 | }; |
|---|
| 83 | 83 | |
|---|
| | 84 | XTag * xtag_free (XTag * xtag); |
|---|
| | 85 | XTag * xtag_new_parse (const char * s, int n); |
|---|
| | 86 | char * xtag_get_name (XTag * xtag); |
|---|
| | 87 | char * xtag_get_pcdata (XTag * xtag); |
|---|
| | 88 | char * xtag_get_attribute (XTag * xtag, char * attribute); |
|---|
| | 89 | XTag * xtag_first_child (XTag * xtag, char * name); |
|---|
| | 90 | XTag * xtag_next_child (XTag * xtag, char * name); |
|---|
| | 91 | int xtag_snprint (char * buf, int n, XTag * xtag); |
|---|
| | 92 | |
|---|
| 84 | 93 | /* Character classes */ |
|---|
| 85 | 94 | #define X_NONE 0 |
|---|
| r99fab90 |
r079a181 |
|
| 40 | 40 | #endif |
|---|
| 41 | 41 | |
|---|
| | 42 | char *XURL_FindQuery ( char *psz_url ); |
|---|
| 42 | 43 | static char *XURL_FindHostname ( char *psz_url ); |
|---|
| 43 | 44 | static char *XURL_FindPath ( char *psz_url ); |
|---|
| … | … | |
| 259 | 260 | } |
|---|
| 260 | 261 | |
|---|
| 261 | | |
|---|
| 262 | 262 | char *XURL_FindQuery( char *psz_url ) |
|---|
| 263 | 263 | { |
|---|
| r99fab90 |
r079a181 |
|
| 81 | 81 | block_t *p_spu; /* Bytes of the packet. */ |
|---|
| 82 | 82 | |
|---|
| 83 | | int i_spu_size; /* goal for subtitle_data_pos while gathering, |
|---|
| | 83 | size_t i_spu_size; /* goal for subtitle_data_pos while gathering, |
|---|
| 84 | 84 | size of used subtitle_data later */ |
|---|
| 85 | 85 | |
|---|
| 86 | 86 | uint16_t i_image_offset; /* offset from subtitle_data to compressed |
|---|
| 87 | 87 | image data */ |
|---|
| 88 | | int i_image_length; /* size of the compressed image data */ |
|---|
| 89 | | int first_field_offset; /* offset of even raster lines */ |
|---|
| 90 | | int second_field_offset; /* offset of odd raster lines */ |
|---|
| 91 | | int metadata_offset; /* offset to data describing the image */ |
|---|
| 92 | | int metadata_length; /* length of metadata */ |
|---|
| | 88 | size_t i_image_length; /* size of the compressed image data */ |
|---|
| | 89 | size_t first_field_offset; /* offset of even raster lines */ |
|---|
| | 90 | size_t second_field_offset; /* offset of odd raster lines */ |
|---|
| | 91 | size_t metadata_offset; /* offset to data describing the image */ |
|---|
| | 92 | size_t metadata_length; /* length of metadata */ |
|---|
| 93 | 93 | |
|---|
| 94 | 94 | mtime_t i_duration; /* how long to display the image, 0 stands |
|---|
| r99fab90 |
r079a181 |
|
| 109 | 109 | |
|---|
| 110 | 110 | if( !ppBuffer && !pcbLength ) return E_POINTER; |
|---|
| 111 | | if( ppBuffer ) *ppBuffer = p_mb->p_block->p_buffer; |
|---|
| | 111 | if( ppBuffer ) *ppBuffer = (char*)p_mb->p_block->p_buffer; |
|---|
| 112 | 112 | if( pcbLength ) *pcbLength = p_mb->p_block->i_buffer; |
|---|
| 113 | 113 | return S_OK; |
|---|
| r99fab90 |
r079a181 |
|
| 55 | 55 | #ifdef LOADER |
|---|
| 56 | 56 | /* Not Needed */ |
|---|
| 57 | | long CoInitialize( void *pvReserved ) { return -1; } |
|---|
| | 57 | long CoInitialize( void *pvReserved ) { VLC_UNUSED(pvReserved); return -1; } |
|---|
| 58 | 58 | void CoUninitialize( void ) { } |
|---|
| 59 | 59 | |
|---|
| r99fab90 |
r079a181 |
|
| 134 | 134 | aout_DateSet( &p_sys->end_date, 0 ); |
|---|
| 135 | 135 | |
|---|
| 136 | | p_sys->bytestream = block_BytestreamInit( p_dec ); |
|---|
| | 136 | p_sys->bytestream = block_BytestreamInit(); |
|---|
| 137 | 137 | |
|---|
| 138 | 138 | /* Set output properties */ |
|---|
| r99fab90 |
r079a181 |
|
| 1701 | 1701 | * into VLC_FOURCC('Y','U','V','P') |
|---|
| 1702 | 1702 | */ |
|---|
| 1703 | | static subpicture_t *YuvaYuvp( encoder_t *p_enc, subpicture_t *p_subpic ) |
|---|
| | 1703 | static subpicture_t *YuvaYuvp( subpicture_t *p_subpic ) |
|---|
| 1704 | 1704 | { |
|---|
| 1705 | 1705 | subpicture_region_t *p_region = NULL; |
|---|
| … | … | |
| 1921 | 1921 | if( p_region->fmt.i_chroma == VLC_FOURCC('Y','U','V','A') ) |
|---|
| 1922 | 1922 | { |
|---|
| 1923 | | p_temp = YuvaYuvp( p_enc, p_subpic ); |
|---|
| | 1923 | p_temp = YuvaYuvp( p_subpic ); |
|---|
| 1924 | 1924 | if( !p_temp ) |
|---|
| 1925 | 1925 | { |
|---|
| … | … | |
| 2319 | 2319 | } |
|---|
| 2320 | 2320 | |
|---|
| 2321 | | static void encode_pixel_line_2bp( encoder_t *p_enc, bs_t *s, |
|---|
| 2322 | | subpicture_region_t *p_region, |
|---|
| | 2321 | static void encode_pixel_line_2bp( bs_t *s, subpicture_region_t *p_region, |
|---|
| 2323 | 2322 | int i_line ); |
|---|
| 2324 | | static void encode_pixel_line_4bp( encoder_t *p_enc, bs_t *s, |
|---|
| 2325 | | subpicture_region_t *p_region, |
|---|
| | 2323 | static void encode_pixel_line_4bp( bs_t *s, subpicture_region_t *p_region, |
|---|
| 2326 | 2324 | int i_line ); |
|---|
| 2327 | | static void encode_pixel_line_8bp( encoder_t *p_enc, bs_t *s, |
|---|
| 2328 | | subpicture_region_t *p_region, |
|---|
| | 2325 | static void encode_pixel_line_8bp( bs_t *s, subpicture_region_t *p_region, |
|---|
| 2329 | 2326 | int i_line ); |
|---|
| 2330 | 2327 | static void encode_pixel_data( encoder_t *p_enc, bs_t *s, |
|---|
| … | … | |
| 2348 | 2345 | case 4: |
|---|
| 2349 | 2346 | bs_write( s, 8, 0x10 ); /* 2 bit/pixel code string */ |
|---|
| 2350 | | encode_pixel_line_2bp( p_enc, s, p_region, i_line ); |
|---|
| | 2347 | encode_pixel_line_2bp( s, p_region, i_line ); |
|---|
| 2351 | 2348 | break; |
|---|
| 2352 | 2349 | |
|---|
| 2353 | 2350 | case 16: |
|---|
| 2354 | 2351 | bs_write( s, 8, 0x11 ); /* 4 bit/pixel code string */ |
|---|
| 2355 | | encode_pixel_line_4bp( p_enc, s, p_region, i_line ); |
|---|
| | 2352 | encode_pixel_line_4bp( s, p_region, i_line ); |
|---|
| 2356 | 2353 | break; |
|---|
| 2357 | 2354 | |
|---|
| 2358 | 2355 | case 256: |
|---|
| 2359 | 2356 | bs_write( s, 8, 0x12 ); /* 8 bit/pixel code string */ |
|---|
| 2360 | | encode_pixel_line_8bp( p_enc, s, p_region, i_line ); |
|---|
| | 2357 | encode_pixel_line_8bp( s, p_region, i_line ); |
|---|
| 2361 | 2358 | break; |
|---|
| 2362 | 2359 | |
|---|
| … | … | |
| 2371 | 2368 | } |
|---|
| 2372 | 2369 | |
|---|
| 2373 | | static void encode_pixel_line_2bp( encoder_t *p_enc, bs_t *s, |
|---|
| 2374 | | subpicture_region_t *p_region, |
|---|
| | 2370 | static void encode_pixel_line_2bp( bs_t *s, subpicture_region_t *p_region, |
|---|
| 2375 | 2371 | int i_line ) |
|---|
| 2376 | 2372 | { |
|---|
| … | … | |
| 2463 | 2459 | } |
|---|
| 2464 | 2460 | |
|---|
| 2465 | | static void encode_pixel_line_4bp( encoder_t *p_enc, bs_t *s, |
|---|
| 2466 | | subpicture_region_t *p_region, |
|---|
| | 2461 | static void encode_pixel_line_4bp( bs_t *s, subpicture_region_t *p_region, |
|---|
| 2467 | 2462 | int i_line ) |
|---|
| 2468 | 2463 | { |
|---|
| … | … | |
| 2562 | 2557 | } |
|---|
| 2563 | 2558 | |
|---|
| 2564 | | static void encode_pixel_line_8bp( encoder_t *p_enc, bs_t *s, |
|---|
| 2565 | | subpicture_region_t *p_region, |
|---|
| | 2559 | static void encode_pixel_line_8bp( bs_t *s, subpicture_region_t *p_region, |
|---|
| 2566 | 2560 | int i_line ) |
|---|
| 2567 | 2561 | { |
|---|
| r99fab90 |
r079a181 |
|
| 52 | 52 | ****************************************************************************/ |
|---|
| 53 | 53 | static aout_buffer_t *DecodeBlock( decoder_t *, block_t ** ); |
|---|
| 54 | | static void DoReordering( decoder_t *, uint32_t *, uint32_t *, int, int, |
|---|
| 55 | | uint32_t * ); |
|---|
| | 54 | static void DoReordering( uint32_t *, uint32_t *, int, int, uint32_t * ); |
|---|
| 56 | 55 | |
|---|
| 57 | 56 | #define MAX_CHANNEL_POSITIONS 9 |
|---|
| … | … | |
| 68 | 67 | uint8_t *p_buffer; |
|---|
| 69 | 68 | int i_buffer; |
|---|
| 70 | | int i_buffer_size; |
|---|
| | 69 | size_t i_buffer_size; |
|---|
| 71 | 70 | |
|---|
| 72 | 71 | /* Channel positions of the current stream (for re-ordering) */ |
|---|
| … | … | |
| 407 | 406 | (frame.samples / frame.channels) * p_sys->i_input_rate / INPUT_RATE_DEFAULT ); |
|---|
| 408 | 407 | |
|---|
| 409 | | DoReordering( p_dec, (uint32_t *)p_out->p_buffer, samples, |
|---|
| | 408 | DoReordering( (uint32_t *)p_out->p_buffer, samples, |
|---|
| 410 | 409 | frame.samples / frame.channels, frame.channels, |
|---|
| 411 | 410 | p_sys->pi_channel_positions ); |
|---|
| … | … | |
| 442 | 441 | * different from the aac one). |
|---|
| 443 | 442 | *****************************************************************************/ |
|---|
| 444 | | static void DoReordering( decoder_t *p_dec, |
|---|
| 445 | | uint32_t *p_out, uint32_t *p_in, int i_samples, |
|---|
| | 443 | static void DoReordering( uint32_t *p_out, uint32_t *p_in, int i_samples, |
|---|
| 446 | 444 | int i_nb_channels, uint32_t *pi_chan_positions ) |
|---|
| 447 | 445 | { |
|---|
| r99fab90 |
r079a181 |
|
| 389 | 389 | void *p_data ) |
|---|
| 390 | 390 | { |
|---|
| | 391 | VLC_UNUSED(p_this); VLC_UNUSED(oldval); |
|---|
| 391 | 392 | decoder_t *p_dec = (decoder_t *)p_data; |
|---|
| 392 | 393 | |
|---|
| r99fab90 |
r079a181 |
|
| 284 | 284 | return NULL; |
|---|
| 285 | 285 | } |
|---|
| 286 | | else if( i_used > p_block->i_buffer ) |
|---|
| | 286 | else if( (size_t)i_used > p_block->i_buffer ) |
|---|
| 287 | 287 | { |
|---|
| 288 | 288 | i_used = p_block->i_buffer; |
|---|
| re189922 |
r079a181 |
|
| 248 | 248 | static void video_del_buffer_filter( filter_t *p_filter, picture_t *p_pic ) |
|---|
| 249 | 249 | { |
|---|
| 250 | | (void)p_filter; |
|---|
| 251 | | if( p_pic && p_pic->p_data_orig ) free( p_pic->p_data_orig ); |
|---|
| 252 | | if( p_pic ) free( p_pic ); |
|---|
| | 250 | VLC_UNUSED(p_filter); |
|---|
| | 251 | if( p_pic ) |
|---|
| | 252 | { |
|---|
| | 253 | free( p_pic->p_data_orig ); |
|---|
| | 254 | free( p_pic ); |
|---|
| | 255 | } |
|---|
| 253 | 256 | } |
|---|
| 254 | 257 | |
|---|
| r99da87a |
r079a181 |
|
| 164 | 164 | { 44100, 48000, 32000, 22050, 24000, 16000 }; |
|---|
| 165 | 165 | |
|---|
| 166 | | static const int16_t mpeg4_default_intra_matrix[64] = { |
|---|
| | 166 | static const uint16_t mpeg4_default_intra_matrix[64] = { |
|---|
| 167 | 167 | 8, 17, 18, 19, 21, 23, 25, 27, |
|---|
| 168 | 168 | 17, 18, 19, 21, 23, 25, 27, 28, |
|---|
| … | … | |
| 175 | 175 | }; |
|---|
| 176 | 176 | |
|---|
| 177 | | static const int16_t mpeg4_default_non_intra_matrix[64] = { |
|---|
| | 177 | static const uint16_t mpeg4_default_non_intra_matrix[64] = { |
|---|
| 178 | 178 | 16, 17, 18, 19, 20, 21, 22, 23, |
|---|
| 179 | 179 | 17, 18, 19, 20, 21, 22, 23, 24, |
|---|
| r9d20efb |
r079a181 |
|
| 80 | 80 | /* Postprocessing module */ |
|---|
| 81 | 81 | void *E_(OpenPostproc)( decoder_t *, vlc_bool_t * ); |
|---|
| 82 | | int E_(InitPostproc)( decoder_t *, void *, int, int, int ); |
|---|
| 83 | | int E_(PostprocPict)( decoder_t *, void *, picture_t *, struct AVFrame * ); |
|---|
| | 82 | int E_(InitPostproc)( void *, int, int, int ); |
|---|
| | 83 | int E_(PostprocPict)( void *, picture_t *, struct AVFrame * ); |
|---|
| 84 | 84 | void E_(ClosePostproc)( decoder_t *, void * ); |
|---|
| 85 | 85 | |
|---|
| r99fab90 |
r079a181 |
|
| 123 | 123 | * InitPostproc: |
|---|
| 124 | 124 | *****************************************************************************/ |
|---|
| 125 | | int E_(InitPostproc)( decoder_t *p_dec, void *p_data, |
|---|
| 126 | | int i_width, int i_height, int pix_fmt ) |
|---|
| | 125 | int E_(InitPostproc)( void *p_data, int i_width, int i_height, int pix_fmt ) |
|---|
| 127 | 126 | { |
|---|
| 128 | 127 | video_postproc_sys_t *p_sys = (video_postproc_sys_t *)p_data; |
|---|
| … | … | |
| 174 | 173 | * PostprocPict: |
|---|
| 175 | 174 | *****************************************************************************/ |
|---|
| 176 | | int E_(PostprocPict)( decoder_t *p_dec, void *p_data, |
|---|
| 177 | | picture_t *p_pic, AVFrame *p_ff_pic ) |
|---|
| | 175 | int E_(PostprocPict)( void *p_data, picture_t *p_pic, AVFrame *p_ff_pic ) |
|---|
| 178 | 176 | { |
|---|
| 179 | 177 | video_postproc_sys_t *p_sys = (video_postproc_sys_t *)p_data; |
|---|
| … | … | |
| 225 | 223 | vlc_value_t oldval, vlc_value_t newval, void *p_data ) |
|---|
| 226 | 224 | { |
|---|
| | 225 | VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); |
|---|
| 227 | 226 | decoder_t *p_dec = (decoder_t *)p_this; |
|---|
| 228 | 227 | video_postproc_sys_t *p_sys = (video_postproc_sys_t *)p_data; |
|---|
| r99fab90 |
r079a181 |
|
| 206 | 206 | if( p_sys->p_pp && p_sys->b_pp && !p_sys->b_pp_init ) |
|---|
| 207 | 207 | { |
|---|
| 208 | | E_(InitPostproc)( p_dec, p_sys->p_pp, p_context->width, |
|---|
| | 208 | E_(InitPostproc)( p_sys->p_pp, p_context->width, |
|---|
| 209 | 209 | p_context->height, p_context->pix_fmt ); |
|---|
| 210 | 210 | p_sys->b_pp_init = VLC_TRUE; |
|---|
| … | … | |
| 806 | 806 | |
|---|
| 807 | 807 | if( p_sys->p_pp && p_sys->b_pp ) |
|---|
| 808 | | E_(PostprocPict)( p_dec, p_sys->p_pp, p_pic, p_ff_pic ); |
|---|
| | 808 | E_(PostprocPict)( p_sys->p_pp, p_pic, p_ff_pic ); |
|---|
| 809 | 809 | else |
|---|
| 810 | 810 | { |
|---|
| r99fab90 |
r079a181 |
|
| 224 | 224 | p_sys->b_stream_info = VLC_FALSE; |
|---|
| 225 | 225 | p_sys->p_block=NULL; |
|---|
| 226 | | p_sys->bytestream = block_BytestreamInit( p_dec ); |
|---|
| | 226 | p_sys->bytestream = block_BytestreamInit(); |
|---|
| 227 | 227 | |
|---|
| 228 | 228 | #ifdef USE_LIBFLAC |
|---|
| … | … | |
| 587 | 587 | unsigned *bytes, void *client_data ) |
|---|
| 588 | 588 | { |
|---|
| | 589 | VLC_UNUSED(decoder); |
|---|
| 589 | 590 | decoder_t *p_dec = (decoder_t *)client_data; |
|---|
| 590 | 591 | decoder_sys_t *p_sys = p_dec->p_sys; |
|---|
| … | … | |
| 614 | 615 | const FLAC__int32 *const buffer[], void *client_data ) |
|---|
| 615 | 616 | { |
|---|
| | 617 | VLC_UNUSED(decoder); |
|---|
| 616 | 618 | decoder_t *p_dec = (decoder_t *)client_data; |
|---|
| 617 | 619 | decoder_sys_t *p_sys = p_dec->p_sys; |
|---|
| … | … | |
| 649 | 651 | void *client_data ) |
|---|
| 650 | 652 | { |
|---|
| | 653 | VLC_UNUSED(decoder); |
|---|
| 651 | 654 | decoder_t *p_dec = (decoder_t *)client_data; |
|---|
| 652 | 655 | decoder_sys_t *p_sys = p_dec->p_sys; |
|---|
| … | … | |
| 698 | 701 | void *client_data ) |
|---|
| 699 | 702 | { |
|---|
| | 703 | VLC_UNUSED(decoder); |
|---|
| 700 | 704 | decoder_t *p_dec = (decoder_t *)client_data; |
|---|
| 701 | 705 | |
|---|
| … | … | |
| 1345 | 1349 | void *client_data ) |
|---|
| 1346 | 1350 | { |
|---|
| | 1351 | VLC_UNUSED(encoder); |
|---|
| 1347 | 1352 | encoder_t *p_enc = (encoder_t *)client_data; |
|---|
| 1348 | 1353 | |
|---|
| … | … | |
| 1360 | 1365 | unsigned current_frame, void *client_data ) |
|---|
| 1361 | 1366 | { |
|---|
| | 1367 | VLC_UNUSED(encoder); VLC_UNUSED(current_frame); |
|---|
| 1362 | 1368 | encoder_t *p_enc = (encoder_t *)client_data; |
|---|
| 1363 | 1369 | encoder_sys_t *p_sys = p_enc->p_sys; |
|---|
| r99fab90 |
r079a181 |
|
| 161 | 161 | p_sys->i_state = STATE_NOSYNC; |
|---|
| 162 | 162 | aout_DateSet( &p_sys->end_date, 0 ); |
|---|
| 163 | | p_sys->bytestream = block_BytestreamInit( p_dec ); |
|---|
| | 163 | p_sys->bytestream = block_BytestreamInit(); |
|---|
| 164 | 164 | p_sys->b_discontinuity = VLC_FALSE; |
|---|
| 165 | 165 | p_sys->i_input_rate = INPUT_RATE_DEFAULT; |
|---|
| r99fab90 |
r079a181 |
|
| 97 | 97 | { |
|---|
| 98 | 98 | block_t *p_block = (block_t *)png_get_io_ptr( p_png ); |
|---|
| 99 | | png_size_t i_read = __MIN( p_block->i_buffer, (int)i_length ); |
|---|
| | 99 | png_size_t i_read = __MIN( p_block->i_buffer, i_length ); |
|---|
| 100 | 100 | memcpy( data, p_block->p_buffer, i_length ); |
|---|
| 101 | 101 | p_block->p_buffer += i_length; |
|---|