[FFmpeg-devel] [RFC] GXF Patches - HD

Michael Niedermayer michaelni at gmx.at
Sat Jul 20 23:50:09 CEST 2013


On Mon, Jun 17, 2013 at 03:24:49PM -0500, Reuben Martin wrote:
> DAR & tests updates

>  gxfenc.c |   56 ++++++++++++++++++++++++++++++++++++++++++++++++--------
>  1 file changed, 48 insertions(+), 8 deletions(-)
> 5c8a8eccfe78b0c44cffae9948bc2e3b8f1c7562  05-GXF_DAR.patch
> From c29c0fe20675254f6a09e114a32bd30128d44b14 Mon Sep 17 00:00:00 2001
> From: Reuben Martin <reuben.m at gmail.com>
> Date: Thu, 13 Jun 2013 00:53:17 -0500
> Subject: [PATCH 5/8] Set GXF bits indicating DAR
> 
> ---
>  libavformat/gxfenc.c | 56 ++++++++++++++++++++++++++++++++++++++++++++--------
>  1 file changed, 48 insertions(+), 8 deletions(-)
> 
> diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c
> index 8411934..e5a07c5 100644
> --- a/libavformat/gxfenc.c
> +++ b/libavformat/gxfenc.c
> @@ -59,6 +59,7 @@ typedef struct GXFStreamContext {
>      int p_per_gop;
>      int b_per_i_or_p; ///< number of B frames per I frame or P frame
>      int first_gop_closed;

> +    int aspect_ratio; ///< display aspect ratio: 0 => 4:3, 1 => 16:9

aspect_ratio_id as its not a ratio


>      unsigned order;   ///< interleaving order
>  } GXFStreamContext;
>  
> @@ -206,10 +207,10 @@ static int gxf_write_mpeg_auxiliary(AVIOContext *pb, AVStream *st)
>          starting_line = 23; // default PAL
>  
>      size = snprintf(buffer, sizeof(buffer), "Ver 1\nBr %.6f\nIpg 1\nPpi %d\nBpiop %d\n"
> -                    "Pix 0\nCf %d\nCg %d\nSl %d\nnl16 %d\nVi 1\nf1 1\n",
> +                    "Pix 0\nCf %d\nCg %d\nSl %d\nnl16 %d\nVi 1\nf1 1\nar %d\n",
>                      (float)st->codec->bit_rate, sc->p_per_gop, sc->b_per_i_or_p,
>                      st->codec->pix_fmt == AV_PIX_FMT_YUV422P ? 2 : 1, sc->first_gop_closed == 1,
> -                    starting_line, (st->codec->height + 15) / 16);
> +                    starting_line, (st->codec->height + 15) / 16, sc->aspect_ratio);
>      av_assert0(size < sizeof(buffer));
>      avio_w8(pb, TRACK_MPG_AUX);
>      avio_w8(pb, size + 1);
> @@ -219,12 +220,25 @@ static int gxf_write_mpeg_auxiliary(AVIOContext *pb, AVStream *st)
>  
>  static int gxf_write_dv_auxiliary(AVIOContext *pb, AVStream *st)
>  {
> +    GXFStreamContext *sc = st->priv_data;
>      int64_t track_aux_data = 0;
>  
>      avio_w8(pb, TRACK_AUX);
>      avio_w8(pb, 8);
> -    if (st->codec->pix_fmt == PIX_FMT_YUV420P)
> -        track_aux_data |= 0x01;     /* marks stream as DVCAM instead of DVPRO */
> +
> +    switch (sc->track_type) {
> +        case 5:
> +            if (sc->aspect_ratio)
> +                track_aux_data |= 0x10;  /* 16:9 */
> +            if (st->codec->pix_fmt == PIX_FMT_YUV420P)
> +                track_aux_data |= 0x01;  /* marks stream as DVCAM instead of DVPRO */
> +            break;
> +        case 6:
> +            if (sc->aspect_ratio)
> +                track_aux_data |= 0x01;  /* 16:9 (yes, this bit flag's location is different than that used with track type 5) */
> +            break;
> +    }

the other track types get no aspect nor pixel format dependant
track_aux_data, is that intended ?

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130720/e78824e6/attachment.asc>


More information about the ffmpeg-devel mailing list