# HG changeset patch # User michael # Date 1090935616 0 # Node ID 678be5a8f2827570f8cd863548cfa05fea16f246 # Parent f980082baeaa083b6e415a8b0b26cf716bf7c004 use parent sample to predict significance & magnitude 1% bitrate reduction (foreman@352x288 qscale 1 & 8) diff -r f980082baeaa -r 678be5a8f282 snow.c --- a/snow.c Tue Jul 27 11:09:41 2004 +0000 +++ b/snow.c Tue Jul 27 13:40:16 2004 +0000 @@ -1419,7 +1419,7 @@ for(y=0; y>1; + int py= (orientation==1 ? x : y)>>1; + if(pxparent->width && pyparent->height) + p= parent[px + py*2*stride]; + } + if(!(/*ll|*/l|lt|t|rt|p)){ if(v){ runs[run_index++]= run; run=0; @@ -1462,7 +1468,7 @@ for(y=0; y>1; + int py= (orientation==1 ? x : y)>>1; + if(pxparent->width && pyparent->height) + p= parent[px + py*2*stride]; + } + if(/*ll|*/l|lt|t|rt|p){ + int context= av_log2(/*ABS(ll) + */3*ABS(l) + ABS(lt) + 2*ABS(t) + ABS(rt) + ABS(p)); put_cabac(&s->c, &b->state[0][context], !!v); }else{ @@ -1502,7 +1514,7 @@ } } if(v){ - int context= av_log2(/*ABS(ll) + */3*ABS(l) + ABS(lt) + 2*ABS(t) + ABS(rt)); + int context= av_log2(/*ABS(ll) + */3*ABS(l) + ABS(lt) + 2*ABS(t) + ABS(rt) + ABS(p)); put_symbol(&s->c, b->state[context + 2], ABS(v)-1, 0); put_cabac(&s->c, &b->state[0][16 + 1 + 3 + quant3b[l&0xFF] + 3*quant3b[t&0xFF]], v<0); @@ -1642,7 +1654,7 @@ run= get_symbol(&s->c, b->state[1], 0); for(y=0; y>1; + int py= (orientation==1 ? x : y)>>1; + if(pxparent->width && pyparent->height) + p= parent[px + py*2*stride]; + } + if(/*ll|*/l|lt|t|rt|p){ + int context= av_log2(/*ABS(ll) + */3*ABS(l) + ABS(lt) + 2*ABS(t) + ABS(rt) + ABS(p)); v=get_cabac(&s->c, &b->state[0][context]); }else{ @@ -1681,7 +1699,7 @@ } } if(v){ - int context= av_log2(/*ABS(ll) + */3*ABS(l) + ABS(lt) + 2*ABS(t) + ABS(rt)); + int context= av_log2(/*ABS(ll) + */3*ABS(l) + ABS(lt) + 2*ABS(t) + ABS(rt) + ABS(p)); v= get_symbol(&s->c, b->state[context + 2], 0) + 1; if(get_cabac(&s->c, &b->state[0][16 + 1 + 3 + quant3b[l&0xFF] + 3*quant3b[t&0xFF]])) v= -v;