View | Details | Raw Unified
Collapse All | Expand All

(-) flac-1.2.1-old/src/libFLAC/bitreader.c (-1 / +1 lines)
 Lines 804-810   FLAC__bool FLAC__bitreader_read_rice_sig Link Here 
/* this is by far the most heavily used reader call.  it ain't pretty but it's fast */
/* 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() */
/* 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 */
/* OPT: possibly faster version for use with MSVC */
#ifdef _MSC_VER
#ifdef _MSC_VER
{
{
(-) flac-1.2.1-old/src/libFLAC/ia32/bitreader_asm.nasm (-17 / +13 lines)
 Lines 34-40    Link Here 
	data_section
	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);
cextern bitreader_read_from_client_	; FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br);
cglobal FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap
cglobal FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap
 Lines 44-50   cglobal FLAC__bitreader_read_rice_signed Link Here 
; **********************************************************************
; **********************************************************************
;
;
; 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.
; Some details like assertions and other checking is performed by the caller.
	ALIGN 16
	ALIGN 16
 Lines 58-63   cident FLAC__bitreader_read_rice_signed_ Link Here 
	; 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
	; 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
	;; 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 + 16]	unsigned parameter
	;; [esp + 12]	unsigned nvals
	;; [esp + 12]	unsigned nvals
	;; [esp + 8]	int vals[]
	;; [esp + 8]	int vals[]
 Lines 137-147   cident FLAC__bitreader_read_rice_signed_ Link Here 
	bswap	edx			;		edx = br->buffer[cwords] swapped; now we can CRC the bytes from LSByte to MSByte which makes things much easier
	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	ecx, [ebp + 28]		;		ecx <- br->crc16_align
	mov	eax, [ebp + 24]		;		ax <- br->read_crc (a.k.a. crc)
	mov	eax, [ebp + 24]		;		ax <- br->read_crc (a.k.a. crc)
%ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE
	mov	edi, [esp + 20]		;		edi <- FLAC__crc16_table
	mov	edi, _FLAC__crc16_table
%else
	mov	edi, FLAC__crc16_table
%endif
	;; eax (ax)	crc a.k.a. br->read_crc
	;; eax (ax)	crc a.k.a. br->read_crc
	;; ebx (bl)	intermediate result index into FLAC__crc16_table[]
	;; ebx (bl)	intermediate result index into FLAC__crc16_table[]
	;; ecx		br->crc16_align
	;; ecx		br->crc16_align
 Lines 213-223   cident FLAC__bitreader_read_rice_signed_ Link Here 
	bswap	edx			;		edx = br->buffer[cwords] swapped; now we can CRC the bytes from LSByte to MSByte which makes things much easier
	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	ecx, [ebp + 28]		;		ecx <- br->crc16_align
	mov	eax, [ebp + 24]		;		ax <- br->read_crc (a.k.a. crc)
	mov	eax, [ebp + 24]		;		ax <- br->read_crc (a.k.a. crc)
%ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE
	mov	edi, [esp + 20]		;		edi <- FLAC__crc16_table
	mov	edi, _FLAC__crc16_table
%else
	mov	edi, FLAC__crc16_table
%endif
	;; eax (ax)	crc a.k.a. br->read_crc
	;; eax (ax)	crc a.k.a. br->read_crc
	;; ebx (bl)	intermediate result index into FLAC__crc16_table[]
	;; ebx (bl)	intermediate result index into FLAC__crc16_table[]
	;; ecx		br->crc16_align
	;; ecx		br->crc16_align
 Lines 315-322   cident FLAC__bitreader_read_rice_signed_ Link Here 
%ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE
%ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE
	call	_bitreader_read_from_client_
	call	_bitreader_read_from_client_
%else
%else
%ifdef OBJ_FORMAT_elf
	call	bitreader_read_from_client_ wrt ..plt
%else
	call	bitreader_read_from_client_
	call	bitreader_read_from_client_
