void parse_slice_header(davs2_t *h, davs2_bs_t *bs)
{
    int slice_vertical_position;
    int slice_vertical_position_extension = 0;
    int slice_horizontal_positon;
    int slice_horizontal_positon_extension;
    int mb_row;

    /* skip start code: 00 00 01 */
    bs->i_bit_pos += 24;

    slice_vertical_position = u_v(bs, 8, "slice vertical position");

    if (h->i_image_height > (144 * h->i_lcu_size)) {
        slice_vertical_position_extension = u_v(bs, 3, "slice vertical position extension");
    }

    if (h->i_image_height > (144 * h->i_lcu_size)) {
        mb_row = (slice_vertical_position_extension << 7) + slice_vertical_position;
    } else {
        mb_row = slice_vertical_position;
    }

    slice_horizontal_positon = u_v(bs, 8, "slice horizontal position");
    if (h->i_width > (255 * h->i_lcu_size)) {
        slice_horizontal_positon_extension = u_v(bs, 2, "slice horizontal position extension");
    }

    if (!h->b_fixed_picture_qp) {
        h->b_fixed_slice_qp = u_flag(bs, "fixed_slice_qp");
        h->i_slice_qp       = u_v(bs, 7, "slice_qp");

        h->b_DQP            = !h->b_fixed_slice_qp;
    } else {
        h->i_slice_qp       = h->i_picture_qp;
        h->b_DQP            = 0;
    }
    h->i_qp = h->i_slice_qp;

    if (!is_valid_qp(h, h->i_qp)) {
        davs2_log(h, DAVS2_LOG_ERROR, "Invalid Slice QP: %d\n", h->i_qp);
    }

    if (h->b_sao) {
        h->slice_sao_on[0] = u_flag(bs, "sao_slice_flag_Y");
        h->slice_sao_on[1] = u_flag(bs, "sao_slice_flag_Cb");
        h->slice_sao_on[2] = u_flag(bs, "sao_slice_flag_Cr");
    }
}
void parse_slice_header(davs2_t *h, davs2_bs_t *bs)
{
    int slice_vertical_position;
    int slice_vertical_position_extension = 0;
    int slice_horizontal_positon;
    int slice_horizontal_positon_extension;
    int mb_row;

     
    bs->i_bit_pos += 24;

    slice_vertical_position = u_v(bs, 8, "slice vertical position");

    if (h->i_image_height > (144 * h->i_lcu_size)) {
        slice_vertical_position_extension = u_v(bs, 3, "slice vertical position extension");
    }

    if (h->i_image_height > (144 * h->i_lcu_size)) {
        mb_row = (slice_vertical_position_extension << 7) + slice_vertical_position;
    } else {
        mb_row = slice_vertical_position;
    }

    slice_horizontal_positon = u_v(bs, 8, "slice horizontal position");
    if (h->i_width > (255 * h->i_lcu_size)) {
        slice_horizontal_positon_extension = u_v(bs, 2, "slice horizontal position extension");
    }

    if (!h->b_fixed_picture_qp) {
        h->b_fixed_slice_qp = u_flag(bs, "fixed_slice_qp");
        h->i_slice_qp       = u_v(bs, 7, "slice_qp");

        h->b_DQP            = !h->b_fixed_slice_qp;
    } else {
        h->i_slice_qp       = h->i_picture_qp;
        h->b_DQP            = 0;
    }
    h->i_qp = h->i_slice_qp;

    if (!is_valid_qp(h, h->i_qp)) {
        davs2_log(h, DAVS2_LOG_ERROR, "Invalid Slice QP: %d\n", h->i_qp);
    }

    if (h->b_sao) {
        h->slice_sao_on[0] = u_flag(bs, "sao_slice_flag_Y");
        h->slice_sao_on[1] = u_flag(bs, "sao_slice_flag_Cb");
        h->slice_sao_on[2] = u_flag(bs, "sao_slice_flag_Cr");
    }
}