Originally committed as revision 19442 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -479,12 +479,7 @@ static void modified_levinson_durbin(int *window, int window_entries, · 478 unmodified lines | ||
| 479 | 479 | |
| 480 | 480 | av_free(state); |
| 481 | 481 | } |
| 482 | −#endif /* CONFIG_SONIC_ENCODER || CONFIG_SONIC_LS_ENCODER */ | |
| 483 | 482 | |
| 484 | −static const int samplerate_table[] = | |
| 485 | − { 44100, 22050, 11025, 96000, 48000, 32000, 24000, 16000, 8000 }; | |
| 486 | − | |
| 487 | −#if CONFIG_SONIC_ENCODER || CONFIG_SONIC_LS_ENCODER | |
| 488 | 483 | static inline int code_samplerate(int samplerate) |
| 489 | 484 | { |
| 490 | 485 | switch (samplerate) |
| @@ -750,6 +745,9 @@ static int sonic_encode_frame(AVCodecContext *avctx, · 259 unmodified lines | ||
| 750 | 745 | #endif /* CONFIG_SONIC_ENCODER || CONFIG_SONIC_LS_ENCODER */ |
| 751 | 746 | |
| 752 | 747 | #if CONFIG_SONIC_DECODER |
| 748 | +static const int samplerate_table[] = | |
| 749 | + { 44100, 22050, 11025, 96000, 48000, 32000, 24000, 16000, 8000 }; | |
| 750 | + | |
| 753 | 751 | static av_cold int sonic_decode_init(AVCodecContext *avctx) |
| 754 | 752 | { |
| 755 | 753 | SonicContext *s = avctx->priv_data; |
| @@ -936,6 +934,18 @@ static int sonic_decode_frame(AVCodecContext *avctx, · 180 unmodified lines | ||
| 936 | 934 | |
| 937 | 935 | return (get_bits_count(&gb)+7)/8; |
| 938 | 936 | } |
| 937 | + | |
| 938 | +AVCodec sonic_decoder = { | |
| 939 | + "sonic", | |
| 940 | + CODEC_TYPE_AUDIO, | |
| 941 | + CODEC_ID_SONIC, | |
| 942 | + sizeof(SonicContext), | |
| 943 | + sonic_decode_init, | |
| 944 | + NULL, | |
| 945 | + sonic_decode_close, | |
| 946 | + sonic_decode_frame, | |
| 947 | + .long_name = NULL_IF_CONFIG_SMALL("Sonic"), | |
| 948 | +}; | |
| 939 | 949 | #endif /* CONFIG_SONIC_DECODER */ |
| 940 | 950 | |
| 941 | 951 | #if CONFIG_SONIC_ENCODER |
| @@ -965,17 +975,3 @@ AVCodec sonic_ls_encoder = { · 23 unmodified lines | ||
| 965 | 975 | .long_name = NULL_IF_CONFIG_SMALL("Sonic lossless"), |
| 966 | 976 | }; |
| 967 | 977 | #endif |
| 968 | − | |
| 969 | −#if CONFIG_SONIC_DECODER | |
| 970 | −AVCodec sonic_decoder = { | |
| 971 | − "sonic", | |
| 972 | − CODEC_TYPE_AUDIO, | |
| 973 | − CODEC_ID_SONIC, | |
| 974 | − sizeof(SonicContext), | |
| 975 | − sonic_decode_init, | |
| 976 | − NULL, | |
| 977 | − sonic_decode_close, | |
| 978 | − sonic_decode_frame, | |
| 979 | − .long_name = NULL_IF_CONFIG_SMALL("Sonic"), | |
| 980 | −}; | |
| 981 | −#endif | |