History

cosmetics: Move some code blocks to reduce the number of #ifdefs.

Originally committed as revision 19442 to svn://svn.ffmpeg.org/ffmpeg/trunk

Diego Biurrun committed 17 years ago

Commit 359a9971 parent 1eb08111 file · +15 −19Browse files

Unified · Split

libavcodec/sonic.c+15−19
@@ -479,12 +479,7 @@ static void modified_levinson_durbin(int *window, int window_entries, · 478 unmodified lines
479 479
480 av_free(state);480 av_free(state);
481}481}
482#endif /* CONFIG_SONIC_ENCODER || CONFIG_SONIC_LS_ENCODER */
483 482
484static const int samplerate_table[] =
485 { 44100, 22050, 11025, 96000, 48000, 32000, 24000, 16000, 8000 };
486
487#if CONFIG_SONIC_ENCODER || CONFIG_SONIC_LS_ENCODER
488static inline int code_samplerate(int samplerate)483static inline int code_samplerate(int samplerate)
489{484{
490 switch (samplerate)485 switch (samplerate)
@@ -750,6 +745,9 @@ static int sonic_encode_frame(AVCodecContext *avctx, · 259 unmodified lines
750#endif /* CONFIG_SONIC_ENCODER || CONFIG_SONIC_LS_ENCODER */745#endif /* CONFIG_SONIC_ENCODER || CONFIG_SONIC_LS_ENCODER */
751 746
752#if CONFIG_SONIC_DECODER747#if CONFIG_SONIC_DECODER
748static const int samplerate_table[] =
749 { 44100, 22050, 11025, 96000, 48000, 32000, 24000, 16000, 8000 };
750
753static av_cold int sonic_decode_init(AVCodecContext *avctx)751static av_cold int sonic_decode_init(AVCodecContext *avctx)
754{752{
755 SonicContext *s = avctx->priv_data;753 SonicContext *s = avctx->priv_data;
@@ -936,6 +934,18 @@ static int sonic_decode_frame(AVCodecContext *avctx, · 180 unmodified lines
936 934
937 return (get_bits_count(&gb)+7)/8;935 return (get_bits_count(&gb)+7)/8;
938}936}
937
938AVCodec 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#endif /* CONFIG_SONIC_DECODER */949#endif /* CONFIG_SONIC_DECODER */
940 950
941#if CONFIG_SONIC_ENCODER951#if CONFIG_SONIC_ENCODER
@@ -965,17 +975,3 @@ AVCodec sonic_ls_encoder = { · 23 unmodified lines
965 .long_name = NULL_IF_CONFIG_SMALL("Sonic lossless"),975 .long_name = NULL_IF_CONFIG_SMALL("Sonic lossless"),
966};976};
967#endif977#endif
968
969#if CONFIG_SONIC_DECODER
970AVCodec 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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t