int ff_avc_parse_nal_units(AVIOContext *pb, const uint8_t *buf_in, int size)

{

    const uint8_t *p = buf_in;

    const uint8_t *end = p + size;

    const uint8_t *nal_start, *nal_end;



    size = 0;

    nal_start = ff_avc_find_startcode(p, end);

    while (nal_start < end) {

        while(!*(nal_start++));

        nal_end = ff_avc_find_startcode(nal_start, end);

        avio_wb32(pb, nal_end - nal_start);

        avio_write(pb, nal_start, nal_end - nal_start);

        size += 4 + nal_end - nal_start;

        nal_start = nal_end;

    }

    return size;

}

int ff_avc_parse_nal_units(AVIOContext *pb, const uint8_t *buf_in, int size)

{

    const uint8_t *p = buf_in;

    const uint8_t *end = p + size;

    const uint8_t *nal_start, *nal_end;



    size = 0;

    nal_start = ff_avc_find_startcode(p, end);

    while (nal_start < end) {

        while(!*(nal_start++));

        nal_end = ff_avc_find_startcode(nal_start, end);

        avio_wb32(pb, nal_end - nal_start);

        avio_write(pb, nal_start, nal_end - nal_start);

        size += 4 + nal_end - nal_start;

        nal_start = nal_end;

    }

    return size;

}

int FUNC_0(AVIOContext *VAR_0, const uint8_t *VAR_1, int VAR_2)

{

    const uint8_t *VAR_3 = VAR_1;

    const uint8_t *VAR_4 = VAR_3 + VAR_2;

    const uint8_t *VAR_5, *nal_end;



    VAR_2 = 0;

    VAR_5 = ff_avc_find_startcode(VAR_3, VAR_4);

    while (VAR_5 < VAR_4) {

        while(!*(VAR_5++));

        nal_end = ff_avc_find_startcode(VAR_5, VAR_4);

        avio_wb32(VAR_0, nal_end - VAR_5);

        avio_write(VAR_0, VAR_5, nal_end - VAR_5);

        VAR_2 += 4 + nal_end - VAR_5;

        VAR_5 = nal_end;

    }

    return VAR_2;

}

int FUNC_0(AVIOContext *VAR_0, const uint8_t *VAR_1, int VAR_2)
{ const uint8_t *VAR_3 = VAR_1; const uint8_t *VAR_4 = VAR_3 + VAR_2; const uint8_t *VAR_5, *nal_end; VAR_2 = 0; VAR_5 = ff_avc_find_startcode(VAR_3, VAR_4); while (VAR_5 < VAR_4) { while(!*(VAR_5++)); nal_end = ff_avc_find_startcode(VAR_5, VAR_4); avio_wb32(VAR_0, nal_end - VAR_5); avio_write(VAR_0, VAR_5, nal_end - VAR_5); VAR_2 += 4 + nal_end - VAR_5; VAR_5 = nal_end; } return VAR_2; }