unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx,

                                    const AVDXVAContext *ctx,

                                    const AVFrame *frame)

{

    void *surface = get_surface(frame);

    unsigned i;



    for (i = 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++) {

#if CONFIG_D3D11VA

        if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD && ctx->d3d11va.surface[i] == surface)

        {

            D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC viewDesc;

            ID3D11VideoDecoderOutputView_GetDesc(ctx->d3d11va.surface[i], &viewDesc);

            return viewDesc.Texture2D.ArraySlice;

        }

#endif

#if CONFIG_DXVA2

        if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD && ctx->dxva2.surface[i] == surface)

            return i;

#endif

    }



    assert(0);

    return 0;

}

unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx,

                                    const AVDXVAContext *ctx,

                                    const AVFrame *frame)

{

    void *surface = get_surface(frame);

    unsigned i;



    for (i = 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++) {

#if CONFIG_D3D11VA

        if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD && ctx->d3d11va.surface[i] == surface)

        {

            D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC viewDesc;

            ID3D11VideoDecoderOutputView_GetDesc(ctx->d3d11va.surface[i], &viewDesc);

            return viewDesc.Texture2D.ArraySlice;

        }

#endif

#if CONFIG_DXVA2

        if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD && ctx->dxva2.surface[i] == surface)

            return i;

#endif

    }



    assert(0);

    return 0;

}

unsigned FUNC_0(const AVCodecContext *VAR_0,

                                    const AVDXVAContext *VAR_1,

                                    const AVFrame *VAR_2)

{

    void *VAR_3 = get_surface(VAR_2);

    unsigned VAR_4;



    for (VAR_4 = 0; VAR_4 < DXVA_CONTEXT_COUNT(VAR_0, VAR_1); VAR_4++) {

#if CONFIG_D3D11VA

        if (VAR_0->pix_fmt == AV_PIX_FMT_D3D11VA_VLD && VAR_1->d3d11va.VAR_3[VAR_4] == VAR_3)

        {

            D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC viewDesc;

            ID3D11VideoDecoderOutputView_GetDesc(VAR_1->d3d11va.VAR_3[VAR_4], &viewDesc);

            return viewDesc.Texture2D.ArraySlice;

        }

#endif

#if CONFIG_DXVA2

        if (VAR_0->pix_fmt == AV_PIX_FMT_DXVA2_VLD && VAR_1->dxva2.VAR_3[VAR_4] == VAR_3)

            return VAR_4;

#endif

    }



    assert(0);

    return 0;

}

unsigned FUNC_0(const AVCodecContext *VAR_0,
const AVDXVAContext *VAR_1,
const AVFrame *VAR_2)
{ void *VAR_3 = get_surface(VAR_2); unsigned VAR_4; for (VAR_4 = 0; VAR_4 < DXVA_CONTEXT_COUNT(VAR_0, VAR_1); VAR_4++) { #if CONFIG_D3D11VA
if (VAR_0->pix_fmt == AV_PIX_FMT_D3D11VA_VLD && VAR_1->d3d11va.VAR_3[VAR_4] == VAR_3)
{ D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC viewDesc; ID3D11VideoDecoderOutputView_GetDesc(VAR_1->d3d11va.VAR_3[VAR_4], &viewDesc); return viewDesc.Texture2D.ArraySlice; } #endif
#if CONFIG_DXVA2
if (VAR_0->pix_fmt == AV_PIX_FMT_DXVA2_VLD && VAR_1->dxva2.VAR_3[VAR_4] == VAR_3)
return VAR_4; #endif
} assert(0); return 0; }