Mercurial > mplayer.hg
comparison libaf/af_format.c @ 36391:3b1fb70800f4
Add some "const" to input-only pointers.
author | reimar |
---|---|
date | Fri, 25 Oct 2013 19:59:59 +0000 |
parents | e79bac50b920 |
children | 06cf8a9249f7 |
comparison
equal
deleted
inserted
replaced
36390:ac6843fb4f01 | 36391:3b1fb70800f4 |
---|---|
43 ulaw and alaw */ | 43 ulaw and alaw */ |
44 #include "af_format_ulaw.h" | 44 #include "af_format_ulaw.h" |
45 #include "af_format_alaw.h" | 45 #include "af_format_alaw.h" |
46 | 46 |
47 // Switch endianness | 47 // Switch endianness |
48 static void endian(void* in, void* out, int len, int bps); | 48 static void endian(const void* in, void* out, int len, int bps); |
49 // From signed to unsigned and the other way | 49 // From signed to unsigned and the other way |
50 static void si2us(void* data, int len, int bps); | 50 static void si2us(void* data, int len, int bps); |
51 // Change the number of bits per sample | 51 // Change the number of bits per sample |
52 static void change_bps(void* in, void* out, int len, int inbps, int outbps); | 52 static void change_bps(const void* in, void* out, int len, int inbps, int outbps); |
53 // From float to int signed | 53 // From float to int signed |
54 static void float2int(float* in, void* out, int len, int bps); | 54 static void float2int(const float* in, void* out, int len, int bps); |
55 // From signed int to float | 55 // From signed int to float |
56 static void int2float(void* in, float* out, int len, int bps); | 56 static void int2float(const void* in, float* out, int len, int bps); |
57 | 57 |
58 static af_data_t* play(struct af_instance_s* af, af_data_t* data); | 58 static af_data_t* play(struct af_instance_s* af, af_data_t* data); |
59 static af_data_t* play_swapendian(struct af_instance_s* af, af_data_t* data); | 59 static af_data_t* play_swapendian(struct af_instance_s* af, af_data_t* data); |
60 static af_data_t* play_float_s16(struct af_instance_s* af, af_data_t* data); | 60 static af_data_t* play_float_s16(struct af_instance_s* af, af_data_t* data); |
61 static af_data_t* play_s16_float(struct af_instance_s* af, af_data_t* data); | 61 static af_data_t* play_s16_float(struct af_instance_s* af, af_data_t* data); |
343 "", | 343 "", |
344 AF_FLAGS_REENTRANT, | 344 AF_FLAGS_REENTRANT, |
345 af_open | 345 af_open |
346 }; | 346 }; |
347 | 347 |
348 static inline uint32_t load24bit(void* data, int pos) { | 348 static inline uint32_t load24bit(const void* data, int pos) { |
349 #if HAVE_BIGENDIAN | 349 #if HAVE_BIGENDIAN |
350 return (((uint32_t)((uint8_t*)data)[3*pos])<<24) | | 350 return (((uint32_t)((uint8_t*)data)[3*pos])<<24) | |
351 (((uint32_t)((uint8_t*)data)[3*pos+1])<<16) | | 351 (((uint32_t)((uint8_t*)data)[3*pos+1])<<16) | |
352 (((uint32_t)((uint8_t*)data)[3*pos+2])<<8); | 352 (((uint32_t)((uint8_t*)data)[3*pos+2])<<8); |
353 #else | 353 #else |
368 ((uint8_t*)data)[3*pos+2]=expanded_value>>24; | 368 ((uint8_t*)data)[3*pos+2]=expanded_value>>24; |
369 #endif | 369 #endif |
370 } | 370 } |
371 | 371 |
372 // Function implementations used by play | 372 // Function implementations used by play |
373 static void endian(void* in, void* out, int len, int bps) | 373 static void endian(const void* in, void* out, int len, int bps) |
374 { | 374 { |
375 register int i; | 375 register int i; |
376 switch(bps){ | 376 switch(bps){ |
377 case(2):{ | 377 case(2):{ |
378 for(i=0;i<len;i++){ | 378 for(i=0;i<len;i++){ |
411 do { | 411 do { |
412 p[i] ^= 0x80; | 412 p[i] ^= 0x80; |
413 } while (i += bps); | 413 } while (i += bps); |
414 } | 414 } |
415 | 415 |
416 static void change_bps(void* in, void* out, int len, int inbps, int outbps) | 416 static void change_bps(const void* in, void* out, int len, int inbps, int outbps) |
417 { | 417 { |
418 register int i; | 418 register int i; |
419 switch(inbps){ | 419 switch(inbps){ |
420 case(1): | 420 case(1): |
421 switch(outbps){ | 421 switch(outbps){ |
482 } | 482 } |
483 break; | 483 break; |
484 } | 484 } |
485 } | 485 } |
486 | 486 |
487 static void float2int(float* in, void* out, int len, int bps) | 487 static void float2int(const float* in, void* out, int len, int bps) |
488 { | 488 { |
489 float f; | 489 float f; |
490 register int i; | 490 register int i; |
491 switch(bps){ | 491 switch(bps){ |
492 case(1): | 492 case(1): |
517 } | 517 } |
518 break; | 518 break; |
519 } | 519 } |
520 } | 520 } |
521 | 521 |
522 static void int2float(void* in, float* out, int len, int bps) | 522 static void int2float(const void* in, float* out, int len, int bps) |
523 { | 523 { |
524 register int i; | 524 register int i; |
525 switch(bps){ | 525 switch(bps){ |
526 case(1): | 526 case(1): |
527 for(i=0;i<len;i++) | 527 for(i=0;i<len;i++) |