On Sat, Jan 24, 2015 at 03:14:07PM +0100, Hendrik Leppkes wrote:
> --- a/configure
> +++ b/configure
> @@ -1519,6 +1519,7 @@ TYPES_LIST="
>      struct_sockaddr_sa_len
>      struct_sockaddr_storage
>      struct_v4l2_frmivalenum_discrete
> +    DXVA_PicParams_HEVC

alphabetical order please

> @@ -4165,6 +4168,8 @@ disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion 
> -lbz2 || disable bzlib
>  check_lib math.h sin -lm && LIBM="-lm"
>  enabled vaapi && require vaapi va/va.h vaInitialize -lva
>  
> +check_type "windows.h dxva.h" "DXVA_PicParams_HEVC"

A few lines above, just below

  check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss

looks like a better place for this entry to me.

> --- /dev/null
> +++ b/libavcodec/dxva2_hevc.c
> @@ -0,0 +1,375 @@
> +static void fill_picture_entry(DXVA_PicEntry_HEVC *pic,
> +                               unsigned index, unsigned flag)
> +{
> +    assert((index&0x7f) == index && (flag&0x01) == flag);

spaces around & please

> +    #define DO_REF_LIST(ref_idx, ref_list) { \
> +        const RefPicList *rpl = &h->rps[ref_idx]; \
> +        assert(rpl->nb_refs <= FF_ARRAY_ELEMS(pp->ref_list)); \
> +        for (j = 0, k = 0; j < rpl->nb_refs; j++) { \
> +            if (rpl->ref[j]) { \
> +                pp->ref_list[k] = get_refpic_index(pp, 
> ff_dxva2_get_surface_index(ctx, rpl->ref[j]->frame)); \
> +                k++; \
> +            } \
> +        } \
> +    }

I'd skip indentation for macros.  No, I don't particularly care.

> +    /*if (h->slice_type != AV_PICTURE_TYPE_I && h->slice_type != 
> AV_PICTURE_TYPE_SI)
> +        ctx_pic->pp.wBitFields &= ~(1 << 15); /* Set IntraPicFlag to 0 */

No commented-out cruft please.

> +static int dxva2_hevc_end_frame(AVCodecContext *avctx)
> +{
> +    HEVCContext *h = avctx->priv_data;
> +    struct hevc_dxva2_picture_context *ctx_pic = 
> h->ref->hwaccel_picture_private;
> +    int scale = (ctx_pic->pp.dwCodingParamToolFlags & 1);

pointless ()

> --- a/libavcodec/hevc.c
> +++ b/libavcodec/hevc.c
> @@ -401,6 +401,12 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps)
>      s->avctx->height              = sps->output_height;
>      s->avctx->has_b_frames        = sps->temporal_layer[sps->max_sub_layers 
> - 1].num_reorder_pics;
>  
> +    if (sps->pix_fmt == AV_PIX_FMT_YUV420P || sps->pix_fmt == 
> AV_PIX_FMT_YUVJ420P) {
> +#if CONFIG_HEVC_DXVA2_HWACCEL

The more common style is to fold the condition into the if and rely
on the compiler performing DCE.

> +        *fmt++ = AV_PIX_FMT_DXVA2_VLD;
> +#endif
> +    }
> +    

trailing whitespace

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to