static void fill_scaling_lists(const AVCodecContext *avctx, AVDXVAContext *ctx, const H264Context *h, DXVA_Qmatrix_H264 *qm)

{

    unsigned i, j;

    memset(qm, 0, sizeof(*qm));

    if (DXVA_CONTEXT_WORKAROUND(avctx, ctx) & FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG) {

        for (i = 0; i < 6; i++)

            for (j = 0; j < 16; j++)

                qm->bScalingLists4x4[i][j] = h->pps.scaling_matrix4[i][j];



        for (i = 0; i < 64; i++) {

            qm->bScalingLists8x8[0][i] = h->pps.scaling_matrix8[0][i];

            qm->bScalingLists8x8[1][i] = h->pps.scaling_matrix8[3][i];

        }

    } else {

        for (i = 0; i < 6; i++)

            for (j = 0; j < 16; j++)

                qm->bScalingLists4x4[i][j] = h->pps.scaling_matrix4[i][ff_zigzag_scan[j]];



        for (i = 0; i < 64; i++) {

            qm->bScalingLists8x8[0][i] = h->pps.scaling_matrix8[0][ff_zigzag_direct[i]];

            qm->bScalingLists8x8[1][i] = h->pps.scaling_matrix8[3][ff_zigzag_direct[i]];

        }

    }

}

static void fill_scaling_lists(const AVCodecContext *avctx, AVDXVAContext *ctx, const H264Context *h, DXVA_Qmatrix_H264 *qm)

{

    unsigned i, j;

    memset(qm, 0, sizeof(*qm));

    if (DXVA_CONTEXT_WORKAROUND(avctx, ctx) & FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG) {

        for (i = 0; i < 6; i++)

            for (j = 0; j < 16; j++)

                qm->bScalingLists4x4[i][j] = h->pps.scaling_matrix4[i][j];



        for (i = 0; i < 64; i++) {

            qm->bScalingLists8x8[0][i] = h->pps.scaling_matrix8[0][i];

            qm->bScalingLists8x8[1][i] = h->pps.scaling_matrix8[3][i];

        }

    } else {

        for (i = 0; i < 6; i++)

            for (j = 0; j < 16; j++)

                qm->bScalingLists4x4[i][j] = h->pps.scaling_matrix4[i][ff_zigzag_scan[j]];



        for (i = 0; i < 64; i++) {

            qm->bScalingLists8x8[0][i] = h->pps.scaling_matrix8[0][ff_zigzag_direct[i]];

            qm->bScalingLists8x8[1][i] = h->pps.scaling_matrix8[3][ff_zigzag_direct[i]];

        }

    }

}

static void FUNC_0(const AVCodecContext *VAR_0, AVDXVAContext *VAR_1, const H264Context *VAR_2, DXVA_Qmatrix_H264 *VAR_3)

{

    unsigned VAR_4, VAR_5;

    memset(VAR_3, 0, sizeof(*VAR_3));

    if (DXVA_CONTEXT_WORKAROUND(VAR_0, VAR_1) & FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG) {

        for (VAR_4 = 0; VAR_4 < 6; VAR_4++)

            for (VAR_5 = 0; VAR_5 < 16; VAR_5++)

                VAR_3->bScalingLists4x4[VAR_4][VAR_5] = VAR_2->pps.scaling_matrix4[VAR_4][VAR_5];



        for (VAR_4 = 0; VAR_4 < 64; VAR_4++) {

            VAR_3->bScalingLists8x8[0][VAR_4] = VAR_2->pps.scaling_matrix8[0][VAR_4];

            VAR_3->bScalingLists8x8[1][VAR_4] = VAR_2->pps.scaling_matrix8[3][VAR_4];

        }

    } else {

        for (VAR_4 = 0; VAR_4 < 6; VAR_4++)

            for (VAR_5 = 0; VAR_5 < 16; VAR_5++)

                VAR_3->bScalingLists4x4[VAR_4][VAR_5] = VAR_2->pps.scaling_matrix4[VAR_4][ff_zigzag_scan[VAR_5]];



        for (VAR_4 = 0; VAR_4 < 64; VAR_4++) {

            VAR_3->bScalingLists8x8[0][VAR_4] = VAR_2->pps.scaling_matrix8[0][ff_zigzag_direct[VAR_4]];

            VAR_3->bScalingLists8x8[1][VAR_4] = VAR_2->pps.scaling_matrix8[3][ff_zigzag_direct[VAR_4]];

        }

    }

}

static void FUNC_0(const AVCodecContext *VAR_0, AVDXVAContext *VAR_1, const H264Context *VAR_2, DXVA_Qmatrix_H264 *VAR_3)
{ unsigned VAR_4, VAR_5; memset(VAR_3, 0, sizeof(*VAR_3)); if (DXVA_CONTEXT_WORKAROUND(VAR_0, VAR_1) & FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG) { for (VAR_4 = 0; VAR_4 < 6; VAR_4++) for (VAR_5 = 0; VAR_5 < 16; VAR_5++) VAR_3->bScalingLists4x4[VAR_4][VAR_5] = VAR_2->pps.scaling_matrix4[VAR_4][VAR_5]; for (VAR_4 = 0; VAR_4 < 64; VAR_4++) { VAR_3->bScalingLists8x8[0][VAR_4] = VAR_2->pps.scaling_matrix8[0][VAR_4]; VAR_3->bScalingLists8x8[1][VAR_4] = VAR_2->pps.scaling_matrix8[3][VAR_4]; } } else { for (VAR_4 = 0; VAR_4 < 6; VAR_4++) for (VAR_5 = 0; VAR_5 < 16; VAR_5++) VAR_3->bScalingLists4x4[VAR_4][VAR_5] = VAR_2->pps.scaling_matrix4[VAR_4][ff_zigzag_scan[VAR_5]]; for (VAR_4 = 0; VAR_4 < 64; VAR_4++) { VAR_3->bScalingLists8x8[0][VAR_4] = VAR_2->pps.scaling_matrix8[0][ff_zigzag_direct[VAR_4]]; VAR_3->bScalingLists8x8[1][VAR_4] = VAR_2->pps.scaling_matrix8[3][ff_zigzag_direct[VAR_4]]; } } }