static void mov_parse_stsd_video(MOVContext *c, AVIOContext *pb,

                                 AVStream *st, MOVStreamContext *sc)

{

    uint8_t codec_name[32];

    int64_t stsd_start;

    unsigned int len;



    /* The first 16 bytes of the video sample description are already

     * read in ff_mov_read_stsd_entries() */

    stsd_start = avio_tell(pb) - 16;



    avio_rb16(pb); /* version */

    avio_rb16(pb); /* revision level */

    avio_rb32(pb); /* vendor */

    avio_rb32(pb); /* temporal quality */

    avio_rb32(pb); /* spatial quality */



    st->codecpar->width  = avio_rb16(pb); /* width */

    st->codecpar->height = avio_rb16(pb); /* height */



    avio_rb32(pb); /* horiz resolution */

    avio_rb32(pb); /* vert resolution */

    avio_rb32(pb); /* data size, always 0 */

    avio_rb16(pb); /* frames per samples */



    len = avio_r8(pb); /* codec name, pascal string */

    if (len > 31)

        len = 31;

    mov_read_mac_string(c, pb, len, codec_name, sizeof(codec_name));

    if (len < 31)

        avio_skip(pb, 31 - len);



    if (codec_name[0])

        av_dict_set(&st->metadata, "encoder", codec_name, 0);



    /* codec_tag YV12 triggers an UV swap in rawdec.c */

    if (!memcmp(codec_name, "Planar Y'CbCr 8-bit 4:2:0", 25)) {

        st->codecpar->codec_tag = MKTAG('I', '4', '2', '0');

        st->codecpar->width &= ~1;

        st->codecpar->height &= ~1;

    }

    /* Flash Media Server uses tag H.263 with Sorenson Spark */

    if (st->codecpar->codec_tag == MKTAG('H','2','6','3') &&

        !memcmp(codec_name, "Sorenson H263", 13))

        st->codecpar->codec_id = AV_CODEC_ID_FLV1;



    st->codecpar->bits_per_coded_sample = avio_rb16(pb); /* depth */



    avio_seek(pb, stsd_start, SEEK_SET);



    if (ff_get_qtpalette(st->codecpar->codec_id, pb, sc->palette)) {

        st->codecpar->bits_per_coded_sample &= 0x1F;

        sc->has_palette = 1;

    }

}

static void mov_parse_stsd_video(MOVContext *c, AVIOContext *pb,

                                 AVStream *st, MOVStreamContext *sc)

{

    uint8_t codec_name[32];

    int64_t stsd_start;

    unsigned int len;



    



    stsd_start = avio_tell(pb) - 16;



    avio_rb16(pb); 

    avio_rb16(pb); 

    avio_rb32(pb); 

    avio_rb32(pb); 

    avio_rb32(pb); 



    st->codecpar->width  = avio_rb16(pb); 

    st->codecpar->height = avio_rb16(pb); 



    avio_rb32(pb); 

    avio_rb32(pb); 

    avio_rb32(pb); 

    avio_rb16(pb); 



    len = avio_r8(pb); 

    if (len > 31)

        len = 31;

    mov_read_mac_string(c, pb, len, codec_name, sizeof(codec_name));

    if (len < 31)

        avio_skip(pb, 31 - len);



    if (codec_name[0])

        av_dict_set(&st->metadata, "encoder", codec_name, 0);



    

    if (!memcmp(codec_name, "Planar Y'CbCr 8-bit 4:2:0", 25)) {

        st->codecpar->codec_tag = MKTAG('I', '4', '2', '0');

        st->codecpar->width &= ~1;

        st->codecpar->height &= ~1;

    }

    

    if (st->codecpar->codec_tag == MKTAG('H','2','6','3') &&

        !memcmp(codec_name, "Sorenson H263", 13))

        st->codecpar->codec_id = AV_CODEC_ID_FLV1;



    st->codecpar->bits_per_coded_sample = avio_rb16(pb); 



    avio_seek(pb, stsd_start, SEEK_SET);



    if (ff_get_qtpalette(st->codecpar->codec_id, pb, sc->palette)) {

        st->codecpar->bits_per_coded_sample &= 0x1F;

        sc->has_palette = 1;

    }

}

    uint8_t codec_name[32];
