On 07/17/2013 05:42 PM, Vittorio Giovara wrote:
> ---
> libavcodec/h264.c | 33 +++++++++++++++++++++++++++++++++
> libavcodec/h264.h | 22 +++++++++++++++++++++-
> libavcodec/h264_sei.c | 36 ++++++++++++++++++++++++++++++++++++
> 3 files changed, 90 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/h264.c b/libavcodec/h264.c
> index c53ea13..ffb4b1d 100644
> --- a/libavcodec/h264.c
> +++ b/libavcodec/h264.c
> @@ -1912,6 +1912,39 @@ static void decode_postinit(H264Context *h, int
> setup_finished)
> }
> }
>
> + if (h->sei_frame_packing_present) {
> + AVFrameSideData *side_data =
> + av_frame_new_side_data(&cur->f,
> + AV_FRAME_DATA_STEREO3D,
> + sizeof(AVStereo3D));
> +
> + AVStereo3D *stereo_info = (AVStereo3D *)side_data->data;
> + switch (h->frame_packing_arrangement_type) {
could be made as simple as 1 << h->frame_packing_arrangement_type using
the bitfield approach.
> +
> + if (h->content_interpretation_type == 1)
> + stereo_info->order = ORDER_LR;
> + else if (h->content_interpretation_type == 2)
> + stereo_info->order = ORDER_RL;
> + else
> + stereo_info->order = ORDER_NA;
Same thing with the correct offset.
> + stereo_info->fullsize = (stereo_info->type == STEREO_FRAMESEQUENCE);
> + stereo_info->anaglyph = ANAGLYPH_NONE;
ditto.
> break;
> + case SEI_TYPE_FRAME_PACKING:
> + if(decode_frame_packing_arrangement(h) < 0)
coding style
> + return -1;
bad return value.
> + break;
> default:
> skip_bits(&h->gb, 8*size);
> }
>
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel