[FFmpeg-cvslog] avcodec/wavpackenc: when bits_per_raw_sample is unset encode full depth
Paul B Mahol
git at videolan.org
Wed Feb 23 18:00:51 EET 2022
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Feb 19 15:20:15 2022 +0100| [cc36cf26d12a3fb6f42ecdd6930817ce616be548] | committer: Paul B Mahol
avcodec/wavpackenc: when bits_per_raw_sample is unset encode full depth
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cc36cf26d12a3fb6f42ecdd6930817ce616be548
---
libavcodec/wavpackenc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c
index dc4f4e303b..89751395d5 100644
--- a/libavcodec/wavpackenc.c
+++ b/libavcodec/wavpackenc.c
@@ -2829,8 +2829,8 @@ static void fill_buffer(WavPackEncodeContext *s,
COPY_SAMPLES(int16_t, 0, 0);
break;
case AV_SAMPLE_FMT_S32P:
- if (s->avctx->bits_per_raw_sample <= 24) {
- COPY_SAMPLES(int32_t, 0, 8);
+ if (s->avctx->bits_per_raw_sample > 0 && s->avctx->bits_per_raw_sample < 32) {
+ COPY_SAMPLES(int32_t, 0, 32 - s->avctx->bits_per_raw_sample);
break;
}
case AV_SAMPLE_FMT_FLTP:
@@ -2880,7 +2880,7 @@ static int wavpack_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
switch (s->avctx->sample_fmt) {
case AV_SAMPLE_FMT_S16P: s->flags |= 1; break;
- case AV_SAMPLE_FMT_S32P: s->flags |= 3 - (s->avctx->bits_per_raw_sample <= 24); break;
+ case AV_SAMPLE_FMT_S32P: s->flags |= 3 - (s->avctx->bits_per_raw_sample > 0 && s->avctx->bits_per_raw_sample <= 24); break;
case AV_SAMPLE_FMT_FLTP: s->flags |= 3 | WV_FLOAT_DATA;
}
More information about the ffmpeg-cvslog
mailing list