[FFmpeg-devel] [PATCH] alac.c cleanup (was ALAC question)

Vitor Sessak vitor1001
Tue Jul 17 22:18:56 CEST 2007


Hi

Michael Niedermayer wrote:
> Hi
> 
> On Fri, Jul 13, 2007 at 03:36:17AM +0200, Vitor Sessak wrote:
>> Hi
>>
>> Michael Niedermayer wrote:
>>> Hi
>>>
>>> yes, please split it if possible
>> First chunk attached. Changes only the two-channels decoding.
>>
>> -Vitor
> 
>> Index: libavcodec/alac.c
>> ===================================================================
>> --- libavcodec/alac.c	(revision 9617)
>> +++ libavcodec/alac.c	(working copy)
>> @@ -630,133 +630,86 @@
>>  
>>          if (!isnotcompressed) {
>>           /* compressed */
>> -            int16_t predictor_coef_table_a[32];
>> -            int predictor_coef_num_a;
>> -            int prediction_type_a;
>> -            int prediction_quantitization_a;
>> -            int ricemodifier_a;
>> +            int16_t predictor_coef_table[channels][32];
>> +            int predictor_coef_num[channels];
>> +            int prediction_type[channels];
>> +            int prediction_quantitization[channels];
>> +            int ricemodifier[channels];
>>  
>> -            int16_t predictor_coef_table_b[32];
>> -            int predictor_coef_num_b;
>> -            int prediction_type_b;
>> -            int prediction_quantitization_b;
>> -            int ricemodifier_b;
>> +            int i, chan;
>>  
>> -            int i;
>> -
>>              interlacing_shift = get_bits(&alac->gb, 8);
>>              interlacing_leftweight = get_bits(&alac->gb, 8);
>>  
>> -            /******** channel 1 ***********/
>> -            prediction_type_a = get_bits(&alac->gb, 4);
>> -            prediction_quantitization_a = get_bits(&alac->gb, 4);
>> +          for (chan = 0; chan < channels; chan++) {
>> +            prediction_type[chan] = get_bits(&alac->gb, 4);
>> +            prediction_quantitization[chan] = get_bits(&alac->gb, 4);
> 
> on its own this change makes no sense as channels=1 here
> could you provide a sample which benefits from this 2->1 change
> or have i missed something?
> 
> [...]

All modified lines are inside a

switch(channels) {
case 1:
    [...]
    break;
case 2:
    { all modified lines }
    break;
}

"channel 1" in the comments means left channel, not mono. My patch does:

-/****** channel 1 ******/
-{ decode left channel }

-/****** channel 2 ******/
-{ decode right channel }

+for(chan=0; chan < channels; chan++)
+  {decode channel chan}




More information about the ffmpeg-devel mailing list