Mercurial > libavcodec.hg
comparison flacenc.c @ 9209:514b73a654c9 libavcodec
flacenc: remove unneeded context variable, 'ch_code'
author | jbr |
---|---|
date | Sat, 21 Mar 2009 00:45:44 +0000 |
parents | 443f056ba7e7 |
children | c7a8e302b98a |
comparison
equal
deleted
inserted
replaced
9208:443f056ba7e7 | 9209:514b73a654c9 |
---|---|
79 } FlacFrame; | 79 } FlacFrame; |
80 | 80 |
81 typedef struct FlacEncodeContext { | 81 typedef struct FlacEncodeContext { |
82 PutBitContext pb; | 82 PutBitContext pb; |
83 int channels; | 83 int channels; |
84 int ch_code; | |
85 int samplerate; | 84 int samplerate; |
86 int sr_code[2]; | 85 int sr_code[2]; |
87 int min_framesize; | 86 int min_framesize; |
88 int min_encoded_framesize; | 87 int min_encoded_framesize; |
89 int max_framesize; | 88 int max_framesize; |
176 | 175 |
177 if(channels < 1 || channels > FLAC_MAX_CHANNELS) { | 176 if(channels < 1 || channels > FLAC_MAX_CHANNELS) { |
178 return -1; | 177 return -1; |
179 } | 178 } |
180 s->channels = channels; | 179 s->channels = channels; |
181 s->ch_code = s->channels-1; | |
182 | 180 |
183 /* find samplerate in table */ | 181 /* find samplerate in table */ |
184 if(freq < 1) | 182 if(freq < 1) |
185 return -1; | 183 return -1; |
186 for(i=4; i<12; i++) { | 184 for(i=4; i<12; i++) { |
1071 | 1069 |
1072 put_bits(&s->pb, 16, 0xFFF8); | 1070 put_bits(&s->pb, 16, 0xFFF8); |
1073 put_bits(&s->pb, 4, frame->bs_code[0]); | 1071 put_bits(&s->pb, 4, frame->bs_code[0]); |
1074 put_bits(&s->pb, 4, s->sr_code[0]); | 1072 put_bits(&s->pb, 4, s->sr_code[0]); |
1075 if(frame->ch_mode == FLAC_CHMODE_INDEPENDENT) { | 1073 if(frame->ch_mode == FLAC_CHMODE_INDEPENDENT) { |
1076 put_bits(&s->pb, 4, s->ch_code); | 1074 put_bits(&s->pb, 4, s->channels-1); |
1077 } else { | 1075 } else { |
1078 put_bits(&s->pb, 4, frame->ch_mode); | 1076 put_bits(&s->pb, 4, frame->ch_mode); |
1079 } | 1077 } |
1080 put_bits(&s->pb, 3, 4); /* bits-per-sample code */ | 1078 put_bits(&s->pb, 3, 4); /* bits-per-sample code */ |
1081 put_bits(&s->pb, 1, 0); | 1079 put_bits(&s->pb, 1, 0); |