static void FUNC_0(MOVContext *VAR_0, AVIOContext *VAR_1,

                                 AVStream *VAR_2, MOVStreamContext *VAR_3)

{

    uint8_t codec_name[32];

    int64_t stsd_start;

    unsigned int VAR_4;



    



    stsd_start = avio_tell(VAR_1) - 16;



    avio_rb16(VAR_1); 

    avio_rb16(VAR_1); 

    avio_rb32(VAR_1); 

    avio_rb32(VAR_1); 

    avio_rb32(VAR_1); 



    VAR_2->codecpar->width  = avio_rb16(VAR_1); 

    VAR_2->codecpar->height = avio_rb16(VAR_1); 



    avio_rb32(VAR_1); 

    avio_rb32(VAR_1); 

    avio_rb32(VAR_1); 

    avio_rb16(VAR_1); 



    VAR_4 = avio_r8(VAR_1); 

    if (VAR_4 > 31)

        VAR_4 = 31;

    mov_read_mac_string(VAR_0, VAR_1, VAR_4, codec_name, sizeof(codec_name));

    if (VAR_4 < 31)

        avio_skip(VAR_1, 31 - VAR_4);



    if (codec_name[0])

        av_dict_set(&VAR_2->metadata, "encoder", codec_name, 0);



    

    if (!memcmp(codec_name, "Planar Y'CbCr 8-bit 4:2:0", 25)) {

        VAR_2->codecpar->codec_tag = MKTAG('I', '4', '2', '0');

        VAR_2->codecpar->width &= ~1;

        VAR_2->codecpar->height &= ~1;

    }

    

    if (VAR_2->codecpar->codec_tag == MKTAG('H','2','6','3') &&

        !memcmp(codec_name, "Sorenson H263", 13))

        VAR_2->codecpar->codec_id = AV_CODEC_ID_FLV1;



    VAR_2->codecpar->bits_per_coded_sample = avio_rb16(VAR_1); 



    avio_seek(VAR_1, stsd_start, SEEK_SET);



    if (ff_get_qtpalette(VAR_2->codecpar->codec_id, VAR_1, VAR_3->palette)) {

        VAR_2->codecpar->bits_per_coded_sample &= 0x1F;

        VAR_3->has_palette = 1;

    }

}

static void FUNC_0(MOVContext *VAR_0, AVIOContext *VAR_1,
AVStream *VAR_2, MOVStreamContext *VAR_3)
{ uint8_t codec_name[32]; int64_t stsd_start; unsigned int VAR_4; stsd_start = avio_tell(VAR_1) - 16; avio_rb16(VAR_1); avio_rb16(VAR_1); avio_rb32(VAR_1); avio_rb32(VAR_1); avio_rb32(VAR_1); VAR_2->codecpar->width  = avio_rb16(VAR_1); VAR_2->codecpar->height = avio_rb16(VAR_1); avio_rb32(VAR_1); avio_rb32(VAR_1); avio_rb32(VAR_1); avio_rb16(VAR_1); VAR_4 = avio_r8(VAR_1); if (VAR_4 > 31)
VAR_4 = 31; mov_read_mac_string(VAR_0, VAR_1, VAR_4, codec_name, sizeof(codec_name)); if (VAR_4 < 31)
avio_skip(VAR_1, 31 - VAR_4); if (codec_name[0])
av_dict_set(&VAR_2->metadata, "encoder", codec_name, 0); if (!memcmp(codec_name, "Planar Y'CbCr 8-bit 4:2:0", 25)) { VAR_2->codecpar->codec_tag = MKTAG('I', '4', '2', '0'); VAR_2->codecpar->width &= ~1; VAR_2->codecpar->height &= ~1; } if (VAR_2->codecpar->codec_tag == MKTAG('H','2','6','3') &&
!memcmp(codec_name, "Sorenson H263", 13))
VAR_2->codecpar->codec_id = AV_CODEC_ID_FLV1; VAR_2->codecpar->bits_per_coded_sample = avio_rb16(VAR_1); avio_seek(VAR_1, stsd_start, SEEK_SET); if (ff_get_qtpalette(VAR_2->codecpar->codec_id, VAR_1, VAR_3->palette)) { VAR_2->codecpar->bits_per_coded_sample &= 0x1F; VAR_3->has_palette = 1; } }