add FLAC__bitbuffer_read_rice_signed_block()

This commit is contained in:
Josh Coalson
2002-04-25 05:21:09 +00:00
parent 8e46a5e53e
commit b28559ab6b
3 changed files with 217 additions and 5 deletions

View File

@@ -1492,16 +1492,18 @@ FLAC__bool stream_decoder_read_residual_partitioned_rice_(FLAC__StreamDecoder *d
return false; /* the read_callback_ sets the state for us */
partitioned_rice->parameters[partition] = rice_parameter;
if(rice_parameter < FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER) {
for(u = (partition_order == 0 || partition > 0)? 0 : predictor_order; u < partition_samples; u++, sample++) {
#ifdef FLAC__SYMMETRIC_RICE
for(u = (partition_order == 0 || partition > 0)? 0 : predictor_order; u < partition_samples; u++, sample++) {
if(!FLAC__bitbuffer_read_symmetric_rice_signed(decoder->private_->input, &i, rice_parameter, read_callback_, decoder))
return false; /* the read_callback_ sets the state for us */
#else
if(!FLAC__bitbuffer_read_rice_signed(decoder->private_->input, &i, rice_parameter, read_callback_, decoder))
return false; /* the read_callback_ sets the state for us */
#endif
residual[sample] = i;
}
#else
u = (partition_order == 0 || partition > 0)? partition_samples : partition_samples - predictor_order;
if(!FLAC__bitbuffer_read_rice_signed_block(decoder->private_->input, residual + sample, u, rice_parameter, read_callback_, decoder))
return false; /* the read_callback_ sets the state for us */
sample += u;
#endif
}
else {
if(!FLAC__bitbuffer_read_raw_uint32(decoder->private_->input, &rice_parameter, FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_RAW_LEN, read_callback_, decoder))