1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

alac: factor out output_size check in predictor_decompress_fir_adapt()

This commit is contained in:
Justin Ruggles 2012-07-09 13:01:32 -04:00
parent ebd4c3add1
commit 9a6c528e08

View File

@ -173,10 +173,10 @@ static void predictor_decompress_fir_adapt(int32_t *error_buffer,
/* first sample always copies */ /* first sample always copies */
*buffer_out = *error_buffer; *buffer_out = *error_buffer;
if (!predictor_coef_num) { if (output_size <= 1)
if (output_size <= 1) return;
return;
if (!predictor_coef_num) {
memcpy(&buffer_out[1], &error_buffer[1], memcpy(&buffer_out[1], &error_buffer[1],
(output_size - 1) * sizeof(*buffer_out)); (output_size - 1) * sizeof(*buffer_out));
return; return;
@ -184,8 +184,6 @@ static void predictor_decompress_fir_adapt(int32_t *error_buffer,
if (predictor_coef_num == 31) { if (predictor_coef_num == 31) {
/* simple 1st-order prediction */ /* simple 1st-order prediction */
if (output_size <= 1)
return;
for (i = 1; i < output_size; i++) { for (i = 1; i < output_size; i++) {
buffer_out[i] = sign_extend(buffer_out[i - 1] + error_buffer[i], buffer_out[i] = sign_extend(buffer_out[i - 1] + error_buffer[i],
readsamplesize); readsamplesize);