static int hevc_decode_nal_units(const uint8_t *buf, int buf_size, HEVCParamSets *ps,

                                 int is_nalff, int nal_length_size, void *logctx)

{

    int i;

    int ret = 0;

    H2645Packet pkt = { 0 };



    ret = ff_h2645_packet_split(&pkt, buf, buf_size, logctx, is_nalff, nal_length_size, AV_CODEC_ID_HEVC, 1);

    if (ret < 0) {

        goto done;

    }



    for (i = 0; i < pkt.nb_nals; i++) {

        H2645NAL *nal = &pkt.nals[i];



        /* ignore everything except parameter sets and VCL NALUs */

        switch (nal->type) {

        case HEVC_NAL_VPS: ff_hevc_decode_nal_vps(&nal->gb, logctx, ps);    break;

        case HEVC_NAL_SPS: ff_hevc_decode_nal_sps(&nal->gb, logctx, ps, 1); break;

        case HEVC_NAL_PPS: ff_hevc_decode_nal_pps(&nal->gb, logctx, ps);    break;

        default:

            av_log(logctx, AV_LOG_VERBOSE, "Ignoring NAL type %d in extradata\n", nal->type);

            break;

        }

    }



done:

    ff_h2645_packet_uninit(&pkt);

    return ret;

}

static int hevc_decode_nal_units(const uint8_t *buf, int buf_size, HEVCParamSets *ps,

                                 int is_nalff, int nal_length_size, void *logctx)

{

    int i;

    int ret = 0;

    H2645Packet pkt = { 0 };



    ret = ff_h2645_packet_split(&pkt, buf, buf_size, logctx, is_nalff, nal_length_size, AV_CODEC_ID_HEVC, 1);

    if (ret < 0) {

        goto done;

    }



    for (i = 0; i < pkt.nb_nals; i++) {

        H2645NAL *nal = &pkt.nals[i];



        

        switch (nal->type) {

        case HEVC_NAL_VPS: ff_hevc_decode_nal_vps(&nal->gb, logctx, ps);    break;

        case HEVC_NAL_SPS: ff_hevc_decode_nal_sps(&nal->gb, logctx, ps, 1); break;

        case HEVC_NAL_PPS: ff_hevc_decode_nal_pps(&nal->gb, logctx, ps);    break;

        default:

            av_log(logctx, AV_LOG_VERBOSE, "Ignoring NAL type %d in extradata\n", nal->type);

            break;

        }

    }



done:

    ff_h2645_packet_uninit(&pkt);

    return ret;

}

                                 int is_nalff, int nal_length_size, void *logctx)         case HEVC_NAL_VPS: ff_hevc_decode_nal_vps(&nal->gb, logctx, ps);    break;         case HEVC_NAL_SPS: ff_hevc_decode_nal_sps(&nal->gb, logctx, ps, 1); break;         case HEVC_NAL_PPS: ff_hevc_decode_nal_pps(&nal->gb, logctx, ps);    break;     return ret;
static int FUNC_0(const uint8_t *VAR_0, int VAR_1, HEVCParamSets *VAR_2,

                                 int VAR_3, int VAR_4, void *VAR_5)

{

    int VAR_6;

    int VAR_7 = 0;

    H2645Packet pkt = { 0 };



    VAR_7 = ff_h2645_packet_split(&pkt, VAR_0, VAR_1, VAR_5, VAR_3, VAR_4, AV_CODEC_ID_HEVC, 1);

    if (VAR_7 < 0) {

        goto done;

    }



    for (VAR_6 = 0; VAR_6 < pkt.nb_nals; VAR_6++) {

        H2645NAL *nal = &pkt.nals[VAR_6];



        

        switch (nal->type) {

        case HEVC_NAL_VPS: ff_hevc_decode_nal_vps(&nal->gb, VAR_5, VAR_2);    break;

        case HEVC_NAL_SPS: ff_hevc_decode_nal_sps(&nal->gb, VAR_5, VAR_2, 1); break;

        case HEVC_NAL_PPS: ff_hevc_decode_nal_pps(&nal->gb, VAR_5, VAR_2);    break;

        default:

            av_log(VAR_5, AV_LOG_VERBOSE, "Ignoring NAL type %d in extradata\n", nal->type);

            break;

        }

    }



done:

    ff_h2645_packet_uninit(&pkt);

    return VAR_7;

}

static int FUNC_0(const uint8_t *VAR_0, int VAR_1, HEVCParamSets *VAR_2,
int VAR_3, int VAR_4, void *VAR_5)
{ int VAR_6; int VAR_7 = 0; H2645Packet pkt = { 0 }; VAR_7 = ff_h2645_packet_split(&pkt, VAR_0, VAR_1, VAR_5, VAR_3, VAR_4, AV_CODEC_ID_HEVC, 1); if (VAR_7 < 0) { goto done; } for (VAR_6 = 0; VAR_6 < pkt.nb_nals; VAR_6++) { H2645NAL *nal = &pkt.nals[VAR_6]; switch (nal->type) { case HEVC_NAL_VPS: ff_hevc_decode_nal_vps(&nal->gb, VAR_5, VAR_2);    break; case HEVC_NAL_SPS: ff_hevc_decode_nal_sps(&nal->gb, VAR_5, VAR_2, 1); break; case HEVC_NAL_PPS: ff_hevc_decode_nal_pps(&nal->gb, VAR_5, VAR_2);    break; default:
av_log(VAR_5, AV_LOG_VERBOSE, "Ignoring NAL type %d in extradata\n", nal->type); break; } } done:
ff_h2645_packet_uninit(&pkt); return VAR_7; }