Revision ff765159

View differences:

libavcodec/snow.c
1921 1921
            int v=0;
1922 1922
            int lt=0, t=0, rt=0;
1923 1923

  
1924
            if(y){
1925
                rt= src[(y-1)*stride];
1924
            if(y && b->x[prev_index] == 0){
1925
                rt= b->coeff[prev_index];
1926 1926
            }
1927 1927
            for(x=0; x<w; x++){
1928 1928
                int p=0;
......
1930 1930
                
1931 1931
                lt= t; t= rt;
1932 1932

  
1933
                if(y && x + 1 < w){
1934
                    rt= src[x + 1 + (y-1)*stride];
1935
                }else
1936
                    rt= 0;
1933
                if(y){
1934
                    if(b->x[prev_index] <= x) //FIXME if
1935
                        prev_index++;
1936
                    if(b->x[prev_index] == x + 1)
1937
                        rt= b->coeff[prev_index];
1938
                    else
1939
                        rt=0;
1940
                }
1937 1941
                if(parent){
1938
                    int px= x>>1;
1939
                    int py= y>>1;
1940
                    if(px<b->parent->width && py<b->parent->height) 
1941
                        p= parent[px + py*2*stride];
1942

  
1943 1942
                    if(x>>1 > b->parent->x[parent_index]){
1944 1943
                        parent_index++;
1945 1944
                    }
1945
                    if(x>>1 == b->parent->x[parent_index]){
1946
                        p= b->parent->coeff[parent_index];
1947
                    }
1946 1948
                }
1947 1949
                if(/*ll|*/l|lt|t|rt|p){
1948 1950
                    int context= av_log2(/*ABS(ll) + */3*ABS(l) + ABS(lt) + 2*ABS(t) + ABS(rt) + ABS(p));
......
1958 1960

  
1959 1961
                        if(y && parent){
1960 1962
                            int max_run;
1961
                            while(b->x[prev_index] < x)
1962
                                prev_index++;
1963 1963

  
1964 1964
                            max_run= FFMIN(run, b->x[prev_index] - x - 2);
1965 1965
                            max_run= FFMIN(max_run, 2*b->parent->x[parent_index] - x - 1);
......
1974 1974
                    if(get_cabac(&s->c, &b->state[0][16 + 1 + 3 + quant3b[l&0xFF] + 3*quant3b[t&0xFF]]))
1975 1975
                        v= -v;
1976 1976
                    src[x + y*stride]= v;
1977
                    b->x[index++]=x; //FIXME interleave x/coeff
1978
//                    b->coeff[index++]= v;
1977
                    b->x[index]=x; //FIXME interleave x/coeff
1978
                    b->coeff[index++]= v;
1979 1979
                }
1980 1980
            }
1981 1981
            b->x[index++]= w+1; //end marker

Also available in: Unified diff