static int find_unused_picture(MpegEncContext *s, int shared)

{

    int i;



    if (shared) {

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

            if (s->picture[i].f.data[0] == NULL)

                return i;

        }

    } else {

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

            if (pic_is_unused(s, &s->picture[i]))

                return i;

        }

    }



    return AVERROR_INVALIDDATA;

}

static int find_unused_picture(MpegEncContext *s, int shared)

{

    int i;



    if (shared) {

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

            if (s->picture[i].f.data[0] == NULL)

                return i;

        }

    } else {

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

            if (pic_is_unused(s, &s->picture[i]))

                return i;

        }

    }



    return AVERROR_INVALIDDATA;

}

static int FUNC_0(MpegEncContext *VAR_0, int VAR_1)

{

    int VAR_2;



    if (VAR_1) {

        for (VAR_2 = 0; VAR_2 < MAX_PICTURE_COUNT; VAR_2++) {

            if (VAR_0->picture[VAR_2].f.data[0] == NULL)

                return VAR_2;

        }

    } else {

        for (VAR_2 = 0; VAR_2 < MAX_PICTURE_COUNT; VAR_2++) {

            if (pic_is_unused(VAR_0, &VAR_0->picture[VAR_2]))

                return VAR_2;

        }

    }



    return AVERROR_INVALIDDATA;

}

static int FUNC_0(MpegEncContext *VAR_0, int VAR_1)
{ int VAR_2; if (VAR_1) { for (VAR_2 = 0; VAR_2 < MAX_PICTURE_COUNT; VAR_2++) { if (VAR_0->picture[VAR_2].f.data[0] == NULL)
return VAR_2; } } else { for (VAR_2 = 0; VAR_2 < MAX_PICTURE_COUNT; VAR_2++) { if (pic_is_unused(VAR_0, &VAR_0->picture[VAR_2]))
return VAR_2; } } return AVERROR_INVALIDDATA; }