comparison sonic.c @ 8590:7a463923ecd1 libavcodec

Change semantic of CONFIG_*, HAVE_* and ARCH_*. They are now always defined to either 0 or 1.
author aurel
date Tue, 13 Jan 2009 23:44:16 +0000
parents 6efb15a24e91
children e9d9d946f213
comparison
equal deleted inserted replaced
8589:a29b5b5c3c9d 8590:7a463923ecd1
406 state[0] = x; 406 state[0] = x;
407 407
408 return x; 408 return x;
409 } 409 }
410 410
411 #if defined(CONFIG_SONIC_ENCODER) || defined(CONFIG_SONIC_LS_ENCODER) 411 #if CONFIG_SONIC_ENCODER || CONFIG_SONIC_LS_ENCODER
412 // Heavily modified Levinson-Durbin algorithm which 412 // Heavily modified Levinson-Durbin algorithm which
413 // copes better with quantization, and calculates the 413 // copes better with quantization, and calculates the
414 // actual whitened result as it goes. 414 // actual whitened result as it goes.
415 415
416 static void modified_levinson_durbin(int *window, int window_entries, 416 static void modified_levinson_durbin(int *window, int window_entries,
477 #endif 477 #endif
478 } 478 }
479 479
480 av_free(state); 480 av_free(state);
481 } 481 }
482 #endif /* defined(CONFIG_SONIC_ENCODER) || defined(CONFIG_SONIC_LS_ENCODER) */ 482 #endif /* CONFIG_SONIC_ENCODER || CONFIG_SONIC_LS_ENCODER */
483 483
484 static const int samplerate_table[] = 484 static const int samplerate_table[] =
485 { 44100, 22050, 11025, 96000, 48000, 32000, 24000, 16000, 8000 }; 485 { 44100, 22050, 11025, 96000, 48000, 32000, 24000, 16000, 8000 };
486 486
487 #if defined(CONFIG_SONIC_ENCODER) || defined(CONFIG_SONIC_LS_ENCODER) 487 #if CONFIG_SONIC_ENCODER || CONFIG_SONIC_LS_ENCODER
488 static inline int code_samplerate(int samplerate) 488 static inline int code_samplerate(int samplerate)
489 { 489 {
490 switch (samplerate) 490 switch (samplerate)
491 { 491 {
492 case 44100: return 0; 492 case 44100: return 0;
745 // av_log(avctx, AV_LOG_DEBUG, "used bytes: %d\n", (put_bits_count(&pb)+7)/8); 745 // av_log(avctx, AV_LOG_DEBUG, "used bytes: %d\n", (put_bits_count(&pb)+7)/8);
746 746
747 flush_put_bits(&pb); 747 flush_put_bits(&pb);
748 return (put_bits_count(&pb)+7)/8; 748 return (put_bits_count(&pb)+7)/8;
749 } 749 }
750 #endif /* defined(CONFIG_SONIC_ENCODER) || defined(CONFIG_SONIC_LS_ENCODER) */ 750 #endif /* CONFIG_SONIC_ENCODER || CONFIG_SONIC_LS_ENCODER */
751 751
752 #ifdef CONFIG_SONIC_DECODER 752 #if CONFIG_SONIC_DECODER
753 static av_cold int sonic_decode_init(AVCodecContext *avctx) 753 static av_cold int sonic_decode_init(AVCodecContext *avctx)
754 { 754 {
755 SonicContext *s = avctx->priv_data; 755 SonicContext *s = avctx->priv_data;
756 GetBitContext gb; 756 GetBitContext gb;
757 int i, version; 757 int i, version;
934 934
935 return (get_bits_count(&gb)+7)/8; 935 return (get_bits_count(&gb)+7)/8;
936 } 936 }
937 #endif /* CONFIG_SONIC_DECODER */ 937 #endif /* CONFIG_SONIC_DECODER */
938 938
939 #ifdef CONFIG_SONIC_ENCODER 939 #if CONFIG_SONIC_ENCODER
940 AVCodec sonic_encoder = { 940 AVCodec sonic_encoder = {
941 "sonic", 941 "sonic",
942 CODEC_TYPE_AUDIO, 942 CODEC_TYPE_AUDIO,
943 CODEC_ID_SONIC, 943 CODEC_ID_SONIC,
944 sizeof(SonicContext), 944 sizeof(SonicContext),
948 NULL, 948 NULL,
949 .long_name = NULL_IF_CONFIG_SMALL("Sonic"), 949 .long_name = NULL_IF_CONFIG_SMALL("Sonic"),
950 }; 950 };
951 #endif 951 #endif
952 952
953 #ifdef CONFIG_SONIC_LS_ENCODER 953 #if CONFIG_SONIC_LS_ENCODER
954 AVCodec sonic_ls_encoder = { 954 AVCodec sonic_ls_encoder = {
955 "sonicls", 955 "sonicls",
956 CODEC_TYPE_AUDIO, 956 CODEC_TYPE_AUDIO,
957 CODEC_ID_SONIC_LS, 957 CODEC_ID_SONIC_LS,
958 sizeof(SonicContext), 958 sizeof(SonicContext),
962 NULL, 962 NULL,
963 .long_name = NULL_IF_CONFIG_SMALL("Sonic lossless"), 963 .long_name = NULL_IF_CONFIG_SMALL("Sonic lossless"),
964 }; 964 };
965 #endif 965 #endif
966 966
967 #ifdef CONFIG_SONIC_DECODER 967 #if CONFIG_SONIC_DECODER
968 AVCodec sonic_decoder = { 968 AVCodec sonic_decoder = {
969 "sonic", 969 "sonic",
970 CODEC_TYPE_AUDIO, 970 CODEC_TYPE_AUDIO,
971 CODEC_ID_SONIC, 971 CODEC_ID_SONIC,
972 sizeof(SonicContext), 972 sizeof(SonicContext),