mirror of https://git.ffmpeg.org/ffmpeg.git
More cosmetics
Originally committed as revision 9736 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
d0da802049
commit
10024d443a
|
@ -202,11 +202,10 @@ static void bastardized_rice_decompress(ALACContext *alac,
|
||||||
if (extrabits > 1) {
|
if (extrabits > 1) {
|
||||||
x += extrabits - 1;
|
x += extrabits - 1;
|
||||||
get_bits(&alac->gb, k);
|
get_bits(&alac->gb, k);
|
||||||
} else {
|
} else
|
||||||
get_bits(&alac->gb, k - 1);
|
get_bits(&alac->gb, k - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
x_modified = sign_modifier + x;
|
x_modified = sign_modifier + x;
|
||||||
final_val = (x_modified + 1) / 2;
|
final_val = (x_modified + 1) / 2;
|
||||||
|
@ -217,7 +216,7 @@ static void bastardized_rice_decompress(ALACContext *alac,
|
||||||
sign_modifier = 0;
|
sign_modifier = 0;
|
||||||
|
|
||||||
/* now update the history */
|
/* now update the history */
|
||||||
history += (x_modified * rice_historymult)
|
history += x_modified * rice_historymult
|
||||||
- ((history * rice_historymult) >> 9);
|
- ((history * rice_historymult) >> 9);
|
||||||
|
|
||||||
if (x_modified > 0xffff)
|
if (x_modified > 0xffff)
|
||||||
|
@ -260,7 +259,6 @@ static void bastardized_rice_decompress(ALACContext *alac,
|
||||||
if (block_size > 0) {
|
if (block_size > 0) {
|
||||||
memset(&output_buffer[output_count+1], 0, block_size * 4);
|
memset(&output_buffer[output_count+1], 0, block_size * 4);
|
||||||
output_count += block_size;
|
output_count += block_size;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block_size > 0xffff)
|
if (block_size > 0xffff)
|
||||||
|
@ -292,7 +290,9 @@ static void predictor_decompress_fir_adapt(int32_t *error_buffer,
|
||||||
*buffer_out = *error_buffer;
|
*buffer_out = *error_buffer;
|
||||||
|
|
||||||
if (!predictor_coef_num) {
|
if (!predictor_coef_num) {
|
||||||
if (output_size <= 1) return;
|
if (output_size <= 1)
|
||||||
|
return;
|
||||||
|
|
||||||
memcpy(buffer_out+1, error_buffer+1, (output_size-1) * 4);
|
memcpy(buffer_out+1, error_buffer+1, (output_size-1) * 4);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -301,21 +301,22 @@ static void predictor_decompress_fir_adapt(int32_t *error_buffer,
|
||||||
/* second-best case scenario for fir decompression,
|
/* second-best case scenario for fir decompression,
|
||||||
* error describes a small difference from the previous sample only
|
* error describes a small difference from the previous sample only
|
||||||
*/
|
*/
|
||||||
if (output_size <= 1) return;
|
if (output_size <= 1)
|
||||||
|
return;
|
||||||
for (i = 0; i < output_size - 1; i++) {
|
for (i = 0; i < output_size - 1; i++) {
|
||||||
int32_t prev_value;
|
int32_t prev_value;
|
||||||
int32_t error_value;
|
int32_t error_value;
|
||||||
|
|
||||||
prev_value = buffer_out[i];
|
prev_value = buffer_out[i];
|
||||||
error_value = error_buffer[i+1];
|
error_value = error_buffer[i+1];
|
||||||
buffer_out[i+1] = SIGN_EXTENDED32((prev_value + error_value), readsamplesize);
|
buffer_out[i+1] =
|
||||||
|
SIGN_EXTENDED32((prev_value + error_value), readsamplesize);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* read warm-up samples */
|
/* read warm-up samples */
|
||||||
if (predictor_coef_num > 0) {
|
if (predictor_coef_num > 0)
|
||||||
int i;
|
|
||||||
for (i = 0; i < predictor_coef_num; i++) {
|
for (i = 0; i < predictor_coef_num; i++) {
|
||||||
int32_t val;
|
int32_t val;
|
||||||
|
|
||||||
|
@ -325,7 +326,6 @@ static void predictor_decompress_fir_adapt(int32_t *error_buffer,
|
||||||
|
|
||||||
buffer_out[i+1] = val;
|
buffer_out[i+1] = val;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* 4 and 8 are very common cases (the only ones i've seen). these
|
/* 4 and 8 are very common cases (the only ones i've seen). these
|
||||||
|
@ -345,9 +345,7 @@ static void predictor_decompress_fir_adapt(int32_t *error_buffer,
|
||||||
|
|
||||||
/* general case */
|
/* general case */
|
||||||
if (predictor_coef_num > 0) {
|
if (predictor_coef_num > 0) {
|
||||||
for (i = predictor_coef_num + 1;
|
for (i = predictor_coef_num + 1; i < output_size; i++) {
|
||||||
i < output_size;
|
|
||||||
i++) {
|
|
||||||
int j;
|
int j;
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
int outval;
|
int outval;
|
||||||
|
@ -411,7 +409,8 @@ static void deinterlace_16(int32_t *buffer_a, int32_t *buffer_b,
|
||||||
uint8_t interlacing_leftweight)
|
uint8_t interlacing_leftweight)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
if (numsamples <= 0) return;
|
if (numsamples <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
/* weighted interlacing */
|
/* weighted interlacing */
|
||||||
if (interlacing_leftweight) {
|
if (interlacing_leftweight) {
|
||||||
|
@ -533,10 +532,9 @@ static int alac_decode_frame(AVCodecContext *avctx,
|
||||||
predictor_coef_num[chan] = get_bits(&alac->gb, 5);
|
predictor_coef_num[chan] = get_bits(&alac->gb, 5);
|
||||||
|
|
||||||
/* read the predictor table */
|
/* read the predictor table */
|
||||||
for (i = 0; i < predictor_coef_num[chan]; i++) {
|
for (i = 0; i < predictor_coef_num[chan]; i++)
|
||||||
predictor_coef_table[chan][i] = (int16_t)get_bits(&alac->gb, 16);
|
predictor_coef_table[chan][i] = (int16_t)get_bits(&alac->gb, 16);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (wasted_bytes) {
|
if (wasted_bytes) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "FIXME: unimplemented, unhandling of wasted_bytes\n");
|
av_log(avctx, AV_LOG_ERROR, "FIXME: unimplemented, unhandling of wasted_bytes\n");
|
||||||
|
|
Loading…
Reference in New Issue