static int decode_user_data(Mpeg4DecContext *ctx, GetBitContext *gb)

{

    MpegEncContext *s = &ctx->m;

    char buf[256];

    int i;

    int e;

    int ver = 0, build = 0, ver2 = 0, ver3 = 0;

    char last;



    for (i = 0; i < 255 && get_bits_count(gb) < gb->size_in_bits; i++) {

        if (show_bits(gb, 23) == 0)

            break;

        buf[i] = get_bits(gb, 8);

    }

    buf[i] = 0;



    /* divx detection */

    e = sscanf(buf, "DivX%dBuild%d%c", &ver, &build, &last);

    if (e < 2)

        e = sscanf(buf, "DivX%db%d%c", &ver, &build, &last);

    if (e >= 2) {

        ctx->divx_version = ver;

        ctx->divx_build   = build;

        s->divx_packed  = e == 3 && last == 'p';

    }



    /* libavcodec detection */

    e = sscanf(buf, "FFmpe%*[^b]b%d", &build) + 3;

    if (e != 4)

        e = sscanf(buf, "FFmpeg v%d.%d.%d / libavcodec build: %d", &ver, &ver2, &ver3, &build);

    if (e != 4) {

        e = sscanf(buf, "Lavc%d.%d.%d", &ver, &ver2, &ver3) + 1;

        if (e > 1) {

            if (ver > 0xFF || ver2 > 0xFF || ver3 > 0xFF) {

                av_log(s->avctx, AV_LOG_WARNING,

                     "Unknown Lavc version string encountered, %d.%d.%d; "

                     "clamping sub-version values to 8-bits.\n",

                     ver, ver2, ver3);

            }

            build = ((ver & 0xFF) << 16) + ((ver2 & 0xFF) << 8) + (ver3 & 0xFF);

        }

    }

    if (e != 4) {

        if (strcmp(buf, "ffmpeg") == 0)

            ctx->lavc_build = 4600;

    }

    if (e == 4)

        ctx->lavc_build = build;



    /* Xvid detection */

    e = sscanf(buf, "XviD%d", &build);

    if (e == 1)

        ctx->xvid_build = build;



    return 0;

}

static int decode_user_data(Mpeg4DecContext *ctx, GetBitContext *gb)

{

    MpegEncContext *s = &ctx->m;

    char buf[256];

    int i;

    int e;

    int ver = 0, build = 0, ver2 = 0, ver3 = 0;

    char last;



    for (i = 0; i < 255 && get_bits_count(gb) < gb->size_in_bits; i++) {

        if (show_bits(gb, 23) == 0)

            break;

        buf[i] = get_bits(gb, 8);

    }

    buf[i] = 0;



    

    e = sscanf(buf, "DivX%dBuild%d%c", &ver, &build, &last);

    if (e < 2)

        e = sscanf(buf, "DivX%db%d%c", &ver, &build, &last);

    if (e >= 2) {

        ctx->divx_version = ver;

        ctx->divx_build   = build;

        s->divx_packed  = e == 3 && last == 'p';

    }



    

    e = sscanf(buf, "FFmpe%*[^b]b%d", &build) + 3;

    if (e != 4)

        e = sscanf(buf, "FFmpeg v%d.%d.%d / libavcodec build: %d", &ver, &ver2, &ver3, &build);

    if (e != 4) {

        e = sscanf(buf, "Lavc%d.%d.%d", &ver, &ver2, &ver3) + 1;

        if (e > 1) {

            if (ver > 0xFF || ver2 > 0xFF || ver3 > 0xFF) {

                av_log(s->avctx, AV_LOG_WARNING,

                     "Unknown Lavc version string encountered, %d.%d.%d; "

                     "clamping sub-version values to 8-bits.\n",

                     ver, ver2, ver3);

            }

            build = ((ver & 0xFF) << 16) + ((ver2 & 0xFF) << 8) + (ver3 & 0xFF);

        }

    }

    if (e != 4) {

        if (strcmp(buf, "ffmpeg") == 0)

            ctx->lavc_build = 4600;

    }

    if (e == 4)

        ctx->lavc_build = build;



    

    e = sscanf(buf, "XviD%d", &build);

    if (e == 1)

        ctx->xvid_build = build;



    return 0;

}

static int FUNC_0(Mpeg4DecContext *VAR_0, GetBitContext *VAR_1)

