Revision 757ec2d7

View differences:

libavcodec/mpegvideo.c
1617 1617
    uint8_t *ptr_y, *ptr_cb, *ptr_cr;
1618 1618
    int mx, my, src_x, src_y, uvsrc_x, uvsrc_y, uvlinesize, linesize, sx, sy, uvsx, uvsy;
1619 1619
    const int lowres= s->avctx->lowres;
1620
    const int op_index= FFMIN(lowres, 2);
1620
    const int op_index= FFMIN(lowres-1+s->chroma_x_shift, 2);
1621 1621
    const int block_s= 8>>lowres;
1622 1622
    const int s_mask= (2<<lowres)-1;
1623 1623
    const int h_edge_pos = s->h_edge_pos >> lowres;
......
1652 1652
        uvsrc_x = s->mb_x*block_s               + (mx >> lowres);
1653 1653
        uvsrc_y =    mb_y*block_s               + (my >> lowres);
1654 1654
    } else {
1655
        mx = motion_x / 2;
1656
        my = motion_y / 2;
1657
        uvsx = mx & s_mask;
1658
        uvsy = my & s_mask;
1659
        uvsrc_x = s->mb_x*block_s               + (mx >> (lowres+1));
1660
        uvsrc_y =(   mb_y*block_s>>field_based) + (my >> (lowres+1));
1655
        if(s->chroma_y_shift){
1656
            mx = motion_x / 2;
1657
            my = motion_y / 2;
1658
            uvsx = mx & s_mask;
1659
            uvsy = my & s_mask;
1660
            uvsrc_x = s->mb_x*block_s               + (mx >> (lowres+1));
1661
            uvsrc_y =(   mb_y*block_s>>field_based) + (my >> (lowres+1));
1662
        } else {
1663
            if(s->chroma_x_shift){
1664
            //Chroma422
1665
                mx = motion_x / 2;
1666
                uvsx = mx & s_mask;
1667
                uvsy = motion_y & s_mask;
1668
                uvsrc_y = src_y;
1669
                uvsrc_x = s->mb_x*2*block_s               + (mx >> (lowres+1));
1670
            } else {
1671
            //Chroma444
1672
                uvsx = motion_x & s_mask;
1673
                uvsy = motion_y & s_mask;
1674
                uvsrc_x = src_x;
1675
                uvsrc_y = src_y;
1676
            }
1677
        }
1661 1678
    }
1662 1679

  
1663 1680
    ptr_y  = ref_picture[0] + src_y * linesize + src_x;
......
2163 2180
                    }else{
2164 2181
                        //chroma422
2165 2182
                        dct_linesize = uvlinesize << s->interlaced_dct;
2166
                        dct_offset =(s->interlaced_dct)? uvlinesize : uvlinesize*8;
2183
                        dct_offset =(s->interlaced_dct)? uvlinesize : uvlinesize*block_size;
2167 2184

  
2168 2185
                        add_dct(s, block[4], 4, dest_cb, dct_linesize);
2169 2186
                        add_dct(s, block[5], 5, dest_cr, dct_linesize);
2170 2187
                        add_dct(s, block[6], 6, dest_cb+dct_offset, dct_linesize);
2171 2188
                        add_dct(s, block[7], 7, dest_cr+dct_offset, dct_linesize);
2172 2189
                        if(!s->chroma_x_shift){//Chroma444
2173
                            add_dct(s, block[8], 8, dest_cb+8, dct_linesize);
2174
                            add_dct(s, block[9], 9, dest_cr+8, dct_linesize);
2175
                            add_dct(s, block[10], 10, dest_cb+8+dct_offset, dct_linesize);
2176
                            add_dct(s, block[11], 11, dest_cr+8+dct_offset, dct_linesize);
2190
                            add_dct(s, block[8], 8, dest_cb+block_size, dct_linesize);
2191
                            add_dct(s, block[9], 9, dest_cr+block_size, dct_linesize);
2192
                            add_dct(s, block[10], 10, dest_cb+block_size+dct_offset, dct_linesize);
2193
                            add_dct(s, block[11], 11, dest_cr+block_size+dct_offset, dct_linesize);
2177 2194
                        }
2178 2195
                    }
2179 2196
                }//fi gray

Also available in: Unified diff