void ff_h264_direct_dist_scale_factor(H264Context * const h){

    const int poc = h->cur_pic_ptr->field_poc[h->picture_structure == PICT_BOTTOM_FIELD];

    const int poc1 = h->ref_list[1][0].poc;

    int i, field;



    if (FRAME_MBAFF(h))

        for (field = 0; field < 2; field++){

            const int poc  = h->cur_pic_ptr->field_poc[field];

            const int poc1 = h->ref_list[1][0].field_poc[field];

            for (i = 0; i < 2 * h->ref_count[0]; i++)

                h->dist_scale_factor_field[field][i^field] =

                    get_scale_factor(h, poc, poc1, i+16);

        }



    for (i = 0; i < h->ref_count[0]; i++){

        h->dist_scale_factor[i] = get_scale_factor(h, poc, poc1, i);

    }

}

void ff_h264_direct_dist_scale_factor(H264Context * const h){

    const int poc = h->cur_pic_ptr->field_poc[h->picture_structure == PICT_BOTTOM_FIELD];

    const int poc1 = h->ref_list[1][0].poc;

    int i, field;



    if (FRAME_MBAFF(h))

        for (field = 0; field < 2; field++){

            const int poc  = h->cur_pic_ptr->field_poc[field];

            const int poc1 = h->ref_list[1][0].field_poc[field];

            for (i = 0; i < 2 * h->ref_count[0]; i++)

                h->dist_scale_factor_field[field][i^field] =

                    get_scale_factor(h, poc, poc1, i+16);

        }



    for (i = 0; i < h->ref_count[0]; i++){

        h->dist_scale_factor[i] = get_scale_factor(h, poc, poc1, i);

    }

}

    const int poc = h->cur_pic_ptr->field_poc[h->picture_structure == PICT_BOTTOM_FIELD];
void FUNC_0(H264Context * const VAR_0){

    const int VAR_5 = VAR_0->cur_pic_ptr->field_poc[VAR_0->picture_structure == PICT_BOTTOM_FIELD];

    const int VAR_5 = VAR_0->ref_list[1][0].VAR_5;

    int VAR_3, VAR_4;



    if (FRAME_MBAFF(VAR_0))

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

            const int VAR_5  = VAR_0->cur_pic_ptr->field_poc[VAR_4];

            const int VAR_5 = VAR_0->ref_list[1][0].field_poc[VAR_4];

            for (VAR_3 = 0; VAR_3 < 2 * VAR_0->ref_count[0]; VAR_3++)

                VAR_0->dist_scale_factor_field[VAR_4][VAR_3^VAR_4] =

                    get_scale_factor(VAR_0, VAR_5, VAR_5, VAR_3+16);

        }



    for (VAR_3 = 0; VAR_3 < VAR_0->ref_count[0]; VAR_3++){

        VAR_0->dist_scale_factor[VAR_3] = get_scale_factor(VAR_0, VAR_5, VAR_5, VAR_3);

    }

}

void FUNC_0(H264Context * const VAR_0){ const int VAR_5 = VAR_0->cur_pic_ptr->field_poc[VAR_0->picture_structure == PICT_BOTTOM_FIELD]; const int VAR_5 = VAR_0->ref_list[1][0].VAR_5; int VAR_3, VAR_4; if (FRAME_MBAFF(VAR_0))
for (VAR_4 = 0; VAR_4 < 2; VAR_4++){ const int VAR_5  = VAR_0->cur_pic_ptr->field_poc[VAR_4]; const int VAR_5 = VAR_0->ref_list[1][0].field_poc[VAR_4]; for (VAR_3 = 0; VAR_3 < 2 * VAR_0->ref_count[0]; VAR_3++) VAR_0->dist_scale_factor_field[VAR_4][VAR_3^VAR_4] =
get_scale_factor(VAR_0, VAR_5, VAR_5, VAR_3+16); } for (VAR_3 = 0; VAR_3 < VAR_0->ref_count[0]; VAR_3++){ VAR_0->dist_scale_factor[VAR_3] = get_scale_factor(VAR_0, VAR_5, VAR_5, VAR_3); } }