~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/libavcodec/mpegvideo_common.h

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-01-12 22:23:28 UTC
  • mfrom: (0.4.7 sid)
  • mto: This revision was merged to the branch mainline in revision 76.
  • Revision ID: package-import@ubuntu.com-20120112222328-8jqdyodym3p84ygu
Tags: 2:1.0~rc4.dfsg1+svn34540-1
* New upstream snapshot
* upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
int dct_quantize_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow);
43
43
 
44
44
/**
45
 
 * allocates a Picture
46
 
 * The pixels are allocated/set by calling get_buffer() if shared=0
 
45
 * Allocate a Picture.
 
46
 * The pixels are allocated/set by calling get_buffer() if shared = 0.
47
47
 */
48
48
int alloc_picture(MpegEncContext *s, Picture *pic, int shared);
49
49
 
50
50
/**
51
 
 * sets the given MpegEncContext to common defaults (same for encoding and decoding).
52
 
 * the changed fields will not depend upon the prior state of the MpegEncContext.
 
51
 * Set the given MpegEncContext to common defaults (same for encoding and decoding).
 
52
 * The changed fields will not depend upon the prior state of the MpegEncContext.
53
53
 */
54
54
void MPV_common_defaults(MpegEncContext *s);
55
55
 
255
255
#endif
256
256
 
257
257
    v_edge_pos = s->v_edge_pos >> field_based;
258
 
    linesize   = s->current_picture.linesize[0] << field_based;
259
 
    uvlinesize = s->current_picture.linesize[1] << field_based;
 
258
    linesize   = s->current_picture.f.linesize[0] << field_based;
 
259
    uvlinesize = s->current_picture.f.linesize[1] << field_based;
260
260
 
261
261
    dxy = ((motion_y & 1) << 1) | (motion_x & 1);
262
262
    src_x = s->mb_x* 16               + (motion_x >> 1);
585
585
    if (src_y == (s->height >> 1))
586
586
        dxy &= ~2;
587
587
 
588
 
    offset = (src_y * (s->uvlinesize)) + src_x;
 
588
    offset = src_y * s->uvlinesize + src_x;
589
589
    ptr = ref_picture[1] + offset;
590
590
    if(s->flags&CODEC_FLAG_EMU_EDGE){
591
591
        if(   (unsigned)src_x > (s->h_edge_pos>>1) - (dxy &1) - 8
657
657
 
658
658
        assert(!s->mb_skipped);
659
659
 
660
 
        memcpy(mv_cache[1][1], s->current_picture.motion_val[0][mot_xy           ], sizeof(int16_t)*4);
661
 
        memcpy(mv_cache[2][1], s->current_picture.motion_val[0][mot_xy+mot_stride], sizeof(int16_t)*4);
662
 
        memcpy(mv_cache[3][1], s->current_picture.motion_val[0][mot_xy+mot_stride], sizeof(int16_t)*4);
 
660
        memcpy(mv_cache[1][1], s->current_picture.f.motion_val[0][mot_xy             ], sizeof(int16_t) * 4);
 
661
        memcpy(mv_cache[2][1], s->current_picture.f.motion_val[0][mot_xy + mot_stride], sizeof(int16_t) * 4);
 
662
        memcpy(mv_cache[3][1], s->current_picture.f.motion_val[0][mot_xy + mot_stride], sizeof(int16_t) * 4);
663
663
 
664
 
        if(mb_y==0 || IS_INTRA(s->current_picture.mb_type[xy-s->mb_stride])){
 
664
        if (mb_y == 0 || IS_INTRA(s->current_picture.f.mb_type[xy - s->mb_stride])) {
665
665
            memcpy(mv_cache[0][1], mv_cache[1][1], sizeof(int16_t)*4);
666
666
        }else{
667
 
            memcpy(mv_cache[0][1], s->current_picture.motion_val[0][mot_xy-mot_stride], sizeof(int16_t)*4);
 
667
            memcpy(mv_cache[0][1], s->current_picture.f.motion_val[0][mot_xy - mot_stride], sizeof(int16_t) * 4);
668
668
        }
669
669
 
670
 
        if(mb_x==0 || IS_INTRA(s->current_picture.mb_type[xy-1])){
 
670
        if (mb_x == 0 || IS_INTRA(s->current_picture.f.mb_type[xy - 1])) {
671
671
            AV_COPY32(mv_cache[1][0], mv_cache[1][1]);
672
672
            AV_COPY32(mv_cache[2][0], mv_cache[2][1]);
673
673
        }else{
674
 
            AV_COPY32(mv_cache[1][0], s->current_picture.motion_val[0][mot_xy-1]);
675
 
            AV_COPY32(mv_cache[2][0], s->current_picture.motion_val[0][mot_xy-1+mot_stride]);
 
674
            AV_COPY32(mv_cache[1][0], s->current_picture.f.motion_val[0][mot_xy - 1]);
 
675
            AV_COPY32(mv_cache[2][0], s->current_picture.f.motion_val[0][mot_xy - 1 + mot_stride]);
676
676
        }
677
677
 
678
 
        if(mb_x+1>=s->mb_width || IS_INTRA(s->current_picture.mb_type[xy+1])){
 
678
        if (mb_x + 1 >= s->mb_width || IS_INTRA(s->current_picture.f.mb_type[xy + 1])) {
679
679
            AV_COPY32(mv_cache[1][3], mv_cache[1][2]);
680
680
            AV_COPY32(mv_cache[2][3], mv_cache[2][2]);
681
681
        }else{
682
 
            AV_COPY32(mv_cache[1][3], s->current_picture.motion_val[0][mot_xy+2]);
683
 
            AV_COPY32(mv_cache[2][3], s->current_picture.motion_val[0][mot_xy+2+mot_stride]);
 
682
            AV_COPY32(mv_cache[1][3], s->current_picture.f.motion_val[0][mot_xy + 2]);
 
683
            AV_COPY32(mv_cache[2][3], s->current_picture.f.motion_val[0][mot_xy + 2 + mot_stride]);
684
684
        }
685
685
 
686
686
        mx = 0;
817
817
            }
818
818
        } else {
819
819
            if(s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != AV_PICTURE_TYPE_B && !s->first_field){
820
 
                ref_picture= s->current_picture_ptr->data;
 
820
                ref_picture = s->current_picture_ptr->f.data;
821
821
            }
822
822
 
823
823
            mpeg_motion(s, dest_y, dest_cb, dest_cr,
834
834
               || s->pict_type == AV_PICTURE_TYPE_B || s->first_field){
835
835
                ref2picture= ref_picture;
836
836
            }else{
837
 
                ref2picture= s->current_picture_ptr->data;
 
837
                ref2picture = s->current_picture_ptr->f.data;
838
838
            }
839
839
 
840
840
            mpeg_motion(s, dest_y, dest_cb, dest_cr,
871
871
 
872
872
                //opposite parity is always in the same frame if this is second field
873
873
                if(!s->first_field){
874
 
                    ref_picture = s->current_picture_ptr->data;
 
874
                    ref_picture = s->current_picture_ptr->f.data;
875
875
                }
876
876
            }
877
877
        }