mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
minor OPT tweaks
This commit is contained in:
@@ -577,7 +577,7 @@ FLAC__bool FLAC__bitwriter_write_rice_signed_block(FLAC__BitWriter *bw, const FL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#elif 0 /*@@@@@@ OPT: try this version with MSVC6 to see if better, not much difference for gcc-4 */
|
#elif 1 /*@@@@@@ OPT: try this version with MSVC6 to see if better, not much difference for gcc-4 */
|
||||||
if(bw->bits && bw->bits + msbits + lsbits < FLAC__BITS_PER_WORD) { /* i.e. if the whole thing fits in the current bwword */
|
if(bw->bits && bw->bits + msbits + lsbits < FLAC__BITS_PER_WORD) { /* i.e. if the whole thing fits in the current bwword */
|
||||||
/* ^^^ if bw->bits is 0 then we may have filled the buffer and have no free bwword to work in */
|
/* ^^^ if bw->bits is 0 then we may have filled the buffer and have no free bwword to work in */
|
||||||
bw->bits = bw->bits + msbits + lsbits;
|
bw->bits = bw->bits + msbits + lsbits;
|
||||||
@@ -642,7 +642,7 @@ break1:
|
|||||||
bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(bw->accum);
|
bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(bw->accum);
|
||||||
bw->accum = uval;
|
bw->accum = uval;
|
||||||
}
|
}
|
||||||
#if 0
|
#if 1
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
vals++;
|
vals++;
|
||||||
|
|||||||
@@ -420,7 +420,7 @@ static FLAC__StreamDecoderInitStatus init_stream_internal_(
|
|||||||
#ifdef FLAC__CPU_IA32
|
#ifdef FLAC__CPU_IA32
|
||||||
FLAC__ASSERT(decoder->private_->cpuinfo.type == FLAC__CPUINFO_TYPE_IA32);
|
FLAC__ASSERT(decoder->private_->cpuinfo.type == FLAC__CPUINFO_TYPE_IA32);
|
||||||
#ifdef FLAC__HAS_NASM
|
#ifdef FLAC__HAS_NASM
|
||||||
#if 0 /*@@@@@@ OPT: not clearly faster, needs more testing */
|
#if 1 /*@@@@@@ OPT: not clearly faster, needs more testing */
|
||||||
if(decoder->private_->cpuinfo.data.ia32.bswap)
|
if(decoder->private_->cpuinfo.data.ia32.bswap)
|
||||||
decoder->private_->local_bitreader_read_rice_signed_block = FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap;
|
decoder->private_->local_bitreader_read_rice_signed_block = FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap;
|
||||||
#endif
|
#endif
|
||||||
@@ -2078,7 +2078,7 @@ FLAC__bool read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame, FL
|
|||||||
decoder->private_->output[0][i] = (mid + side) >> 1;
|
decoder->private_->output[0][i] = (mid + side) >> 1;
|
||||||
decoder->private_->output[1][i] = (mid - side) >> 1;
|
decoder->private_->output[1][i] = (mid - side) >> 1;
|
||||||
#else
|
#else
|
||||||
//@@@@@@ OPT: try without 'side' temp variable
|
/* OPT: without 'side' temp variable */
|
||||||
mid = (decoder->private_->output[0][i] << 1) | (decoder->private_->output[1][i] & 1); /* i.e. if 'side' is odd... */
|
mid = (decoder->private_->output[0][i] << 1) | (decoder->private_->output[1][i] & 1); /* i.e. if 'side' is odd... */
|
||||||
decoder->private_->output[0][i] = (mid + decoder->private_->output[1][i]) >> 1;
|
decoder->private_->output[0][i] = (mid + decoder->private_->output[1][i]) >> 1;
|
||||||
decoder->private_->output[1][i] = (mid - decoder->private_->output[1][i]) >> 1;
|
decoder->private_->output[1][i] = (mid - decoder->private_->output[1][i]) >> 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user