Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comment
  • views

liboggvorbis as a single-file

Sign in to follow this  


liboggvorbis combined into one file - might be usefull if you want to simpifie dependencies of your project. 

Get it here.

-rw-r--r--  1 piecuchp  staff   2.0M Apr 26 17:55 oggvorbis.c
-rw-r--r--  1 piecuchp  staff   134K Apr 26 17:55 oggvorbis.h
-rw-r--r--  1 piecuchp  staff   3.1M Apr 26 17:55 oggvorbis.o


Combining script is quite complex and not well commented (also I might make some changes into source code that I don't recall right now) but maybe someone find it usefull:


 lib/codebook.h lib/mdct.h lib/envelope.h lib/smallft.h lib/codec_internal.h lib/lookup.h lib/lookup_data.h lib/lpc.h lib/lsp.h lib/masking.h lib/misc.h lib/os.h lib/registry.h lib/scales.h lib/window.h\
 lib/books/floor/floor_books.h lib/books/coupled/res_books_stereo.h lib/books/uncoupled/res_books_uncoupled.h lib/books/coupled/res_books_51.h\
 lib/analysis.c lib/bitrate.c lib/block.c lib/codebook.c lib/envelope.c lib/floor0.c lib/floor1.c lib/info.c lib/lookup.c lib/lpc.c lib/lsp.c lib/mapping0.c lib/mdct.c lib/psy.c lib/registry.c lib/res0.c lib/sharedbook.c lib/smallft.c lib/synthesis.c lib/vorbisenc.c lib/vorbisfile.c lib/window.c\
 include/ogg/config_types.h include/ogg/os_types.h include/ogg/ogg.h\
 lib/ogg/bitwise.c lib/ogg/framing.c\
 include/vorbis/codec.h include/vorbis/vorbisenc.h include/vorbis/vorbisfile.h\

mkdir -p lib-portable



echo "/** $0: `date`*/" > "$C"
echo "" >> "$C"
echo "_#include \"oggvorbis.h\"" >> "$C"
echo "" >> "$C"
echo "#define _BUILD_SINGLE_SOURCE" >> "$C"
echo "#ifdef __cplusplus" >> "$C"
echo "# define restrict __restrict__" >> "$C"
echo "#endif" >> "$C"
echo "" >> "$C"

echo "/** $0: `date`*/" > "$H"
echo "" >> "$H"


for c in $src_c; do
  if [ -e "$c" ]; then
    echo "/** $0: $c*/" >> "$C"
    echo "" >> "$C"
    #line=`cat "$C"|wc -l`
    echo "#line $line_offset \"$c\"" >> "$C"
    cat $c \
            | sed "s/\([^_]\)ilog/\1ilog${cnt}/g" \
            | sed "s/FLOOR1_fromdB_LOOKUP/FLOOR1_fromdB_LOOKUP${cnt}/g" \
            | sed "s/bitreverse/bitreverse${cnt}/g" \
        >> "$C"
    echo "" >> "$C"
    echo -n "."
    # use '' for space
    echo "" >> "$C"
    echo "${c//\'\'/ }" >> "$C"
    echo "" >> "$C"
    echo -n "_"

for h in $src_h; do
  if [ -e "$h" ]; then
    echo "/** $0: $h*/" >> "$H"
    echo "" >> "$H"
    echo "#line $line_offset \"$h\"" >> "$H"
    cat $h >> "$H"
    echo "" >> "$H"
    echo -n "."
    # use '' for space
    echo "" >> "$H"
    echo "${h//\'\'/ }" >> "$H"
    echo "" >> "$H"
    echo -n "_"

for i in lib/modes/*.h; do
    inl=`basename "$i"`
    sed -i "" -e "/#include \"modes\/$inl\"/r $i" -e "/#include \"modes\/$inl\"/d" "$C"
    echo -n "@"

echo ""

sed -i "" -e "/^#\(.*\)include \".*\.h\".*$/d" "$H"
sed -i "" -e "/^#\(.*\)include \<ogg\/.*\.h\>.*$/d" "$H" "$C"
sed -i "" -e "/#include_inline \"psy.h\"/r lib/psy.h" -e "/#include_inline \"psy.h\"/d" "$C"
sed -i "" -e "/#include_inline \"bitrate.h\"/r lib/bitrate.h" -e "/#include_inline \"bitrate.h\"/d" "$C"
sed -i "" -e "/#include_inline \"highlevel.h\"/r lib/highlevel.h" -e "/#include_inline \"highlevel.h\"/d" "$C"
sed -i "" -e "/#include_inline \"backends.h\"/r lib/backends.h" -e "/#include_inline \"backends.h\"/d" "$C"
sed -i "" -e "/#include_inline \"asm_arm.h\"/r tremor/asm_arm.h" -e "/#include_inline \"asm_arm.h\"/d" "$C"
sed -i "" -e "/# include \"collect.c\"/r theora/lib/collect.c" -e "/# include \"collect.c\"/d" "$C"
sed -i "" -e "/^#\(.*\)include \".*\.h\".*$/d" "$C"
sed -i "" -e "/^#\(.*\)include \<theora\/.*\.h\>.*$/d" "$C"

sed -i "" -e "s/^_#/#/" "$C"

echo "** Done (with $cnt files)"


Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Advertisement
  • Blog Entries

  • Similar Content

    • By Rob_I
      I have a specific need to launch a game from an existing app.  Has anyone come across a game engine that can be built in this way?  Any help would be appreciated.
      Thank you!
    • By Brizzler
      Hey Everyone, 
      I'd like to review some of your indies games! I'm interested in games made for the Universal Windows Platform (UWP).
      Reply to this post if your interested in having your games reviewed and youtubed on my channel:
    • By G-Dot
      Hello, everyone. There ara a little misunderstood, which I've resieved after spending some time working on a little bit more complex UI than I did usually. So my misunderstanding: what should I use to update from one widget to another: "Remove all widgets" or "Set widget visibility" or there is not much difference beetwen them in perfomance? 
    • By Ivan Rusch
      Hello everyone! I´m new here so please forgive me any nonsense i could say, if i say any. 
      So, currently i´m studying game design to start doing games. So far so well. I want to be a game designer and creative director if posible. The thing is that, from there, i don´t know what else to do. Like, when i´m done with the game design course, what things can i add? 
      I must clarify: Besides game design, i write, so i have that covered. I like to illustrate and do concept art, but here´s the problem, i´m not very good at those things. I don´t really like programming, but i´d like to know a bit about it, just to... know. Or be able to use some engine by myself, like Unity or Unreal or etc. 
      I know this is kinda confusing, but that´s because i´m confused as well. Want to add things to do my own proyects. What´s the standard path to follow after game design? Should i go with art and illustration? Or do programing first?   Or any other things you can tell me? 
      Thanks in advance!
    • By Omerta7486
      Hello everyone,
      I have a strange problem. I have been coding C++ with CodeBlocks 17.12 using SDL 2.0.8 and SDL Image 2.0.3. I have been using MingGW and the GCC GNU compiler. When I run my app in CodeBlocks under either Debug or Release it runs fine, but when I go to my Release output folder and double click my EXE, it merely opens and immediately closes. I have the SDL and SDL image dlls in the folder with my release build, and I'm not getting errors that any dlls are missing. This is strange!
      Help would be much appreciated,
      Thank you,

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!