[vlc-devel] [PATCH 7/9] h264: parse 3D stereo information from frame_packing_arrangement SEI message

Vittorio Giovara vittorio.giovara at gmail.com
Sat Aug 9 15:17:05 CEST 2014


On Fri, Aug 8, 2014 at 7:13 PM, Felix Abecassis
<felix.abecassis at gmail.com> wrote:
> ---
>  modules/packetizer/h264.c | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
>
> diff --git a/modules/packetizer/h264.c b/modules/packetizer/h264.c
> index 2b84a27..7b8754b 100644
> --- a/modules/packetizer/h264.c
> +++ b/modules/packetizer/h264.c
> @@ -1168,6 +1168,39 @@ static void ParseSei( decoder_t *p_dec, block_t *p_frag )
>              }
>          }
>
> +        /* Frame packing arrangement */
> +        if( i_type == 45 )
> +        {
> +            const int      i_packing = i_size;
> +            const uint8_t *p_packing = &pb_dec[i_used];
> +
> +            bs_t s;
> +            bs_init( &s, p_packing, i_packing );
> +            bs_read_ue( &s ); /* frame_packing_arrangement_id */
> +            if( !bs_read( &s, 1 ) ) /* frame_packing_arrangement_cancel_flag */
> +            {
> +                int frame_packing_arrangement_type = bs_read( &s, 7 );
> +                bs_read( &s, 1 ); /* quincunx_sampling_flag */
> +                int content_interpretation_type = bs_read( &s, 6 );
> +
> +                stereo3d_format_t stereo_format = { 0 };
> +                switch( frame_packing_arrangement_type )
> +                {
> +                case 1: stereo_format.mode = VLC_STEREO3D_COL; break;
> +                case 2: stereo_format.mode = VLC_STEREO3D_ROW; break;
> +                case 3: stereo_format.mode = VLC_STEREO3D_SBS; break;
> +                case 4: stereo_format.mode = VLC_STEREO3D_TB; break;
> +                case 5: stereo_format.mode = VLC_STEREO3D_FRAME; break;
> +                case 6: default: stereo_format.mode = VLC_STEREO3D_2D; break;

case 6 is 2D, ok, but you're setting also 0 (checkerboard) and any
value above 6 as 2D which might not be true.

> +                }
> +
> +                if( content_interpretation_type == 2 )
> +                    stereo_format.flags = VLC_STEREO3D_SWAP_EYES;
> +
> +                p_dec->fmt_out.video.stereo_format = stereo_format;
> +            }
> +        }
> +
>          i_used += i_size;
>      }
>
> --
> 1.9.1
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



-- 
Vittorio



More information about the vlc-devel mailing list