Revision b19d493f libavcodec/h264.c

View differences:

libavcodec/h264.c
3153 3153
        h->delayed_pic[i]= NULL;
3154 3154
    }
3155 3155
    h->outputed_poc= INT_MIN;
3156
    h->prev_interlaced_frame = 1;
3156 3157
    idr(h);
3157 3158
    if(h->s.current_picture_ptr)
3158 3159
        h->s.current_picture_ptr->reference= 0;
......
3807 3808
        if (MPV_common_init(s) < 0)
3808 3809
            return -1;
3809 3810
        s->first_field = 0;
3811
        h->prev_interlaced_frame = 1;
3810 3812

  
3811 3813
        init_scan_tables(h);
3812 3814
        alloc_tables(h);
......
7789 7791
            *data_size = 0;
7790 7792

  
7791 7793
        } else {
7794
            cur->interlaced_frame = 0;
7792 7795
            cur->repeat_pict = 0;
7793 7796

  
7794 7797
            /* Signal interlacing information externally. */
7795 7798
            /* Prioritize picture timing SEI information over used decoding process if it exists. */
7796
            if (h->sei_ct_type & 3)
7797
                cur->interlaced_frame = (h->sei_ct_type & (1<<1)) != 0;
7798
            else
7799
                cur->interlaced_frame = FIELD_OR_MBAFF_PICTURE;
7800 7799

  
7801 7800
            if(h->sps.pic_struct_present_flag){
7802 7801
                switch (h->sei_pic_struct)
7803 7802
                {
7803
                case SEI_PIC_STRUCT_FRAME:
7804
                    break;
7805
                case SEI_PIC_STRUCT_TOP_FIELD:
7806
                case SEI_PIC_STRUCT_BOTTOM_FIELD:
7807
                    cur->interlaced_frame = 1;
7808
                    break;
7809
                case SEI_PIC_STRUCT_TOP_BOTTOM:
7810
                case SEI_PIC_STRUCT_BOTTOM_TOP:
7811
                    if (FIELD_OR_MBAFF_PICTURE)
7812
                        cur->interlaced_frame = 1;
7813
                    else
7814
                        // try to flag soft telecine progressive
7815
                        cur->interlaced_frame = h->prev_interlaced_frame;
7816
                    break;
7804 7817
                case SEI_PIC_STRUCT_TOP_BOTTOM_TOP:
7805 7818
                case SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM:
7806 7819
                    // Signal the possibility of telecined film externally (pic_struct 5,6)
......
7809 7822
                    break;
7810 7823
                case SEI_PIC_STRUCT_FRAME_DOUBLING:
7811 7824
                    // Force progressive here, as doubling interlaced frame is a bad idea.
7812
                    cur->interlaced_frame = 0;
7813 7825
                    cur->repeat_pict = 2;
7814 7826
                    break;
7815 7827
                case SEI_PIC_STRUCT_FRAME_TRIPLING:
7816
                    cur->interlaced_frame = 0;
7817 7828
                    cur->repeat_pict = 4;
7818 7829
                    break;
7819 7830
                }
7831

  
7832
                if ((h->sei_ct_type & 3) && h->sei_pic_struct <= SEI_PIC_STRUCT_BOTTOM_TOP)
7833
                    cur->interlaced_frame = (h->sei_ct_type & (1<<1)) != 0;
7820 7834
            }else{
7821 7835
                /* Derive interlacing flag from used decoding process. */
7822 7836
                cur->interlaced_frame = FIELD_OR_MBAFF_PICTURE;
7823 7837
            }
7838
            h->prev_interlaced_frame = cur->interlaced_frame;
7824 7839

  
7825 7840
            if (cur->field_poc[0] != cur->field_poc[1]){
7826 7841
                /* Derive top_field_first from field pocs. */

Also available in: Unified diff