{

    MpegEncContext *s = &VAR_0->m;

    char VAR_2[256];

    int VAR_3;

    int VAR_4;

    int VAR_5 = 0, VAR_6 = 0, VAR_7 = 0, VAR_8 = 0;

    char VAR_9;



    for (VAR_3 = 0; VAR_3 < 255 && get_bits_count(VAR_1) < VAR_1->size_in_bits; VAR_3++) {

        if (show_bits(VAR_1, 23) == 0)

            break;

        VAR_2[VAR_3] = get_bits(VAR_1, 8);

    }

    VAR_2[VAR_3] = 0;



    

    VAR_4 = sscanf(VAR_2, "DivX%dBuild%d%c", &VAR_5, &VAR_6, &VAR_9);

    if (VAR_4 < 2)

        VAR_4 = sscanf(VAR_2, "DivX%db%d%c", &VAR_5, &VAR_6, &VAR_9);

    if (VAR_4 >= 2) {

        VAR_0->divx_version = VAR_5;

        VAR_0->divx_build   = VAR_6;

        s->divx_packed  = VAR_4 == 3 && VAR_9 == 'p';

    }



    

    VAR_4 = sscanf(VAR_2, "FFmpe%*[^b]b%d", &VAR_6) + 3;

    if (VAR_4 != 4)

        VAR_4 = sscanf(VAR_2, "FFmpeg v%d.%d.%d / libavcodec VAR_6: %d", &VAR_5, &VAR_7, &VAR_8, &VAR_6);

    if (VAR_4 != 4) {

        VAR_4 = sscanf(VAR_2, "Lavc%d.%d.%d", &VAR_5, &VAR_7, &VAR_8) + 1;

        if (VAR_4 > 1) {

            if (VAR_5 > 0xFF || VAR_7 > 0xFF || VAR_8 > 0xFF) {

                av_log(s->avctx, AV_LOG_WARNING,

                     "Unknown Lavc version string encountered, %d.%d.%d; "

                     "clamping sub-version values to 8-bits.\n",

                     VAR_5, VAR_7, VAR_8);

            }

            VAR_6 = ((VAR_5 & 0xFF) << 16) + ((VAR_7 & 0xFF) << 8) + (VAR_8 & 0xFF);

        }

    }

    if (VAR_4 != 4) {

        if (strcmp(VAR_2, "ffmpeg") == 0)

            VAR_0->lavc_build = 4600;

    }

    if (VAR_4 == 4)

        VAR_0->lavc_build = VAR_6;



    

    VAR_4 = sscanf(VAR_2, "XviD%d", &VAR_6);

    if (VAR_4 == 1)

        VAR_0->xvid_build = VAR_6;



    return 0;

}

static int FUNC_0(Mpeg4DecContext *VAR_0, GetBitContext *VAR_1)
{ MpegEncContext *s = &VAR_0->m; char VAR_2[256]; int VAR_3; int VAR_4; int VAR_5 = 0, VAR_6 = 0, VAR_7 = 0, VAR_8 = 0; char VAR_9; for (VAR_3 = 0; VAR_3 < 255 && get_bits_count(VAR_1) < VAR_1->size_in_bits; VAR_3++) { if (show_bits(VAR_1, 23) == 0)
break; VAR_2[VAR_3] = get_bits(VAR_1, 8); } VAR_2[VAR_3] = 0; VAR_4 = sscanf(VAR_2, "DivX%dBuild%d%c", &VAR_5, &VAR_6, &VAR_9); if (VAR_4 < 2)
VAR_4 = sscanf(VAR_2, "DivX%db%d%c", &VAR_5, &VAR_6, &VAR_9); if (VAR_4 >= 2) { VAR_0->divx_version = VAR_5; VAR_0->divx_build   = VAR_6; s->divx_packed  = VAR_4 == 3 && VAR_9 == 'p'; } VAR_4 = sscanf(VAR_2, "FFmpe%*[^b]b%d", &VAR_6) + 3; if (VAR_4 != 4)
VAR_4 = sscanf(VAR_2, "FFmpeg v%d.%d.%d / libavcodec VAR_6: %d", &VAR_5, &VAR_7, &VAR_8, &VAR_6); if (VAR_4 != 4) { VAR_4 = sscanf(VAR_2, "Lavc%d.%d.%d", &VAR_5, &VAR_7, &VAR_8) + 1; if (VAR_4 > 1) { if (VAR_5 > 0xFF || VAR_7 > 0xFF || VAR_8 > 0xFF) { av_log(s->avctx, AV_LOG_WARNING,
"Unknown Lavc version string encountered, %d.%d.%d; " "clamping sub-version values to 8-bits.\n",
VAR_5, VAR_7, VAR_8); } VAR_6 = ((VAR_5 & 0xFF) << 16) + ((VAR_7 & 0xFF) << 8) + (VAR_8 & 0xFF); } } if (VAR_4 != 4) { if (strcmp(VAR_2, "ffmpeg") == 0)
VAR_0->lavc_build = 4600; } if (VAR_4 == 4)
VAR_0->lavc_build = VAR_6; VAR_4 = sscanf(VAR_2, "XviD%d", &VAR_6); if (VAR_4 == 1)
VAR_0->xvid_build = VAR_6; return 0; }