[FFmpeg-devel] [PATCH 4/4] mxfdec: Consider QuantizationBits between 17 and 24 to be pcm_s24*

Baptiste Coudurier baptiste.coudurier at gmail.com
Tue Sep 27 11:33:55 CEST 2011


Hi Thomas,

On 9/27/11 2:14 AM, Tomas Härdin wrote:
> It's not pretty, but it works. I have no idea how one is supposed to
> handle shifted PCM in MXF - there's no pretty field like for
> PixelLayout.
> 
> /Tomas
> 
> 
> 0004-mxfdec-Consider-QuantizationBits-between-17-and-24-t.patch
> 
> 
> From aedba3f931864420853a3bc13071e9633eefffdb Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= <tomas.hardin at codemill.se>
> Date: Wed, 25 May 2011 17:20:08 +0200
> Subject: [PATCH 4/4] mxfdec: Consider QuantizationBits between 17 and 24 to be pcm_s24*
> 
> This fixes playback of BRD38772509.mxf
> ---
>  libavformat/mxfdec.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> index a534188..e0c6a12 100644
> --- a/libavformat/mxfdec.c
> +++ b/libavformat/mxfdec.c
> @@ -1191,12 +1191,12 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
>              st->codec->sample_rate = descriptor->sample_rate.num / descriptor->sample_rate.den;
>              /* TODO: implement CODEC_ID_RAWAUDIO */
>              if (st->codec->codec_id == CODEC_ID_PCM_S16LE) {
> -                if (descriptor->bits_per_sample == 24)
> +                if (descriptor->bits_per_sample > 16 && descriptor->bits_per_sample <= 24)
>                      st->codec->codec_id = CODEC_ID_PCM_S24LE;
>                  else if (descriptor->bits_per_sample == 32)
>                      st->codec->codec_id = CODEC_ID_PCM_S32LE;
>              } else if (st->codec->codec_id == CODEC_ID_PCM_S16BE) {
> -                if (descriptor->bits_per_sample == 24)
> +                if (descriptor->bits_per_sample > 16 && descriptor->bits_per_sample <= 24)
>                      st->codec->codec_id = CODEC_ID_PCM_S24BE;
>                  else if (descriptor->bits_per_sample == 32)
>                      st->codec->codec_id = CODEC_ID_PCM_S32BE;
> 

Looks ok to me.

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org


More information about the ffmpeg-devel mailing list