X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=doc%2Fsnow.txt;h=f99133971c370d3c3a7470dfe2c9d3f33a9b0bfc;hb=7c92c03b8d0aec2b593ade85525c7a8f87fecc63;hp=eaf34079b550b2a3dd3fb477baf884e9b078075d;hpb=48fe9238a0aec437aa9ab9a8912191d163feb519;p=ffmpeg diff --git a/doc/snow.txt b/doc/snow.txt index eaf34079b55..f99133971c3 100644 --- a/doc/snow.txt +++ b/doc/snow.txt @@ -1,17 +1,18 @@ ============================================= -SNOW Video Codec Specification Draft 20070103 +Snow Video Codec Specification Draft 20080110 ============================================= -Intro: -====== -This Specification describes the snow syntax and semmantics as well as -how to decode snow. -The decoding process is precissely described and any compliant decoder -MUST produce the exactly same output for a spec conformant snow stream. -For encoding though any process which generates a stream compliant to -the syntactical and semmantical requirements and which is decodeable by +Introduction: +============= +This specification describes the Snow bitstream syntax and semantics as +well as the formal Snow decoding process. + +The decoding process is described precisely and any compliant decoder +MUST produce the exact same output for a spec-conformant Snow stream. +For encoding, though, any process which generates a stream compliant to +the syntactical and semantic requirements and which is decodable by the process described in this spec shall be considered a conformant -snow encoder. +Snow encoder. Definitions: ============ @@ -308,8 +309,48 @@ Decoding process: Range Coder: ============ + +Binary Range Coder: +------------------- +The implemented range coder is an adapted version based upon "Range encoding: +an algorithm for removing redundancy from a digitised message." by G. N. N. +Martin. +The symbols encoded by the Snow range coder are bits (0|1). The +associated probabilities are not fix but change depending on the symbol mix +seen so far. + + +bit seen | new state +---------+----------------------------------------------- + 0 | 256 - state_transition_table[256 - old_state]; + 1 | state_transition_table[ old_state]; + +state_transition_table = { + 0, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, +104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 114, 115, 116, 117, 118, +119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 133, +134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, +150, 151, 152, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, +165, 166, 167, 168, 169, 170, 171, 171, 172, 173, 174, 175, 176, 177, 178, 179, +180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 190, 191, 192, 194, 194, +195, 196, 197, 198, 199, 200, 201, 202, 202, 204, 205, 206, 207, 208, 209, 209, +210, 211, 212, 213, 215, 215, 216, 217, 218, 219, 220, 220, 222, 223, 224, 225, +226, 227, 227, 229, 229, 230, 231, 232, 234, 234, 235, 236, 237, 238, 239, 240, +241, 242, 243, 244, 245, 246, 247, 248, 248, 0, 0, 0, 0, 0, 0, 0}; + FIXME + +Range Coding of integers: +------------------------- +FIXME + + Neighboring Blocks: =================== left and top are set to the respective blocks unless they are outside of @@ -445,7 +486,7 @@ the remaining points shall be bilinearly interpolated from the up to 4 surrounding halfpel and fullpel points, again rounding should be to nearest and halfway values rounded up -compliant snow decoders MUST support 1-1/8 pel luma and 1/2-1/16 pel chroma +compliant Snow decoders MUST support 1-1/8 pel luma and 1/2-1/16 pel chroma interpolation at least @@ -521,7 +562,7 @@ s[w ] shall be considered equivalent to s[w-2] | + | + | + | + +1/2 -snows 9/7 Integer filter: +Snow's 9/7 Integer filter: 1. s[i] -= (3*(s[i-1] + s[i+1]) + 4)>>3; for all even i < w 2. s[i] -= s[i-1] + s[i+1] ; for all odd i < w 3. s[i] += ( s[i-1] + s[i+1] + 4*s[i] + 8)>>4; for all even i < w