diff --git a/examples/Makefile.am b/examples/Makefile.am index 289e219..fe66a21 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -22,7 +22,7 @@ dump_psnr_LDADD = $(GETOPT_OBJS) $(LDADDDEC) -lm player_example_SOURCES = player_example.c player_example_CFLAGS = $(SDL_CFLAGS) $(OGG_CFLAGS) $(VORBIS_CFLAGS) -player_example_LDADD = $(LDADDDEC) $(SDL_LIBS) $(VORBIS_LIBS) $(OSS_LIBS) -lm +player_example_LDADD = $(LDADDDEC) $(SDL_LIBS) $(VORBIS_LIBS) $(OSS_LIBS) encoder_example_SOURCES = encoder_example.c EXTRA_encoder_example_SOURCES = getopt.c getopt1.c getopt.h diff --git a/examples/encoder_example.c b/examples/encoder_example.c index e0e08d3..4b73b64 100644 --- a/examples/encoder_example.c +++ b/examples/encoder_example.c @@ -51,6 +51,14 @@ /*supply missing headers and functions to Win32. going to hell, I know*/ #include #include + +static double rint(double x) +{ + if (x < 0.0) + return (double)(int)(x - 0.5); + else + return (double)(int)(x + 0.5); +} #endif const char *optstring = "b:e:o:a:A:v:V:s:S:f:F:ck:d:z:\1\2\3\4"; diff --git a/examples/png2theora.c b/examples/png2theora.c index ed24c2a..71a0d0f 100644 --- a/examples/png2theora.c +++ b/examples/png2theora.c @@ -462,9 +462,9 @@ png_read(const char *pathname, unsigned int *w, unsigned int *h, unsigned char * png_set_strip_alpha(png_ptr); row_data = (png_bytep)png_malloc(png_ptr, - 3*height*width*sizeof(*row_data)); + 3*height*width*png_sizeof(*row_data)); row_pointers = (png_bytep *)png_malloc(png_ptr, - height*sizeof(*row_pointers)); + height*png_sizeof(*row_pointers)); for(y = 0; y < height; y++) { row_pointers[y] = row_data + y*(3*width); } diff --git a/lib/Makefile.am b/lib/Makefile.am index 8cd665c..89ce261 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -153,7 +153,6 @@ libtheoraenc_la_SOURCES = \ libtheoraenc_la_LDFLAGS = \ -version-info @THENC_LIB_CURRENT@:@THENC_LIB_REVISION@:@THENC_LIB_AGE@ \ @THEORAENC_LDFLAGS@ $(OGG_LIBS) -libtheoraenc_la_LIBADD = libtheoradec.la libtheora_la_SOURCES = \ $(decoder_sources) \ diff --git a/lib/decode.c b/lib/decode.c index bde967b..7be6646 100644 --- a/lib/decode.c +++ b/lib/decode.c @@ -397,10 +397,10 @@ static int oc_dec_init(oc_dec_ctx *_dec,const th_info *_info, int qsum; qsum=0; for(qti=0;qti<2;qti++)for(pli=0;pli<3;pli++){ - qsum+=_dec->state.dequant_tables[qi][pli][qti][12]+ - _dec->state.dequant_tables[qi][pli][qti][17]+ - _dec->state.dequant_tables[qi][pli][qti][18]+ - _dec->state.dequant_tables[qi][pli][qti][24]<<(pli==0); + qsum+=_dec->state.dequant_tables[qti][pli][qi][12]+ + _dec->state.dequant_tables[qti][pli][qi][17]+ + _dec->state.dequant_tables[qti][pli][qi][18]+ + _dec->state.dequant_tables[qti][pli][qi][24]<<(pli==0); } _dec->pp_sharp_mod[qi]=-(qsum>>11); } diff --git a/win32/experimental/transcoder/transcoder_example.c b/win32/experimental/transcoder/transcoder_example.c index 3923b44..28c2b52 100644 --- a/win32/experimental/transcoder/transcoder_example.c +++ b/win32/experimental/transcoder/transcoder_example.c @@ -37,6 +37,14 @@ /*supply missing headers and functions to Win32. going to hell, I know*/ #include #include + +static double rint(double x) +{ + if (x < 0.0) + return (double)(int)(x - 0.5); + else + return (double)(int)(x + 0.5); +} #endif /*Copied from vorbis/sharedbook.c*/