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
479479
480480 av_free(state);
481481 }
482−#endif /* CONFIG_SONIC_ENCODER || CONFIG_SONIC_LS_ENCODER */
483482
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
488483 static inline int code_samplerate(int samplerate)
489484 {
490485 switch (samplerate)
@@ -750,6 +745,9 @@ static int sonic_encode_frame(AVCodecContext *avctx, · 259 unmodified lines
750745 #endif /* CONFIG_SONIC_ENCODER || CONFIG_SONIC_LS_ENCODER */
751746
752747 #if CONFIG_SONIC_DECODER
748+static const int samplerate_table[] =
749+ { 44100, 22050, 11025, 96000, 48000, 32000, 24000, 16000, 8000 };
750+
753751 static av_cold int sonic_decode_init(AVCodecContext *avctx)
754752 {
755753 SonicContext *s = avctx->priv_data;
@@ -936,6 +934,18 @@ static int sonic_decode_frame(AVCodecContext *avctx, · 180 unmodified lines
936934
937935 return (get_bits_count(&gb)+7)/8;
938936 }
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+};
939949 #endif /* CONFIG_SONIC_DECODER */
940950
941951 #if CONFIG_SONIC_ENCODER
@@ -965,17 +975,3 @@ AVCodec sonic_ls_encoder = { · 23 unmodified lines
965975 .long_name = NULL_IF_CONFIG_SMALL("Sonic lossless"),
966976 };
967977 #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

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