Commit 989bb7bd authored by Justin Ruggles's avatar Justin Ruggles

dpcm: consistently use the variable name 'n' for the next input byte.

parent 04b24cf9
...@@ -176,7 +176,6 @@ static int dpcm_decode_frame(AVCodecContext *avctx, ...@@ -176,7 +176,6 @@ static int dpcm_decode_frame(AVCodecContext *avctx,
int stereo = s->channels - 1; int stereo = s->channels - 1;
short *output_samples = data; short *output_samples = data;
int shift[2]; int shift[2];
unsigned char byte;
short diff; short diff;
if (!buf_size) if (!buf_size)
...@@ -266,12 +265,12 @@ static int dpcm_decode_frame(AVCodecContext *avctx, ...@@ -266,12 +265,12 @@ static int dpcm_decode_frame(AVCodecContext *avctx,
} }
while (in < buf_size) { while (in < buf_size) {
byte = buf[in++]; uint8_t n = buf[in++];
diff = (byte & 0xFC) << 8; diff = (n & 0xFC) << 8;
if ((byte & 0x03) == 3) if ((n & 0x03) == 3)
shift[ch]++; shift[ch]++;
else else
shift[ch] -= (2 * (byte & 3)); shift[ch] -= (2 * (n & 3));
/* saturate the shifter to a lower limit of 0 */ /* saturate the shifter to a lower limit of 0 */
if (shift[ch] < 0) if (shift[ch] < 0)
shift[ch] = 0; shift[ch] = 0;
...@@ -303,8 +302,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx, ...@@ -303,8 +302,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx,
} }
} else { } else {
while (in < buf_size) { while (in < buf_size) {
int n; uint8_t n = buf[in++];
n = buf[in++];
if (n & 0x80) s->sample[ch] -= s->sol_table[n & 0x7F]; if (n & 0x80) s->sample[ch] -= s->sol_table[n & 0x7F];
else s->sample[ch] += s->sol_table[n & 0x7F]; else s->sample[ch] += s->sol_table[n & 0x7F];
s->sample[ch] = av_clip_int16(s->sample[ch]); s->sample[ch] = av_clip_int16(s->sample[ch]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment