Revision 3bb07d61

View differences:

libavcodec/avcodec.h
15 15

  
16 16
#define LIBAVCODEC_VERSION_INT 0x000406
17 17
#define LIBAVCODEC_VERSION     "0.4.6"
18
#define LIBAVCODEC_BUILD       4670
19
#define LIBAVCODEC_BUILD_STR   "4670"
18
#define LIBAVCODEC_BUILD       4671
19
#define LIBAVCODEC_BUILD_STR   "4671"
20 20

  
21 21
#define LIBAVCODEC_IDENT	"FFmpeg" LIBAVCODEC_VERSION "b" LIBAVCODEC_BUILD_STR
22 22

  
......
183 183
                                            of only at frame boundaries */
184 184
#define CODEC_FLAG_NORMALIZE_AQP  0x00020000 ///< normalize adaptive quantization 
185 185
#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< use interlaced dct 
186
#define CODEC_FLAG_LOW_DELAY      0x00080000 ///< force low delay / will fail on b frames 
186
#define CODEC_FLAG_LOW_DELAY      0x00080000 ///< force low delay
187 187
#define CODEC_FLAG_ALT_SCAN       0x00100000 ///< use alternate scan 
188 188
#define CODEC_FLAG_TRELLIS_QUANT  0x00200000 ///< use trellis quantization 
189 189
#define CODEC_FLAG_GLOBAL_HEADER  0x00400000 ///< place global headers in extradata instead of every keyframe 
......
471 471
     * before
472 472
     * - encoding: unused
473 473
     * - decoding: set by user.
474
     * @param height the height of the slice
475
     * @param y the y position of the slice
476
     * @param type 1->top field, 2->bottom field, 3->frame
477
     * @param offset offset into the AVFrame.data from which the slice should be read
474 478
     */
475 479
    void (*draw_horiz_band)(struct AVCodecContext *s,
476 480
                            AVFrame *src, int offset[4],
477
                            int y, int width, int height);
481
                            int y, int type, int height);
478 482

  
479 483
    /* audio only */
480 484
    int sample_rate; ///< samples per sec 
......
669 673
    /**
670 674
     * called at the beginning of each frame to get a buffer for it.
671 675
     * if pic.reference is set then the frame will be read later by lavc
676
     * width and height should be rounded up to the next multiple of 16
672 677
     * - encoding: unused
673 678
     * - decoding: set by lavc, user can override
674 679
     */
......
1146 1151
     * - decoding: unused
1147 1152
     */
1148 1153
    int context_model;
1154
    
1155
    /**
1156
     * slice flags
1157
     * - encoding: unused
1158
     * - decoding: set by user.
1159
     */
1160
    int slice_flags;
1161
#define SLICE_FLAG_CODED_ORDER    0x0001 ///< draw_horiz_band() is called in coded order instead of display
1162
#define SLICE_FLAG_ALLOW_FIELD    0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
1163
#define SLICE_FLAG_ALLOW_PLANE    0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
1164

  
1149 1165
} AVCodecContext;
1150 1166

  
1151 1167

  
libavcodec/huffyuv.c
693 693
    offset[3] = 0;
694 694
    emms_c();
695 695

  
696
    s->avctx->draw_horiz_band(s->avctx, &s->picture, offset, y, s->width, h);
696
    s->avctx->draw_horiz_band(s->avctx, &s->picture, offset, y, 3, h);
697 697
    
698 698
    s->last_slice_end= y + h;
699 699
}
libavcodec/mpeg12.c
1943 1943
        MPV_decode_mb(s, s->block);
1944 1944

  
1945 1945
        if (++s->mb_x >= s->mb_width) {
1946
            if(s->picture_structure==PICT_FRAME){
1947
                ff_draw_horiz_band(s, 16*s->mb_y, 16);
1948
            }else{
1949
                if(!s->first_field){
1950
                    ff_draw_horiz_band(s, 32*s->mb_y, 32);
1951
                }
1952
            }
1946
            ff_draw_horiz_band(s, 16*s->mb_y, 16);
1953 1947

  
1954 1948
            s->mb_x = 0;
1955 1949
            s->mb_y++;
libavcodec/mpegvideo.c
2726 2726
 */
2727 2727
void ff_draw_horiz_band(MpegEncContext *s, int y, int h){
2728 2728
    if (s->avctx->draw_horiz_band) {
2729
        AVFrame *src;
2729 2730
        uint8_t *src_ptr[3];
2730 2731
        int offset[4];
2732
        
2733
        if(s->picture_structure != PICT_FRAME){
2734
            h <<= 1;
2735
            y <<= 1;
2736
            if(s->first_field  && !(s->avctx->slice_flags&SLICE_FLAG_ALLOW_FIELD)) return;
2737
        }
2738

  
2731 2739
        h= FFMIN(h, s->height - y);
2732 2740

  
2741
        if(s->pict_type==B_TYPE || s->low_delay || (s->avctx->slice_flags&SLICE_FLAG_CODED_ORDER)) 
2742
            src= (AVFrame*)s->current_picture_ptr;
2743
        else if(s->last_picture_ptr)
2744
            src= (AVFrame*)s->last_picture_ptr;
2745
        else
2746
            return;
2747
            
2733 2748
        if(s->pict_type==B_TYPE && s->picture_structure == PICT_FRAME && s->out_format != FMT_H264){
2734 2749
            offset[0]=
2735 2750
            offset[1]=
......
2744 2759

  
2745 2760
        emms_c();
2746 2761

  
2747
        s->avctx->draw_horiz_band(s->avctx, (AVFrame*)s->current_picture_ptr, offset,
2748
                               y, s->width, h);
2762
        s->avctx->draw_horiz_band(s->avctx, src, offset,
2763
                                  y, s->picture_structure, h);
2749 2764
    }
2750 2765
}
2751 2766

  

Also available in: Unified diff