On 13/03/13 13:09, Vittorio Giovara wrote:
> ---
> libavcodec/h264.h | 3 ++-
> libavcodec/h264_sei.c | 29 +++++++++++++++++++++++++++++
> 2 files changed, 31 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/h264.h b/libavcodec/h264.h
> index e33f37e..db588bd 100644
> --- a/libavcodec/h264.h
> +++ b/libavcodec/h264.h
> @@ -123,7 +123,8 @@ typedef enum {
> SEI_BUFFERING_PERIOD = 0, ///< buffering period (H.264,
> D.1.1)
> SEI_TYPE_PIC_TIMING = 1, ///< picture timing
> SEI_TYPE_USER_DATA_UNREGISTERED = 5, ///< unregistered user data
> - SEI_TYPE_RECOVERY_POINT = 6 ///< recovery point (frame # to
> decoder sync)
> + SEI_TYPE_RECOVERY_POINT = 6, ///< recovery point (frame # to
> decoder sync)
> + SEI_TYPE_FRAME_PACKING = 45, ///< frame packing arrangement
> } SEI_Type;
>
> /**
> diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c
> index df4c49f..c47be93 100644
> --- a/libavcodec/h264_sei.c
> +++ b/libavcodec/h264_sei.c
> @@ -156,6 +156,31 @@ static int decode_buffering_period(H264Context *h){
> return 0;
> }
>
> +static int decode_frame_packing_arrangement(H264Context *h)
{
> + int cancel, type, quincunx;
> +
> + get_ue_golomb(&h->gb); //
> frame_packing_arrangement_id
> + cancel = get_bits1(&h->gb); // frame_packing_cancel_flag
> + if (cancel == 0) {
> + type = get_bits(&h->gb, 7); //
> frame_packing_arrangement_type
> + quincunx = get_bits1(&h->gb); // quincunx_sampling_flag
> + skip_bits(&h->gb, 6); //
> content_interpretation_type
> +
> + // the following skips spatial_flipping_flag frame0_flipped_flag
> + // field_views_flag current_frame_is_frame0_flag
> + // frame0_self_contained_flag frame1_self_contained_flag
> + skip_bits(&h->gb, 6);
> +
> + if ( quincunx == 0 && type != 5 )
> + skip_bits(&h->gb, 16); //
> frame[01]_grid_position_[xy]
> + skip_bits(&h->gb, 8); //
> frame_packing_arrangement_reserved_byte
> + get_ue_golomb(&h->gb); //
> frame_packing_arrangement_repetition_period
> + }
> + skip_bits1(&h->gb); //
> frame_packing_arrangement_extension_flag
> +
the function always return 0 and doesn't set anything, something is missing?
> + return 0;
> +}
> +
> int ff_h264_decode_sei(H264Context *h){
> while (get_bits_left(&h->gb) > 16) {
> int size, type;
> @@ -187,6 +212,10 @@ int ff_h264_decode_sei(H264Context *h){
> if(decode_buffering_period(h) < 0)
> return -1;
> break;
> + case SEI_TYPE_FRAME_PACKING:
> + if(decode_frame_packing_arrangement(h) < 0)
> + return -1;
Always return a meaningful error.
> + break;
> default:
> skip_bits(&h->gb, 8*size);
> }
>
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel