[FFmpeg-cvslog] pcmenc: use ENCODE macro for pcm_s8

Paul B Mahol git at videolan.org
Tue Nov 20 14:22:06 CET 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue Nov 20 13:18:56 2012 +0000| [00e02366a5ae4a5808a009181a2d83f26c516811] | committer: Paul B Mahol

pcmenc: use ENCODE macro for pcm_s8

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=00e02366a5ae4a5808a009181a2d83f26c516811
---

 libavcodec/pcm.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index 36385f7..0421137 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -85,7 +85,7 @@ static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
     int n, sample_size, v, ret;
     const short *samples;
     unsigned char *dst;
-    const uint8_t *srcu8;
+    const uint8_t *samples_uint8_t;
     const int16_t *samples_int16_t;
     const int32_t *samples_int32_t;
     const int64_t *samples_int64_t;
@@ -135,11 +135,7 @@ static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
         ENCODE(uint16_t, be16, samples, dst, n, 0, 0x8000)
         break;
     case AV_CODEC_ID_PCM_S8:
-        srcu8 = frame->data[0];
-        for (; n > 0; n--) {
-            v      = *srcu8++;
-            *dst++ = v - 128;
-        }
+        ENCODE(uint8_t, byte, samples, dst, n, 0, -128)
         break;
 #if HAVE_BIGENDIAN
     case AV_CODEC_ID_PCM_F64LE:



More information about the ffmpeg-cvslog mailing list