diff options
author | Ramiro Polla <ramiro.polla@gmail.com> | 2007-05-09 23:32:29 +0000 |
---|---|---|
committer | Ramiro Polla <ramiro.polla@gmail.com> | 2007-05-09 23:32:29 +0000 |
commit | a4461664cdabcf3abcd3ca9b06a61393337a9187 (patch) | |
tree | 6abea8f3ae8af2f408568dab97ab0d97b84881d4 /libavcodec/pcm.c | |
parent | 5a2f421a4316c6923c093a0ccbf7b1a68492a675 (diff) | |
download | ffmpeg-a4461664cdabcf3abcd3ca9b06a61393337a9187.tar.gz |
Simplify ptr[0]; ptr++; to *ptr++
Originally committed as revision 8965 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/pcm.c')
-rw-r--r-- | libavcodec/pcm.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c index a954faa462..2551d12b65 100644 --- a/libavcodec/pcm.c +++ b/libavcodec/pcm.c @@ -282,29 +282,25 @@ static int pcm_encode_frame(AVCodecContext *avctx, case CODEC_ID_PCM_S8: for(;n>0;n--) { v = *samples++; - dst[0] = v >> 8; - dst++; + *dst++ = v >> 8; } break; case CODEC_ID_PCM_U8: for(;n>0;n--) { v = *samples++; - dst[0] = (v >> 8) + 128; - dst++; + *dst++ = (v >> 8) + 128; } break; case CODEC_ID_PCM_ALAW: for(;n>0;n--) { v = *samples++; - dst[0] = linear_to_alaw[(v + 32768) >> 2]; - dst++; + *dst++ = linear_to_alaw[(v + 32768) >> 2]; } break; case CODEC_ID_PCM_MULAW: for(;n>0;n--) { v = *samples++; - dst[0] = linear_to_ulaw[(v + 32768) >> 2]; - dst++; + *dst++ = linear_to_ulaw[(v + 32768) >> 2]; } break; default: @@ -447,23 +443,20 @@ static int pcm_decode_frame(AVCodecContext *avctx, case CODEC_ID_PCM_S8: n = buf_size; for(;n>0;n--) { - *samples++ = src[0] << 8; - src++; + *samples++ = *src++ << 8; } break; case CODEC_ID_PCM_U8: n = buf_size; for(;n>0;n--) { - *samples++ = ((int)src[0] - 128) << 8; - src++; + *samples++ = ((int)*src++ - 128) << 8; } break; case CODEC_ID_PCM_ALAW: case CODEC_ID_PCM_MULAW: n = buf_size; for(;n>0;n--) { - *samples++ = s->table[src[0]]; - src++; + *samples++ = s->table[*src++]; } break; default: |