diff -urp flac-1.2.1-old/src/libFLAC/bitreader.c flac-1.2.1/src/libFLAC/bitreader.c --- flac-1.2.1-old/src/libFLAC/bitreader.c 2007-09-11 06:48:55.000000000 +0200 +++ flac-1.2.1/src/libFLAC/bitreader.c 2007-09-20 22:54:45.000000000 +0200 @@ -804,7 +804,7 @@ FLAC__bool FLAC__bitreader_read_rice_sig /* this is by far the most heavily used reader call. it ain't pretty but it's fast */ /* a lot of the logic is copied, then adapted, from FLAC__bitreader_read_unary_unsigned() and FLAC__bitreader_read_raw_uint32() */ -FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter) +FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter, unsigned crc16[]) /* OPT: possibly faster version for use with MSVC */ #ifdef _MSC_VER { diff -urp flac-1.2.1-old/src/libFLAC/ia32/bitreader_asm.nasm flac-1.2.1/src/libFLAC/ia32/bitreader_asm.nasm --- flac-1.2.1-old/src/libFLAC/ia32/bitreader_asm.nasm 2007-03-30 02:54:53.000000000 +0200 +++ flac-1.2.1/src/libFLAC/ia32/bitreader_asm.nasm 2007-09-20 22:55:12.000000000 +0200 @@ -34,7 +34,6 @@ data_section -cextern FLAC__crc16_table ; unsigned FLAC__crc16_table[256]; cextern bitreader_read_from_client_ ; FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br); cglobal FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap @@ -44,7 +43,7 @@ cglobal FLAC__bitreader_read_rice_signed ; ********************************************************************** ; -; void FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter) +; void FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter, unsigned crc16[]) ; ; Some details like assertions and other checking is performed by the caller. ALIGN 16 @@ -58,6 +57,7 @@ cident FLAC__bitreader_read_rice_signed_ ; the above two asserts also guarantee that the binary part never straddles more than 2 words, so we don't have to loop to read it ;; peppered throughout the code at major checkpoints are keys like this as to where things are at that point in time + ;; [esp + 20] unsigned crc16[] ;; [esp + 16] unsigned parameter ;; [esp + 12] unsigned nvals ;; [esp + 8] int vals[] @@ -137,11 +137,7 @@ cident FLAC__bitreader_read_rice_signed_ bswap edx ; edx = br->buffer[cwords] swapped; now we can CRC the bytes from LSByte to MSByte which makes things much easier mov ecx, [ebp + 28] ; ecx <- br->crc16_align mov eax, [ebp + 24] ; ax <- br->read_crc (a.k.a. crc) -%ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE - mov edi, _FLAC__crc16_table -%else - mov edi, FLAC__crc16_table -%endif + mov edi, [esp + 20] ; edi <- FLAC__crc16_table ;; eax (ax) crc a.k.a. br->read_crc ;; ebx (bl) intermediate result index into FLAC__crc16_table[] ;; ecx br->crc16_align @@ -213,11 +209,7 @@ cident FLAC__bitreader_read_rice_signed_ bswap edx ; edx = br->buffer[cwords] swapped; now we can CRC the bytes from LSByte to MSByte which makes things much easier mov ecx, [ebp + 28] ; ecx <- br->crc16_align mov eax, [ebp + 24] ; ax <- br->read_crc (a.k.a. crc) -%ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE - mov edi, _FLAC__crc16_table -%else - mov edi, FLAC__crc16_table -%endif + mov edi, [esp + 20] ; edi <- FLAC__crc16_table ;; eax (ax) crc a.k.a. br->read_crc ;; ebx (bl) intermediate result index into FLAC__crc16_table[] ;; ecx br->crc16_align @@ -315,8 +307,12 @@ cident FLAC__bitreader_read_rice_signed_ %ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE call _bitreader_read_from_client_ %else +%ifdef OBJ_FORMAT_elf + call bitreader_read_from_client_ wrt ..plt +%else call bitreader_read_from_client_ %endif +%endif pop edx ; /* discard, unused */ pop ecx ; /* restore */ mov esi, [ebp + 16] ; cwords = br->consumed_words; @@ -366,8 +362,12 @@ cident FLAC__bitreader_read_rice_signed_ %ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE call _bitreader_read_from_client_ %else +%ifdef OBJ_FORMAT_elf + call bitreader_read_from_client_ wrt ..plt +%else call bitreader_read_from_client_ %endif +%endif pop edx ; /* discard, unused */ pop ecx ; /* restore */ mov esi, [ebp + 16] ; cwords = br->consumed_words; @@ -434,11 +434,7 @@ cident FLAC__bitreader_read_rice_signed_ bswap edx ; edx = br->buffer[cwords] swapped; now we can CRC the bytes from LSByte to MSByte which makes things much easier mov ecx, [ebp + 28] ; ecx <- br->crc16_align mov eax, [ebp + 24] ; ax <- br->read_crc (a.k.a. crc) -%ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE - mov edi, _FLAC__crc16_table -%else - mov edi, FLAC__crc16_table -%endif + mov edi, [esp + 20] ; edi <- FLAC__crc16_table ;; eax (ax) crc a.k.a. br->read_crc ;; ebx (bl) intermediate result index into FLAC__crc16_table[] ;; ecx br->crc16_align diff -urp flac-1.2.1-old/src/libFLAC/ia32/stream_encoder_asm.nasm flac-1.2.1/src/libFLAC/ia32/stream_encoder_asm.nasm --- flac-1.2.1-old/src/libFLAC/ia32/stream_encoder_asm.nasm 2007-06-19 22:01:27.000000000 +0200 +++ flac-1.2.1/src/libFLAC/ia32/stream_encoder_asm.nasm 2007-09-20 22:54:45.000000000 +0200 @@ -41,7 +41,7 @@ cglobal precompute_partition_info_sums_3 ; ********************************************************************** ; -; void FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter) +; void FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter, unsigned crc16[]) ; void precompute_partition_info_sums_32bit_( ; const FLAC__int32 residual[], ; FLAC__uint64 abs_residual_partition_sums[], diff -urp flac-1.2.1-old/src/libFLAC/include/private/bitreader.h flac-1.2.1/src/libFLAC/include/private/bitreader.h --- flac-1.2.1-old/src/libFLAC/include/private/bitreader.h 2007-07-10 22:22:19.000000000 +0200 +++ flac-1.2.1/src/libFLAC/include/private/bitreader.h 2007-09-20 22:54:45.000000000 +0200 @@ -80,11 +80,11 @@ FLAC__bool FLAC__bitreader_skip_byte_blo FLAC__bool FLAC__bitreader_read_byte_block_aligned_no_crc(FLAC__BitReader *br, FLAC__byte *val, unsigned nvals); /* WATCHOUT: does not CRC the read data! */ FLAC__bool FLAC__bitreader_read_unary_unsigned(FLAC__BitReader *br, unsigned *val); FLAC__bool FLAC__bitreader_read_rice_signed(FLAC__BitReader *br, int *val, unsigned parameter); -FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter); +FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter, unsigned crc16[]); #ifndef FLAC__NO_ASM # ifdef FLAC__CPU_IA32 # ifdef FLAC__HAS_NASM -FLAC__bool FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter); +FLAC__bool FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter, unsigned crc16[]); # endif # endif #endif diff -urp flac-1.2.1-old/src/libFLAC/stream_decoder.c flac-1.2.1/src/libFLAC/stream_decoder.c --- flac-1.2.1-old/src/libFLAC/stream_decoder.c 2007-09-13 17:38:05.000000000 +0200 +++ flac-1.2.1/src/libFLAC/stream_decoder.c 2007-09-20 22:54:45.000000000 +0200 @@ -167,7 +167,7 @@ typedef struct FLAC__StreamDecoderPrivat void (*local_lpc_restore_signal_16bit)(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); /* for use when the signal is <= 16 bits-per-sample, or <= 15 bits-per-sample on a side channel (which requires 1 extra bit), AND order <= 8: */ void (*local_lpc_restore_signal_16bit_order8)(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); - FLAC__bool (*local_bitreader_read_rice_signed_block)(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter); + FLAC__bool (*local_bitreader_read_rice_signed_block)(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter, unsigned crc16[]); void *client_data; FILE *file; /* only used if FLAC__stream_decoder_init_file()/FLAC__stream_decoder_init_file() called, else NULL */ FLAC__BitReader *input; @@ -2750,7 +2750,7 @@ FLAC__bool read_residual_partitioned_ric if(rice_parameter < pesc) { partitioned_rice_contents->raw_bits[partition] = 0; u = (partition_order == 0 || partition > 0)? partition_samples : partition_samples - predictor_order; - if(!decoder->private_->local_bitreader_read_rice_signed_block(decoder->private_->input, residual + sample, u, rice_parameter)) + if(!decoder->private_->local_bitreader_read_rice_signed_block(decoder->private_->input, residual + sample, u, rice_parameter, FLAC__crc16_table)) return false; /* read_callback_ sets the state for us */ sample += u; }