%endif
%endif
%endif
	pop	edx			;     /* discard, unused */
	pop	edx			;     /* discard, unused */
	pop	ecx			;     /* restore */
	pop	ecx			;     /* restore */
	mov	esi, [ebp + 16]		;     cwords = br->consumed_words;
	mov	esi, [ebp + 16]		;     cwords = br->consumed_words;
 Lines 366-373   cident FLAC__bitreader_read_rice_signed_ Link Here 
%ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE
%ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE
	call	_bitreader_read_from_client_
	call	_bitreader_read_from_client_
%else
%else
%ifdef OBJ_FORMAT_elf
	call	bitreader_read_from_client_ wrt ..plt
%else
	call	bitreader_read_from_client_
	call	bitreader_read_from_client_
%endif
%endif
%endif
	pop	edx			;       /* discard, unused */
	pop	edx			;       /* discard, unused */
	pop	ecx			;       /* restore */
	pop	ecx			;       /* restore */
	mov	esi, [ebp + 16]		;       cwords = br->consumed_words;
	mov	esi, [ebp + 16]		;       cwords = br->consumed_words;
 Lines 434-444   cident FLAC__bitreader_read_rice_signed_ Link Here 
	bswap	edx			;		edx = br->buffer[cwords] swapped; now we can CRC the bytes from LSByte to MSByte which makes things much easier
	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	ecx, [ebp + 28]		;		ecx <- br->crc16_align
	mov	eax, [ebp + 24]		;		ax <- br->read_crc (a.k.a. crc)
	mov	eax, [ebp + 24]		;		ax <- br->read_crc (a.k.a. crc)
%ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE
	mov	edi, [esp + 20]		;		edi <- FLAC__crc16_table
	mov	edi, _FLAC__crc16_table
%else
	mov	edi, FLAC__crc16_table
%endif
	;; eax (ax)	crc a.k.a. br->read_crc
	;; eax (ax)	crc a.k.a. br->read_crc
	;; ebx (bl)	intermediate result index into FLAC__crc16_table[]
	;; ebx (bl)	intermediate result index into FLAC__crc16_table[]
	;; ecx		br->crc16_align
	;; ecx		br->crc16_align
(-) flac-1.2.1-old/src/libFLAC/ia32/stream_encoder_asm.nasm (-1 / +1 lines)
 Lines 41-47   cglobal precompute_partition_info_sums_3 Link Here 
; **********************************************************************
; **********************************************************************
;
;
; 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_(
; void precompute_partition_info_sums_32bit_(
; 	const FLAC__int32 residual[],
; 	const FLAC__int32 residual[],
; 	FLAC__uint64 abs_residual_partition_sums[],
; 	FLAC__uint64 abs_residual_partition_sums[],
(-) flac-1.2.1-old/src/libFLAC/include/private/bitreader.h (-2 / +2 lines)
 Lines 80-90   FLAC__bool FLAC__bitreader_skip_byte_blo Link Here 
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_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_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(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
#ifndef FLAC__NO_ASM
#  ifdef FLAC__CPU_IA32
#  ifdef FLAC__CPU_IA32
#    ifdef FLAC__HAS_NASM
#    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
#  endif
#endif
#endif
(-) flac-1.2.1-old/src/libFLAC/stream_decoder.c (-2 / +2 lines)
 Lines 167-173   typedef struct FLAC__StreamDecoderPrivat Link Here 
	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[]);
	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: */
	/* 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[]);
	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;
	void *client_data;
	FILE *file; /* only used if FLAC__stream_decoder_init_file()/FLAC__stream_decoder_init_file() called, else NULL */
	FILE *file; /* only used if FLAC__stream_decoder_init_file()/FLAC__stream_decoder_init_file() called, else NULL */
	FLAC__BitReader *input;
	FLAC__BitReader *input;
 Lines 2750-2756   FLAC__bool read_residual_partitioned_ric Link Here 
		if(rice_parameter < pesc) {
		if(rice_parameter < pesc) {
			partitioned_rice_contents->raw_bits[partition] = 0;
			partitioned_rice_contents->raw_bits[partition] = 0;
			u = (partition_order == 0 || partition > 0)? partition_samples : partition_samples - predictor_order;
			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 */
				return false; /* read_callback_ sets the state for us */
			sample += u;
			sample += u;
		}
		}