mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-09 08:39:41 +00:00
pcmenc: use ENCODE macro for pcm_s8
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
2d232f8b88
commit
00e02366a5
@ -85,7 +85,7 @@ static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
|||||||
int n, sample_size, v, ret;
|
int n, sample_size, v, ret;
|
||||||
const short *samples;
|
const short *samples;
|
||||||
unsigned char *dst;
|
unsigned char *dst;
|
||||||
const uint8_t *srcu8;
|
const uint8_t *samples_uint8_t;
|
||||||
const int16_t *samples_int16_t;
|
const int16_t *samples_int16_t;
|
||||||
const int32_t *samples_int32_t;
|
const int32_t *samples_int32_t;
|
||||||
const int64_t *samples_int64_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)
|
ENCODE(uint16_t, be16, samples, dst, n, 0, 0x8000)
|
||||||
break;
|
break;
|
||||||
case AV_CODEC_ID_PCM_S8:
|
case AV_CODEC_ID_PCM_S8:
|
||||||
srcu8 = frame->data[0];
|
ENCODE(uint8_t, byte, samples, dst, n, 0, -128)
|
||||||
for (; n > 0; n--) {
|
|
||||||
v = *srcu8++;
|
|
||||||
*dst++ = v - 128;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
#if HAVE_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
case AV_CODEC_ID_PCM_F64LE:
|
case AV_CODEC_ID_PCM_F64LE:
|
||||||
|
Loading…
Reference in New Issue
Block a user