[Libva] [PATCH] va: Add va_enc_mvc.h for MVC encoding

Gwenole Beauchesne gb.devel at gmail.com
Thu Dec 19 22:03:29 PST 2013


Hi,

- va_enc_h264.h :)
- use more doxygen style to document the fields

2013/12/20 Li Xiaowei <xiaowei.a.li at intel.com>:

> diff --git a/va/va_enc_mvc.h b/va/va_enc_mvc.h
> new file mode 100644
> index 0000000..267442b
> --- /dev/null
> +++ b/va/va_enc_mvc.h
> @@ -0,0 +1,172 @@
> +/*
> + * Copyright (c) 2007-2013 Intel Corporation. All Rights Reserved.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the
> + * "Software"), to deal in the Software without restriction, including
> + * without limitation the rights to use, copy, modify, merge, publish,
> + * distribute, sub license, and/or sell copies of the Software, and to
> + * permit persons to whom the Software is furnished to do so, subject to
> + * the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the
> + * next paragraph) shall be included in all copies or substantial portions
> + * of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
> + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
> + * IN NO EVENT SHALL INTEL AND/OR ITS SUPPLIERS BE LIABLE FOR
> + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
> + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
> + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
> + */
> +
> +/**
> + * \file va_enc_mvc.h
> + * \brief MVC(Multiview video coding) encoding API
> + *
> + * This file contains the \ref api_enc_mvc "mvc encoding API".
> + */
> +
> +#ifndef VA_ENC_MVC_H
> +#define VA_ENC_MVC_H
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +#include <stdint.h>
> +#include "va_enc_h264.h"
> +

Then, in va_enc_h264.h, you can create a subgroup for MVC (Annex.H) to
host those two extra definitions.

> +/* In order to minimize the overhead payload of the structure,
> + * we limit the max number for view and other parameters here,
> + * although the actual view number and applicable operation point
> + * number can be up to 1024, and level value can be up to 64
> + * according to H264 MVC specification.
> + */
> +
> +#define VA_MVC_MAX_VIEW_NUM 2
> +#define VA_MVC_MAX_LEVEL_VALUE_NUM 2
> +#define VA_MVC_MAX_APPLICABLE_OP_NUM 1

VA_H264_MVC_MAX_NUM_{VIEWS,LEVEL_VALUES,APPLICABLE_OPS}

> +/**
> + * \defgroup api_enc_mvc MVC encoding API
> + *
> + * @{
> + */
> +
> +/****************************
> + * H.264/MVC data structures
> + ****************************/
> +
> +/**
> + * \brief H.264/MVC Sequence Parameter Buffer
> + *
> + */

Please make it clear in the documentation here, or at the H.264 MVC
group level, that this data structure is mandatory and only valid for
VAProfileH264MultiviewHigh or VAProfileH264StereoHigh.

> +typedef struct _VAEncSequenceParameterBufferH264_MVC {
> +
> +     VAEncSequenceParameterBufferH264 base;
> +
> +     /* plus 1 specifies the max number of views
> +      * coded in the video sequence */
> +     uint16_t num_views_minus1;
> +
> +     /*inter-view dependency relationships for the coded video sequence*/
> +     struct H264SPSExtMVCView {

VAEncMultiviewInfoH264?

> +           /* The view identifier */
> +           uint16_t view_id;
> +           /* specifies the number of view components for inter-view
> +            * prediction in the initialized RefPicList0 in decoding
> +            * anchor views.
> +            */
> +           uint8_t  num_anchor_refs_l0;
> +           /* specifies the view_id for inter-view prediction in
> +            * the initialized RefPicList0 in decoding anchor views.
> +            */
> +           uint8_t anchor_ref_l0[15];
> +           /* specifies the number of view components for inter-view
> +            * prediction in the initialized RefPicList0 in decoding
> +            * anchor views
> +            */
> +           uint8_t  num_anchor_refs_l1;
> +           /* specifies the view_id for inter-view prediction in
> +            * the initialized RefPicList1 in decoding anchor views.
> +            */
> +           uint16_t anchor_ref_l1[15];
> +           /* specifies the number of view components for inter-view
> +            * prediction in the initialized RefPicList0 in decoding
> +            * non-anchor views.
> +            */
> +           uint8_t  num_non_anchor_refs_l0;
> +           /* specifies the view_id for inter-view prediction in
> +            * the initialized RefPicList0 in decoding non-anchor views.
> +            */
> +           uint16_t non_anchor_ref_l0[15];
> +           /* specifies the number of view components for inter-view
> +            * prediction in the initialized RefPicList1 in decoding
> +            * non-anchor view.
> +            */
> +           uint8_t  num_non_anchor_refs_l1;
> +           /* specifies the view_id for inter-view prediction in
> +            * the initialized RefPicList1 in decoding non-anchor views.
> +            */
> +           uint16_t non_anchor_ref_l1[15];
> +     } view[VA_MVC_MAX_VIEW_NUM];
> +
> +     /* plus 1 specifies the number of level values
> +      * signalled for the coded video sequence.
> +      */
> +     uint8_t num_level_values_signalled_minus1;
> +
> +     /* level values for a subset of the operation points for
> +      * the coded video sequence
> +      */
> +     struct H264SPSExtMVCLevelValue {

VAEncMultiviewLevelValueH264?

> +         /* specifies the level value signalled for the coded video sequence */
> +         uint8_t level_idc;
> +
> +         /* plus 1 specifies the number of operation points to
> +          * which the level indicated by level_idc applies
> +          */
> +         uint16_t num_applicable_ops_minus1;
> +
> +         /* Represent the operation points for the coded
> +          * video sequence
> +          */
> +         struct H264SPSExtMVCLevelValueOp {

VAEncMultiviewLevelValueOpH264?

> +             uint8_t  temporal_id;
> +             uint16_t num_target_views_minus1;
> +             uint16_t target_view_id[VA_MVC_MAX_VIEW_NUM];
> +             uint16_t num_views_minus1;
> +         } applicable_op[VA_MVC_MAX_APPLICABLE_OP_NUM];
> +
> +     } level_value[VA_MVC_MAX_LEVEL_VALUE_NUM];
> +
> +} VAEncSequenceParameterBufferH264_MVC;
> +
> +/**
> + * \brief H.264/MVC Picture Parameter Buffer
> + *
> + */

Likewise document this is mandatory and only valid for H.264 MVC profiles.

> +typedef struct _VAEncPictureParameterBufferH264_MVC
> +{
> +    VAEncPictureParameterBufferH264 base;
> +
> +    /* specifes the view id for current picture */
> +    uint16_t view_id;
> +
> +    /* specifes current picture is one anchor picture */
> +    uint8_t  anchor_pic_flag;
> +
> +    /* specifes whether inter view reference frame
> +     * is used to encode current picture.
> +     */
> +    uint8_t  inter_view_flag;
> +} VAEncPictureParameterBufferH264_MVC;
> +
> +#ifdef __cplusplus
> +}
> +#endif
> +
> +#endif /* VA_ENC_MVC_H */

Thanks,
Gwenole.


More information about the Libva mailing list