Commit a4461664 authored by Ramiro Polla's avatar Ramiro Polla

Simplify ptr[0]; ptr++; to *ptr++

Originally committed as revision 8965 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 5a2f421a
...@@ -282,29 +282,25 @@ static int pcm_encode_frame(AVCodecContext *avctx, ...@@ -282,29 +282,25 @@ static int pcm_encode_frame(AVCodecContext *avctx,
case CODEC_ID_PCM_S8: case CODEC_ID_PCM_S8:
for(;n>0;n--) { for(;n>0;n--) {
v = *samples++; v = *samples++;
dst[0] = v >> 8; *dst++ = v >> 8;
dst++;
} }
break; break;
case CODEC_ID_PCM_U8: case CODEC_ID_PCM_U8:
for(;n>0;n--) { for(;n>0;n--) {
v = *samples++; v = *samples++;
dst[0] = (v >> 8) + 128; *dst++ = (v >> 8) + 128;
dst++;
} }
break; break;
case CODEC_ID_PCM_ALAW: case CODEC_ID_PCM_ALAW:
for(;n>0;n--) { for(;n>0;n--) {
v = *samples++; v = *samples++;
dst[0] = linear_to_alaw[(v + 32768) >> 2]; *dst++ = linear_to_alaw[(v + 32768) >> 2];
dst++;
} }
break; break;
case CODEC_ID_PCM_MULAW: case CODEC_ID_PCM_MULAW:
for(;n>0;n--) { for(;n>0;n--) {
v = *samples++; v = *samples++;
dst[0] = linear_to_ulaw[(v + 32768) >> 2]; *dst++ = linear_to_ulaw[(v + 32768) >> 2];
dst++;
} }
break; break;
default: default:
...@@ -447,23 +443,20 @@ static int pcm_decode_frame(AVCodecContext *avctx, ...@@ -447,23 +443,20 @@ static int pcm_decode_frame(AVCodecContext *avctx,
case CODEC_ID_PCM_S8: case CODEC_ID_PCM_S8:
n = buf_size; n = buf_size;
for(;n>0;n--) { for(;n>0;n--) {
*samples++ = src[0] << 8; *samples++ = *src++ << 8;
src++;
} }
break; break;
case CODEC_ID_PCM_U8: case CODEC_ID_PCM_U8:
n = buf_size; n = buf_size;
for(;n>0;n--) { for(;n>0;n--) {
*samples++ = ((int)src[0] - 128) << 8; *samples++ = ((int)*src++ - 128) << 8;
src++;
} }
break; break;
case CODEC_ID_PCM_ALAW: case CODEC_ID_PCM_ALAW:
case CODEC_ID_PCM_MULAW: case CODEC_ID_PCM_MULAW:
n = buf_size; n = buf_size;
for(;n>0;n--) { for(;n>0;n--) {
*samples++ = s->table[src[0]]; *samples++ = s->table[*src++];
src++;
} }
break; break;
default: default:
......
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