| 1 | use nihav_core::formats; |
| 2 | use nihav_core::frame::*; |
| 3 | use nihav_core::io::bitreader::*; |
| 4 | use nihav_core::io::codebook::*; |
| 5 | use nihav_core::io::intcode::*; |
| 6 | use nihav_core::codecs::*; |
| 7 | use nihav_codec_support::codecs::{MV, ZERO_MV}; |
| 8 | use super::rv3040::*; |
| 9 | use super::rv40dsp::*; |
| 10 | |
| 11 | struct AICCodeReader8 { |
| 12 | lengths: &'static [u8], |
| 13 | codes: &'static [u8], |
| 14 | } |
| 15 | |
| 16 | impl CodebookDescReader<i8> for AICCodeReader8 { |
| 17 | fn bits(&mut self, idx: usize) -> u8 { self.lengths[idx] } |
| 18 | fn code(&mut self, idx: usize) -> u32 { self.codes[idx] as u32 } |
| 19 | fn sym (&mut self, idx: usize) -> i8 { idx as i8 } |
| 20 | fn len (&mut self) -> usize { self.lengths.len() } |
| 21 | } |
| 22 | |
| 23 | struct AICCodeReader16 { |
| 24 | lengths: &'static [u8], |
| 25 | codes: &'static [u16], |
| 26 | } |
| 27 | |
| 28 | impl CodebookDescReader<i8> for AICCodeReader16 { |
| 29 | fn bits(&mut self, idx: usize) -> u8 { self.lengths[idx] } |
| 30 | fn code(&mut self, idx: usize) -> u32 { self.codes[idx] as u32 } |
| 31 | fn sym (&mut self, idx: usize) -> i8 { idx as i8 } |
| 32 | fn len (&mut self) -> usize { self.lengths.len() } |
| 33 | } |
| 34 | |
| 35 | struct TypeCodeReader { |
| 36 | lengths: &'static [u8], |
| 37 | codes: &'static [u8], |
| 38 | syms: &'static [MBType], |
| 39 | } |
| 40 | |
| 41 | impl CodebookDescReader<MBType> for TypeCodeReader { |
| 42 | fn bits(&mut self, idx: usize) -> u8 { self.lengths[idx] } |
| 43 | fn code(&mut self, idx: usize) -> u32 { self.codes[idx] as u32 } |
| 44 | fn sym (&mut self, idx: usize) -> MBType{ self.syms[idx] } |
| 45 | fn len (&mut self) -> usize { self.lengths.len() } |
| 46 | } |
| 47 | |
| 48 | struct RealVideo40BR { |
| 49 | width: usize, |
| 50 | height: usize, |
| 51 | aic_top_cb: Codebook<i8>, |
| 52 | aic_mode1_cb: Vec<Codebook<i8>>, |
| 53 | aic_mode2_cb: Vec<Codebook<i8>>, |
| 54 | ptype_cb: Vec<Codebook<MBType>>, |
| 55 | btype_cb: Vec<Codebook<MBType>>, |
| 56 | had_skip_run: bool, |
| 57 | } |
| 58 | |
| 59 | impl RealVideo40BR { |
| 60 | fn new() -> Self { |
| 61 | let mut coderead = AICCodeReader8{ lengths: &RV40_AIC_TOP_BITS, codes: &RV40_AIC_TOP_CODES }; |
| 62 | let aic_top_cb = Codebook::new(&mut coderead, CodebookMode::MSB).unwrap(); |
| 63 | |
| 64 | let mut aic_mode1_cb: Vec<Codebook<i8>> = Vec::with_capacity(RV40_AIC_MODE1_BITS.len()); |
| 65 | for i in 0..RV40_AIC_MODE1_BITS.len() { |
| 66 | if (i % 10) != 9 { |
| 67 | let mut coderead = AICCodeReader8{ lengths: &RV40_AIC_MODE1_BITS[i], codes: &RV40_AIC_MODE1_CODES[i] }; |
| 68 | let cb = Codebook::new(&mut coderead, CodebookMode::MSB).unwrap(); |
| 69 | aic_mode1_cb.push(cb); |
| 70 | } else { |
| 71 | let mut coderead = AICCodeReader8{ lengths: &RV40_AIC_MODE1_BITS_DUMMY, codes: &RV40_AIC_MODE1_CODES_DUMMY }; |
| 72 | let cb = Codebook::new(&mut coderead, CodebookMode::MSB).unwrap(); |
| 73 | aic_mode1_cb.push(cb); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | let mut aic_mode2_cb: Vec<Codebook<i8>> = Vec::with_capacity(RV40_AIC_MODE2_BITS.len()); |
| 78 | for i in 0..RV40_AIC_MODE2_BITS.len() { |
| 79 | let mut coderead = AICCodeReader16{ lengths: &RV40_AIC_MODE2_BITS[i], codes: &RV40_AIC_MODE2_CODES[i] }; |
| 80 | let cb = Codebook::new(&mut coderead, CodebookMode::MSB).unwrap(); |
| 81 | aic_mode2_cb.push(cb); |
| 82 | } |
| 83 | |
| 84 | let mut ptype_cb: Vec<Codebook<MBType>> = Vec::with_capacity(RV40_PTYPE_BITS.len()); |
| 85 | for i in 0..RV40_PTYPE_BITS.len() { |
| 86 | let mut coderead = TypeCodeReader{ lengths: &RV40_PTYPE_BITS[i], codes: &RV40_PTYPE_CODES[i], syms: RV40_PTYPE_SYMS }; |
| 87 | let cb = Codebook::new(&mut coderead, CodebookMode::MSB).unwrap(); |
| 88 | ptype_cb.push(cb); |
| 89 | } |
| 90 | |
| 91 | let mut btype_cb: Vec<Codebook<MBType>> = Vec::with_capacity(RV40_BTYPE_BITS.len()); |
| 92 | for i in 0..RV40_BTYPE_BITS.len() { |
| 93 | let mut coderead = TypeCodeReader{ lengths: &RV40_BTYPE_BITS[i], codes: &RV40_BTYPE_CODES[i], syms: RV40_BTYPE_SYMS }; |
| 94 | let cb = Codebook::new(&mut coderead, CodebookMode::MSB).unwrap(); |
| 95 | btype_cb.push(cb); |
| 96 | } |
| 97 | |
| 98 | RealVideo40BR { |
| 99 | width: 0, |
| 100 | height: 0, |
| 101 | aic_top_cb, |
| 102 | aic_mode1_cb, |
| 103 | aic_mode2_cb, |
| 104 | ptype_cb, |
| 105 | btype_cb, |
| 106 | had_skip_run: false, |
| 107 | } |
| 108 | } |
| 109 | fn predict_b_mv_component(&self, sstate: &SState, mvi: &MVInfo, mbinfo: &[RV34MBInfo], mbtype: MBType, fwd: bool) -> MV { |
| 110 | let mut pred_mvs: [MV; 3] = [ZERO_MV; 3]; |
| 111 | let mut mv_count: usize = 0; |
| 112 | let mb_x = sstate.mb_x; |
| 113 | let mb_y = sstate.mb_y; |
| 114 | let mb_stride = sstate.mb_w; |
| 115 | let mb_idx = mb_x + mb_y * mb_stride; |
| 116 | |
| 117 | if !mbtype.has_mv_dir(fwd) { |
| 118 | return ZERO_MV; |
| 119 | } |
| 120 | |
| 121 | if sstate.has_left && mbinfo[mb_idx - 1].mbtype.has_mv_dir(fwd) { |
| 122 | pred_mvs[mv_count] = mvi.get_mv(mb_x - 1, mb_y, 0, 0, fwd); |
| 123 | mv_count += 1; |
| 124 | } |
| 125 | if !sstate.has_top { |
| 126 | return pred_mvs[0]; |
| 127 | } |
| 128 | if mbinfo[mb_idx - mb_stride].mbtype.has_mv_dir(fwd) { |
| 129 | pred_mvs[mv_count] = mvi.get_mv(mb_x, mb_y - 1, 0, 0, fwd); |
| 130 | mv_count += 1; |
| 131 | } |
| 132 | if sstate.has_tr { |
| 133 | if mbinfo[mb_idx - mb_stride + 1].mbtype.has_mv_dir(fwd) { |
| 134 | pred_mvs[mv_count] = mvi.get_mv(mb_x + 1, mb_y - 1, 0, 0, fwd); |
| 135 | mv_count += 1; |
| 136 | } |
| 137 | } else { |
| 138 | if sstate.has_tl && mbinfo[mb_idx - mb_stride - 1].mbtype.has_mv_dir(fwd) { |
| 139 | pred_mvs[mv_count] = mvi.get_mv(mb_x - 1, mb_y - 1, 0, 0, fwd); |
| 140 | mv_count += 1; |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | match mv_count { |
| 145 | 3 => MV::pred(pred_mvs[0], pred_mvs[1], pred_mvs[2]), |
| 146 | 2 => { let sum_mv = pred_mvs[0] + pred_mvs[1]; MV { x: sum_mv.x / 2, y: sum_mv.y / 2 } }, |
| 147 | 1 => pred_mvs[0], |
| 148 | _ => ZERO_MV, |
| 149 | } |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | fn get_dimension(br: &mut BitReader, tab: &'static [i16]) -> DecoderResult<usize> { |
| 154 | let t = br.read(3)? as usize; |
| 155 | if tab[t] > 0 { return Ok(tab[t] as usize); } |
| 156 | if tab[t] < 0 { |
| 157 | let idx = (-tab[t] as usize) + (br.read(1)? as usize); |
| 158 | if tab[idx] != 0 { return Ok(tab[idx] as usize); } |
| 159 | } |
| 160 | let mut size: usize = 0; |
| 161 | loop { |
| 162 | let t = br.read(8)? as usize; |
| 163 | size += t << 2; |
| 164 | if t != 255 { break; } |
| 165 | } |
| 166 | Ok(size) |
| 167 | } |
| 168 | |
| 169 | impl RV34BitstreamDecoder for RealVideo40BR { |
| 170 | fn decode_slice_header(&mut self, br: &mut BitReader, old_w: usize, old_h: usize) -> DecoderResult<RV34SliceHeader> { |
| 171 | if br.read(1)? != 0 { return Err(DecoderError::InvalidData); } |
| 172 | let ft_idx = br.read(2)?; |
| 173 | let ftype = match ft_idx { |
| 174 | 0|1 => FrameType::I, |
| 175 | 2 => FrameType::P, |
| 176 | _ => FrameType::B, |
| 177 | }; |
| 178 | let q = br.read(5)? as u8; |
| 179 | if br.read(2)? != 0 { return Err(DecoderError::InvalidData); } |
| 180 | let set_idx = br.read(2)? as usize; |
| 181 | let deblock = !br.read_bool()?; |
| 182 | let pts = br.read(13)? as u16; |
| 183 | let w; |
| 184 | let h; |
| 185 | if (ftype == FrameType::I) || !br.read_bool()? { |
| 186 | w = get_dimension(br, &RV40_STANDARD_WIDTHS)?; |
| 187 | h = get_dimension(br, &RV40_STANDARD_HEIGHTS)?; |
| 188 | } else { |
| 189 | w = old_w; |
| 190 | h = old_h; |
| 191 | } |
| 192 | let start = br.read(get_slice_start_offset_bits(w, h))? as usize; |
| 193 | |
| 194 | self.had_skip_run = false; |
| 195 | |
| 196 | Ok(RV34SliceHeader{ ftype, quant: q, deblock, pts, width: w, height: h, start, end: 0, set_idx }) |
| 197 | } |
| 198 | fn decode_intra_pred(&mut self, br: &mut BitReader, types: &mut [i8], mut pos: usize, tstride: usize, has_top: bool) -> DecoderResult<()> { |
| 199 | let start; |
| 200 | if has_top { |
| 201 | start = 0; |
| 202 | } else { |
| 203 | let code = br.read_cb(&self.aic_top_cb)?; |
| 204 | types[pos + 0] = (code >> 2) & 2; |
| 205 | types[pos + 1] = (code >> 1) & 2; |
| 206 | types[pos + 2] = (code >> 0) & 2; |
| 207 | types[pos + 3] = (code << 1) & 2; |
| 208 | pos += tstride; |
| 209 | start = 1; |
| 210 | } |
| 211 | for _ in start..4 { |
| 212 | let mut x: usize = 0; |
| 213 | while x < 4 { |
| 214 | let tr = types[pos + x - tstride + 1]; |
| 215 | let t = types[pos + x - tstride]; |
| 216 | let l = types[pos + x - 1]; |
| 217 | let ctx = if x < 3 { ((tr & 0xF) as u16) + (((t as u16) & 0xF) << 4) + (((l as u16) & 0xF) << 8) } else { 0xFFF }; |
| 218 | let res = RV40_AIC_PATTERNS.iter().position(|&x| x == ctx); |
| 219 | if let Some(idx) = res { |
| 220 | let code = br.read_cb(&self.aic_mode2_cb[idx])?; |
| 221 | types[pos + x + 0] = code / 9; |
| 222 | types[pos + x + 1] = code % 9; |
| 223 | x += 2; |
| 224 | } else { |
| 225 | if (t != -1) && (l != -1) { |
| 226 | let idx = (t as usize) + (l as usize) * 10; |
| 227 | types[pos + x] = br.read_cb(&self.aic_mode1_cb[idx])?; |
| 228 | } else { |
| 229 | match l { |
| 230 | -1 if t < 2 => { types[pos + x] = (br.read(1)? as i8) ^ 1; }, |
| 231 | 0 | 2 => { types[pos + x] = ((br.read(1)? as i8) ^ 1) << 1; }, |
| 232 | _ => { types[pos + x] = 0; }, |
| 233 | }; |
| 234 | } |
| 235 | x += 1; |
| 236 | } |
| 237 | } |
| 238 | pos += tstride; |
| 239 | } |
| 240 | Ok(()) |
| 241 | } |
| 242 | fn decode_inter_mb_hdr(&mut self, br: &mut BitReader, ftype: FrameType, mbtype_ref: MBType) -> DecoderResult<MBInfo> { |
| 243 | let skip_run = if self.had_skip_run { 0 } else { br.read_code(UintCodeType::Gamma)? as usize }; |
| 244 | if skip_run > 0 { |
| 245 | self.had_skip_run = true; |
| 246 | return Ok(MBInfo { mbtype: MBType::MBSkip, skip_run: skip_run - 1, dquant: false }) |
| 247 | } |
| 248 | self.had_skip_run = false; |
| 249 | let mut mbtype; |
| 250 | let idx; |
| 251 | if ftype == FrameType::P { |
| 252 | idx = match mbtype_ref { |
| 253 | MBType::MBIntra => 0, |
| 254 | MBType::MBIntra16 => 1, |
| 255 | MBType::MBP16x16 => 2, |
| 256 | MBType::MBP8x8 => 3, |
| 257 | MBType::MBP16x8 => 4, |
| 258 | MBType::MBP8x16 => 5, |
| 259 | MBType::MBP16x16Mix => 6, |
| 260 | _ => unreachable!(), |
| 261 | }; |
| 262 | mbtype = br.read_cb(&self.ptype_cb[idx])?; |
| 263 | } else { |
| 264 | idx = match mbtype_ref { |
| 265 | MBType::MBIntra => 0, |
| 266 | MBType::MBIntra16 => 1, |
| 267 | MBType::MBForward => 2, |
| 268 | MBType::MBBackward => 3, |
| 269 | MBType::MBBidir => 4, |
| 270 | MBType::MBDirect => 5, |
| 271 | _ => 0, |
| 272 | }; |
| 273 | mbtype = br.read_cb(&self.btype_cb[idx])?; |
| 274 | } |
| 275 | let dquant = mbtype == MBType::Invalid; |
| 276 | if dquant { |
| 277 | mbtype = if ftype == FrameType::P { br.read_cb(&self.ptype_cb[idx])? } |
| 278 | else { br.read_cb(&self.btype_cb[idx])? }; |
| 279 | } |
| 280 | Ok(MBInfo { mbtype, skip_run: 0, dquant }) |
| 281 | } |
| 282 | fn predict_b_mv(&self, sstate: &SState, mvi: &MVInfo, mbtype: MBType, mvs: &[MV], mbinfo: &[RV34MBInfo]) -> (MV, MV) { |
| 283 | let mut mv_f = self.predict_b_mv_component(sstate, mvi, mbinfo, mbtype, true); |
| 284 | let mut mv_b = self.predict_b_mv_component(sstate, mvi, mbinfo, mbtype, false); |
| 285 | |
| 286 | match mbtype { |
| 287 | MBType::MBForward => { mv_f += mvs[0]; }, |
| 288 | MBType::MBBackward => { mv_b += mvs[0]; }, |
| 289 | MBType::MBBidir => { |
| 290 | mv_f += mvs[0]; |
| 291 | mv_b += mvs[1]; |
| 292 | }, |
| 293 | _ => {}, |
| 294 | }; |
| 295 | |
| 296 | (mv_f, mv_b) |
| 297 | } |
| 298 | fn quant_dc(&self, is_intra: bool, q: u8) -> u8 { RV40_QUANT_DC[if is_intra { 0 } else { 1 }][q as usize] } |
| 299 | } |
| 300 | |
| 301 | struct RealVideo40Decoder { |
| 302 | bd: RealVideo40BR, |
| 303 | info: NACodecInfoRef, |
| 304 | dec: RV34Decoder, |
| 305 | } |
| 306 | |
| 307 | impl RealVideo40Decoder { |
| 308 | fn new() -> Self { |
| 309 | RealVideo40Decoder{ |
| 310 | bd: RealVideo40BR::new(), |
| 311 | info: NACodecInfoRef::default(), |
| 312 | dec: RV34Decoder::new(false, Box::new(RV40DSP::new())), |
| 313 | } |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | impl NADecoder for RealVideo40Decoder { |
| 318 | fn init(&mut self, supp: &mut NADecoderSupport, info: NACodecInfoRef) -> DecoderResult<()> { |
| 319 | if let NACodecTypeInfo::Video(vinfo) = info.get_properties() { |
| 320 | let fmt = formats::YUV420_FORMAT; |
| 321 | let myinfo = NACodecTypeInfo::Video(NAVideoInfo::new(0, 0, false, fmt)); |
| 322 | self.info = NACodecInfo::new_ref(info.get_name(), myinfo, info.get_extradata()).into_ref(); |
| 323 | |
| 324 | let edata = info.get_extradata().unwrap(); |
| 325 | let src: &[u8] = &edata; |
| 326 | |
| 327 | { |
| 328 | println!("edata:"); |
| 329 | for i in 0..src.len() { print!(" {:02X}", src[i]); } println!(); |
| 330 | } |
| 331 | if src.len() < 2 { return Err(DecoderError::InvalidData); } |
| 332 | |
| 333 | self.bd.width = vinfo.get_width(); |
| 334 | self.bd.height = vinfo.get_height(); |
| 335 | |
| 336 | supp.pool_u8.set_dec_bufs(3); |
| 337 | supp.pool_u8.prealloc_video(NAVideoInfo::new(self.bd.width, self.bd.height, false, fmt), 4)?; |
| 338 | |
| 339 | Ok(()) |
| 340 | } else { |
| 341 | println!("???"); |
| 342 | Err(DecoderError::InvalidData) |
| 343 | } |
| 344 | } |
| 345 | fn decode(&mut self, supp: &mut NADecoderSupport, pkt: &NAPacket) -> DecoderResult<NAFrameRef> { |
| 346 | let src = pkt.get_buffer(); |
| 347 | |
| 348 | let (bufinfo, ftype, ts) = self.dec.parse_frame(supp, src.as_slice(), &mut self.bd)?; |
| 349 | |
| 350 | let mut frm = NAFrame::new_from_pkt(pkt, self.info.clone(), bufinfo); |
| 351 | frm.set_keyframe(ftype == FrameType::I); |
| 352 | frm.set_frame_type(ftype); |
| 353 | frm.set_pts(Some(ts)); |
| 354 | Ok(frm.into_ref()) |
| 355 | } |
| 356 | fn flush(&mut self) { |
| 357 | self.dec.flush(); |
| 358 | } |
| 359 | } |
| 360 | |
| 361 | impl NAOptionHandler for RealVideo40Decoder { |
| 362 | fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] } |
| 363 | fn set_options(&mut self, _options: &[NAOption]) { } |
| 364 | fn query_option_value(&self, _name: &str) -> Option<NAValue> { None } |
| 365 | } |
| 366 | |
| 367 | pub fn get_decoder() -> Box<dyn NADecoder + Send> { |
| 368 | Box::new(RealVideo40Decoder::new()) |
| 369 | } |
| 370 | |
| 371 | #[cfg(test)] |
| 372 | mod test { |
| 373 | use nihav_core::codecs::RegisteredDecoders; |
| 374 | use nihav_core::demuxers::RegisteredDemuxers; |
| 375 | use nihav_codec_support::test::dec_video::*; |
| 376 | use crate::realmedia_register_all_decoders; |
| 377 | use crate::realmedia_register_all_demuxers; |
| 378 | // samples from a private collection |
| 379 | #[test] |
| 380 | fn test_rv40() { |
| 381 | let mut dmx_reg = RegisteredDemuxers::new(); |
| 382 | realmedia_register_all_demuxers(&mut dmx_reg); |
| 383 | let mut dec_reg = RegisteredDecoders::new(); |
| 384 | realmedia_register_all_decoders(&mut dec_reg); |
| 385 | |
| 386 | test_decoding("realmedia", "realvideo4", "assets/RV/rv40_weighted_mc.rmvb", Some(1500), |
| 387 | &dmx_reg, &dec_reg,ExpectedTestResult::MD5Frames(vec![ |
| 388 | [0x27cf336a, 0xc1686c50, 0x5304783d, 0x6e77ffa2], |
| 389 | [0x91f236c7, 0x3bda2d38, 0x961a0243, 0xda803cf1], |
| 390 | [0x4075d7e8, 0xbcd7f85b, 0x1c0dd34b, 0x405d0a5d], |
| 391 | [0x642498b7, 0xb57aa202, 0x69ea0d23, 0x1cc0794f], |
| 392 | [0x1c1a4df8, 0x7e3fbd7d, 0x7fdeb57f, 0xf5d65179], |
| 393 | [0x86a5dcdd, 0xd66caabf, 0xdfe1fc99, 0xb3443375], |
| 394 | [0x86846664, 0xbee4268d, 0xc1e017e6, 0xc9d984c8], |
| 395 | [0x0ecbe176, 0x81e5aca6, 0xb7bda49c, 0x34007e7b], |
| 396 | [0x48c8a90e, 0xed003b8a, 0xc9e7e9a6, 0x54b1eca8], |
| 397 | [0x540cbc0b, 0x6d7afaa8, 0xb0951c1f, 0xed22089e], |
| 398 | [0x73190f85, 0x9cd72603, 0x1063ca54, 0xd4f82c7f], |
| 399 | [0xef6206e8, 0x6affb292, 0xe12b7c9c, 0x37416240], |
| 400 | [0x59f61c91, 0x66b2a632, 0x46556395, 0x74fbc1de], |
| 401 | [0xd75635ca, 0x60d13826, 0xfa41d914, 0x9cfded0e], |
| 402 | [0x7a8c4396, 0x6f3eda39, 0x4238dbaf, 0xa9052803]])); |
| 403 | test_decoding("realmedia", "realvideo4", "assets/RV/rv40_weighted_mc_2.rmvb", Some(2000), |
| 404 | &dmx_reg, &dec_reg, |
| 405 | ExpectedTestResult::MD5([0x4224b9d6, 0x32e3ff63, 0x02df9e60, 0xfa0548ee])); |
| 406 | } |
| 407 | } |
| 408 | |
| 409 | const RV40_STANDARD_WIDTHS: [i16; 8] = [ 160, 172, 240, 320, 352, 640, 704, 0 ]; |
| 410 | const RV40_STANDARD_HEIGHTS: [i16; 12] = [ 120, 132, 144, 240, 288, 480, -8, -10, 180, 360, 576, 0 ]; |
| 411 | |
| 412 | const RV40_QUANT_DC: [[u8; 32]; 2] = [ |
| 413 | [ |
| 414 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, |
| 415 | 16, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 22, 22, 22, 22 |
| 416 | ], [ |
| 417 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, |
| 418 | 16, 17, 18, 19, 20, 20, 21, 21, 22, 23, 23, 23, 24, 24, 24, 24 |
| 419 | ] |
| 420 | ]; |
| 421 | |
| 422 | const RV40_AIC_PATTERNS: [u16; 20] = [ |
| 423 | 0x000, 0x100, 0x200, |
| 424 | 0x011, 0x111, 0x211, 0x511, 0x611, |
| 425 | 0x022, 0x122, 0x222, 0x722, |
| 426 | 0x272, 0x227, |
| 427 | 0x822, 0x282, 0x228, |
| 428 | 0x112, 0x116, 0x221 |
| 429 | ]; |
| 430 | |
| 431 | const RV40_AIC_TOP_CODES: [u8; 16] = [ |
| 432 | 0x01, 0x05, 0x01, 0x00, 0x03, 0x3D, 0x1D, 0x02, |
| 433 | 0x04, 0x3C, 0x3F, 0x1C, 0x0D, 0x3E, 0x0C, 0x01 |
| 434 | ]; |
| 435 | const RV40_AIC_TOP_BITS: [u8; 16] = [ |
| 436 | 1, 4, 5, 5, 5, 7, 6, 5, 4, 7, 7, 6, 5, 7, 5, 3 |
| 437 | ]; |
| 438 | |
| 439 | const RV40_AIC_MODE1_CODES_DUMMY: [u8; 1] = [ 0 ]; |
| 440 | const RV40_AIC_MODE1_BITS_DUMMY: [u8; 1] = [ 1 ]; |
| 441 | |
| 442 | const RV40_AIC_MODE1_CODES: [[u8; 9]; 90] = [ |
| 443 | [ 0x01, 0x01, 0x01, 0x11, 0x00, 0x09, 0x03, 0x10, 0x05 ], |
| 444 | [ 0x09, 0x01, 0x01, 0x05, 0x11, 0x00, 0x03, 0x21, 0x20 ], |
| 445 | [ 0x01, 0x01, 0x01, 0x11, 0x09, 0x10, 0x05, 0x00, 0x03 ], |
| 446 | [ 0x01, 0x01, 0x00, 0x03, 0x21, 0x05, 0x09, 0x20, 0x11 ], |
| 447 | [ 0x01, 0x09, 0x00, 0x29, 0x08, 0x15, 0x03, 0x0B, 0x28 ], |
| 448 | [ 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x03, 0x02 ], |
| 449 | [ 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x01, 0x09, 0x08 ], |
| 450 | [ 0x01, 0x01, 0x01, 0x09, 0x01, 0x08, 0x00, 0x03, 0x05 ], |
| 451 | [ 0x01, 0x01, 0x01, 0x00, 0x05, 0x11, 0x09, 0x10, 0x03 ], |
| 452 | [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ], |
| 453 | |
| 454 | [ 0x01, 0x01, 0x01, 0x05, 0x01, 0x00, 0x03, 0x09, 0x08 ], |
| 455 | [ 0x09, 0x01, 0x01, 0x05, 0x11, 0x00, 0x03, 0x21, 0x20 ], |
| 456 | [ 0x01, 0x01, 0x01, 0x0D, 0x05, 0x04, 0x00, 0x07, 0x0C ], |
| 457 | [ 0x01, 0x01, 0x00, 0x05, 0x11, 0x03, 0x09, 0x21, 0x20 ], |
| 458 | [ 0x05, 0x01, 0x01, 0x11, 0x00, 0x09, 0x03, 0x21, 0x20 ], |
| 459 | [ 0x09, 0x01, 0x01, 0x00, 0x05, 0x01, 0x03, 0x11, 0x10 ], |
| 460 | [ 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x03, 0x02 ], |
| 461 | [ 0x01, 0x01, 0x01, 0x09, 0x00, 0x05, 0x01, 0x03, 0x08 ], |
| 462 | [ 0x01, 0x01, 0x01, 0x09, 0x11, 0x05, 0x00, 0x10, 0x03 ], |
| 463 | [ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ], |
| 464 | |
| 465 | [ 0x01, 0x00, 0x01, 0x09, 0x08, 0x15, 0x14, 0x0B, 0x03 ], |
| 466 | [ 0x0D, 0x01, 0x01, 0x05, 0x0C, 0x04, 0x01, 0x00, 0x07 ], |
| 467 | [ 0x01, 0x01, 0x01, 0x05, 0x00, 0x04, 0x03, 0x01, 0x01 ], |
| 468 | [ 0x05, 0x01, 0x01, 0x04, 0x19, 0x07, 0x18, 0x0D, 0x00 ], |
| 469 | [ 0x11, 0x09, 0x01, 0x21, 0x05, 0x20, 0x01, 0x00, 0x03 ], |
| 470 | [ 0x41, 0x01, 0x00, 0x05, 0x40, 0x03, 0x09, 0x21, 0x11 ], |
| 471 | [ 0x29, 0x01, 0x00, 0x28, 0x09, 0x15, 0x03, 0x08, 0x0B ], |
| 472 | [ 0x01, 0x00, 0x01, 0x11, 0x09, 0x10, 0x05, 0x01, 0x03 ], |
| 473 | [ 0x05, 0x01, 0x01, 0x04, 0x0D, 0x0C, 0x07, 0x00, 0x01 ], |
| 474 | [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ], |
| 475 | |
| 476 | [ 0x01, 0x00, 0x03, 0x05, 0x11, 0x10, 0x25, 0x24, 0x13 ], |
| 477 | [ 0x21, 0x01, 0x01, 0x00, 0x11, 0x03, 0x05, 0x20, 0x09 ], |
| 478 | [ 0x01, 0x01, 0x01, 0x00, 0x09, 0x11, 0x10, 0x05, 0x03 ], |
| 479 | [ 0x21, 0x05, 0x01, 0x01, 0x09, 0x00, 0x11, 0x20, 0x03 ], |
| 480 | [ 0x05, 0x01, 0x00, 0x04, 0x01, 0x19, 0x07, 0x18, 0x0D ], |
| 481 | [ 0x11, 0x01, 0x00, 0x01, 0x09, 0x01, 0x03, 0x10, 0x05 ], |
| 482 | [ 0x1D, 0x01, 0x05, 0x0D, 0x0C, 0x04, 0x00, 0x1C, 0x0F ], |
| 483 | [ 0x05, 0x19, 0x01, 0x04, 0x00, 0x18, 0x1B, 0x1A, 0x07 ], |
| 484 | [ 0x09, 0x01, 0x00, 0x01, 0x05, 0x03, 0x11, 0x10, 0x01 ], |
| 485 | [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ], |
| 486 | |
| 487 | [ 0x01, 0x00, 0x03, 0x41, 0x05, 0x40, 0x09, 0x11, 0x21 ], |
| 488 | [ 0x05, 0x01, 0x01, 0x19, 0x04, 0x07, 0x00, 0x18, 0x0D ], |
| 489 | [ 0x01, 0x01, 0x01, 0x05, 0x01, 0x04, 0x01, 0x00, 0x03 ], |
| 490 | [ 0x01, 0x05, 0x00, 0x0D, 0x01, 0x04, 0x07, 0x19, 0x18 ], |
| 491 | [ 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x02 ], |
| 492 | [ 0x31, 0x01, 0x05, 0x19, 0x04, 0x07, 0x00, 0x30, 0x0D ], |
| 493 | [ 0x01, 0x00, 0x03, 0x11, 0x01, 0x05, 0x01, 0x09, 0x10 ], |
| 494 | [ 0x01, 0x05, 0x01, 0x11, 0x01, 0x10, 0x00, 0x03, 0x09 ], |
| 495 | [ 0x01, 0x09, 0x00, 0x29, 0x03, 0x08, 0x28, 0x15, 0x0B ], |
| 496 | [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ], |
| 497 | |
| 498 | [ 0x01, 0x01, 0x00, 0x09, 0x15, 0x03, 0x08, 0x14, 0x0B ], |
| 499 | [ 0x11, 0x01, 0x01, 0x00, 0x09, 0x01, 0x03, 0x10, 0x05 ], |
| 500 | [ 0x01, 0x00, 0x03, 0x25, 0x11, 0x05, 0x10, 0x24, 0x13 ], |
| 501 | [ 0x11, 0x01, 0x00, 0x01, 0x09, 0x01, 0x05, 0x10, 0x03 ], |
| 502 | [ 0x05, 0x01, 0x00, 0x0D, 0x0C, 0x04, 0x0F, 0x1D, 0x1C ], |
| 503 | [ 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x03, 0x02 ], |
| 504 | [ 0x21, 0x01, 0x05, 0x09, 0x11, 0x00, 0x03, 0x41, 0x40 ], |
| 505 | [ 0x05, 0x01, 0x00, 0x1D, 0x1C, 0x0D, 0x0C, 0x0F, 0x04 ], |
| 506 | [ 0x05, 0x01, 0x00, 0x0D, 0x31, 0x04, 0x19, 0x30, 0x07 ], |
| 507 | [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ], |
| 508 | |
| 509 | [ 0x01, 0x01, 0x00, 0x21, 0x05, 0x11, 0x03, 0x09, 0x20 ], |
| 510 | [ 0x01, 0x01, 0x00, 0x11, 0x03, 0x05, 0x01, 0x09, 0x10 ], |
| 511 | [ 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x02 ], |
| 512 | [ 0x05, 0x01, 0x04, 0x19, 0x07, 0x0D, 0x00, 0x31, 0x30 ], |
| 513 | [ 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x02 ], |
| 514 | [ 0x05, 0x01, 0x01, 0x11, 0x09, 0x00, 0x03, 0x21, 0x20 ], |
| 515 | [ 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x02 ], |
| 516 | [ 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x01, 0x01, 0x02 ], |
| 517 | [ 0x09, 0x01, 0x00, 0x29, 0x08, 0x15, 0x03, 0x28, 0x0B ], |
| 518 | [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ], |
| 519 | |
| 520 | [ 0x01, 0x01, 0x01, 0x05, 0x01, 0x04, 0x00, 0x01, 0x03 ], |
| 521 | [ 0x09, 0x01, 0x00, 0x29, 0x28, 0x15, 0x08, 0x03, 0x0B ], |
| 522 | [ 0x01, 0x00, 0x01, 0x11, 0x05, 0x10, 0x09, 0x01, 0x03 ], |
| 523 | [ 0x05, 0x04, 0x01, 0x1D, 0x0D, 0x0C, 0x1C, 0x00, 0x0F ], |
| 524 | [ 0x09, 0x11, 0x01, 0x41, 0x00, 0x40, 0x05, 0x03, 0x21 ], |
| 525 | [ 0x0D, 0x05, 0x01, 0x1D, 0x1C, 0x0C, 0x04, 0x00, 0x0F ], |
| 526 | [ 0x41, 0x09, 0x01, 0x40, 0x00, 0x11, 0x05, 0x03, 0x21 ], |
| 527 | [ 0x01, 0x01, 0x01, 0x05, 0x01, 0x04, 0x00, 0x01, 0x03 ], |
| 528 | [ 0x05, 0x04, 0x01, 0x0D, 0x01, 0x0C, 0x07, 0x01, 0x00 ], |
| 529 | [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ], |
| 530 | |
| 531 | [ 0x05, 0x04, 0x01, 0x07, 0x19, 0x31, 0x30, 0x0D, 0x00 ], |
| 532 | [ 0x21, 0x01, 0x01, 0x00, 0x11, 0x09, 0x20, 0x05, 0x03 ], |
| 533 | [ 0x05, 0x01, 0x01, 0x04, 0x07, 0x0D, 0x0C, 0x00, 0x01 ], |
| 534 | [ 0x21, 0x09, 0x01, 0x00, 0x20, 0x05, 0x23, 0x22, 0x03 ], |
| 535 | [ 0x31, 0x0D, 0x01, 0x19, 0x05, 0x30, 0x04, 0x07, 0x00 ], |
| 536 | [ 0x31, 0x05, 0x01, 0x04, 0x19, 0x00, 0x0D, 0x30, 0x07 ], |
| 537 | [ 0x31, 0x01, 0x00, 0x0D, 0x05, 0x19, 0x04, 0x30, 0x07 ], |
| 538 | [ 0x01, 0x01, 0x01, 0x00, 0x01, 0x03, 0x02, 0x01, 0x01 ], |
| 539 | [ 0x01, 0x00, 0x01, 0x01, 0x05, 0x09, 0x08, 0x03, 0x01 ], |
| 540 | [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ], |
| 541 | ]; |
| 542 | static RV40_AIC_MODE1_BITS: [[u8; 9]; 90] = [ |
| 543 | [ 1, 4, 2, 7, 4, 6, 4, 7, 5 ], |
| 544 | [ 5, 1, 3, 4, 6, 3, 3, 7, 7 ], |
| 545 | [ 1, 4, 2, 7, 6, 7, 5, 4, 4 ], |
| 546 | [ 1, 3, 3, 3, 7, 4, 5, 7, 6 ], |
| 547 | [ 2, 4, 2, 6, 4, 5, 2, 4, 6 ], |
| 548 | [ 7, 2, 3, 4, 7, 1, 5, 7, 7 ], |
| 549 | [ 5, 1, 3, 6, 5, 5, 2, 7, 7 ], |
| 550 | [ 2, 5, 1, 7, 3, 7, 5, 5, 6 ], |
| 551 | [ 2, 4, 1, 4, 5, 7, 6, 7, 4 ], |
| 552 | [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], |
| 553 | |
| 554 | [ 2, 1, 3, 6, 5, 5, 5, 7, 7 ], |
| 555 | [ 5, 1, 3, 4, 6, 3, 3, 7, 7 ], |
| 556 | [ 4, 1, 2, 6, 5, 5, 4, 5, 6 ], |
| 557 | [ 3, 1, 3, 4, 6, 3, 5, 7, 7 ], |
| 558 | [ 4, 1, 3, 6, 3, 5, 3, 7, 7 ], |
| 559 | [ 6, 1, 4, 4, 5, 2, 4, 7, 7 ], |
| 560 | [ 7, 1, 5, 7, 4, 3, 2, 7, 7 ], |
| 561 | [ 5, 3, 2, 7, 5, 6, 1, 5, 7 ], |
| 562 | [ 4, 1, 2, 6, 7, 5, 4, 7, 4 ], |
| 563 | [ 1, 0, 1, 0, 0, 0, 0, 0, 0 ], |
| 564 | |
| 565 | [ 3, 3, 1, 5, 5, 6, 6, 5, 3 ], |
| 566 | [ 6, 2, 1, 5, 6, 5, 4, 4, 5 ], |
| 567 | [ 6, 4, 1, 7, 6, 7, 6, 3, 2 ], |
| 568 | [ 4, 3, 1, 4, 6, 4, 6, 5, 3 ], |
| 569 | [ 6, 5, 1, 7, 4, 7, 3, 3, 3 ], |
| 570 | [ 7, 2, 2, 3, 7, 2, 4, 6, 5 ], |
| 571 | [ 6, 2, 2, 6, 4, 5, 2, 4, 4 ], |
| 572 | [ 4, 4, 1, 7, 6, 7, 5, 2, 4 ], |
| 573 | [ 5, 4, 1, 5, 6, 6, 5, 4, 2 ], |
| 574 | [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], |
| 575 | |
| 576 | [ 2, 2, 2, 3, 5, 5, 6, 6, 5 ], |
| 577 | [ 7, 1, 3, 3, 6, 3, 4, 7, 5 ], |
| 578 | [ 2, 4, 1, 4, 6, 7, 7, 5, 4 ], |
| 579 | [ 7, 4, 3, 1, 5, 3, 6, 7, 3 ], |
| 580 | [ 4, 3, 3, 4, 1, 6, 4, 6, 5 ], |
| 581 | [ 7, 4, 4, 2, 6, 1, 4, 7, 5 ], |
| 582 | [ 5, 2, 3, 4, 4, 3, 2, 5, 4 ], |
| 583 | [ 3, 5, 2, 3, 2, 5, 5, 5, 3 ], |
| 584 | [ 6, 4, 4, 2, 5, 4, 7, 7, 1 ], |
| 585 | [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], |
| 586 | |
| 587 | [ 2, 2, 2, 7, 3, 7, 4, 5, 6 ], |
| 588 | [ 4, 1, 3, 6, 4, 4, 3, 6, 5 ], |
| 589 | [ 2, 4, 1, 7, 3, 7, 6, 6, 6 ], |
| 590 | [ 3, 4, 3, 5, 1, 4, 4, 6, 6 ], |
| 591 | [ 4, 5, 2, 7, 1, 7, 3, 7, 7 ], |
| 592 | [ 6, 2, 3, 5, 3, 3, 2, 6, 4 ], |
| 593 | [ 4, 4, 4, 7, 2, 5, 1, 6, 7 ], |
| 594 | [ 4, 5, 2, 7, 1, 7, 4, 4, 6 ], |
| 595 | [ 2, 4, 2, 6, 2, 4, 6, 5, 4 ], |
| 596 | [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], |
| 597 | |
| 598 | [ 1, 3, 3, 5, 6, 3, 5, 6, 5 ], |
| 599 | [ 7, 1, 4, 4, 6, 2, 4, 7, 5 ], |
| 600 | [ 2, 2, 2, 6, 5, 3, 5, 6, 5 ], |
| 601 | [ 7, 4, 4, 2, 6, 1, 5, 7, 4 ], |
| 602 | [ 3, 2, 2, 4, 4, 3, 4, 5, 5 ], |
| 603 | [ 7, 2, 5, 3, 7, 1, 4, 7, 7 ], |
| 604 | [ 6, 2, 3, 4, 5, 2, 2, 7, 7 ], |
| 605 | [ 3, 2, 2, 5, 5, 4, 4, 4, 3 ], |
| 606 | [ 3, 2, 2, 4, 6, 3, 5, 6, 3 ], |
| 607 | [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], |
| 608 | |
| 609 | [ 1, 3, 3, 7, 4, 6, 3, 5, 7 ], |
| 610 | [ 4, 1, 4, 7, 4, 5, 2, 6, 7 ], |
| 611 | [ 2, 4, 1, 7, 5, 7, 3, 7, 7 ], |
| 612 | [ 3, 2, 3, 5, 3, 4, 2, 6, 6 ], |
| 613 | [ 3, 5, 4, 7, 2, 7, 1, 7, 7 ], |
| 614 | [ 4, 1, 3, 6, 5, 3, 3, 7, 7 ], |
| 615 | [ 4, 2, 5, 7, 3, 7, 1, 7, 7 ], |
| 616 | [ 7, 4, 1, 7, 3, 7, 2, 5, 7 ], |
| 617 | [ 4, 2, 2, 6, 4, 5, 2, 6, 4 ], |
| 618 | [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], |
| 619 | |
| 620 | [ 3, 4, 1, 7, 6, 7, 6, 2, 6 ], |
| 621 | [ 4, 2, 2, 6, 6, 5, 4, 2, 4 ], |
| 622 | [ 4, 4, 1, 7, 5, 7, 6, 2, 4 ], |
| 623 | [ 3, 3, 2, 5, 4, 4, 5, 2, 4 ], |
| 624 | [ 4, 5, 2, 7, 2, 7, 3, 2, 6 ], |
| 625 | [ 4, 3, 2, 5, 5, 4, 3, 2, 4 ], |
| 626 | [ 7, 4, 2, 7, 2, 5, 3, 2, 6 ], |
| 627 | [ 4, 6, 2, 7, 3, 7, 6, 1, 6 ], |
| 628 | [ 5, 5, 1, 6, 4, 6, 5, 2, 4 ], |
| 629 | [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], |
| 630 | |
| 631 | [ 3, 3, 2, 3, 5, 6, 6, 4, 2 ], |
| 632 | [ 7, 1, 3, 3, 6, 5, 7, 4, 3 ], |
| 633 | [ 5, 4, 1, 5, 5, 6, 6, 4, 2 ], |
| 634 | [ 6, 4, 2, 2, 6, 3, 6, 6, 2 ], |
| 635 | [ 6, 4, 2, 5, 3, 6, 3, 3, 2 ], |
| 636 | [ 6, 3, 2, 3, 5, 2, 4, 6, 3 ], |
| 637 | [ 6, 2, 2, 4, 3, 5, 3, 6, 3 ], |
| 638 | [ 7, 5, 1, 7, 4, 7, 7, 3, 2 ], |
| 639 | [ 5, 5, 2, 3, 6, 7, 7, 5, 1 ], |
| 640 | [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], |
| 641 | ]; |
| 642 | |
| 643 | const RV40_AIC_MODE2_CODES: [[u16; 81]; 20] = [ |
| 644 | [ |
| 645 | 0x0001, 0x0001, 0x0005, 0x01F5, 0x0011, 0x0049, 0x0000, 0x0048, 0x004B, |
| 646 | 0x0035, 0x0003, 0x0034, 0x03C9, 0x01F4, 0x00C9, 0x004A, 0x0FD9, 0x03C8, |
| 647 | 0x0010, 0x0037, 0x0001, 0x00C8, 0x0075, 0x01F7, 0x00CB, 0x0074, 0x0002, |
| 648 | 0x01F6, 0x00CA, 0x01F1, 0x01F0, 0x1F81, 0x07F9, 0x1F80, 0x1F83, 0x07F8, |
| 649 | 0x0077, 0x00F5, 0x0036, 0x07FB, 0x0076, 0x1F82, 0x00F4, 0x00F7, 0x07FA, |
| 650 | 0x0071, 0x00F6, 0x03CB, 0x03CA, 0x0FD8, 0x00F1, 0x03F5, 0x1F8D, 0x07E5, |
| 651 | 0x0013, 0x0031, 0x00F0, 0x0FDB, 0x00F3, 0x07E4, 0x0030, 0x01F3, 0x07E7, |
| 652 | 0x03F4, 0x07E6, 0x0070, 0x3F19, 0x01F2, 0x3F18, 0x0FDA, 0x0033, 0x07E1, |
| 653 | 0x01FD, 0x01FC, 0x0073, 0x01FF, 0x0FC5, 0x0FC4, 0x0FC7, 0x03F7, 0x0072, |
| 654 | ], [ |
| 655 | 0x0005, 0x0005, 0x0005, 0x0079, 0x0005, 0x000D, 0x001D, 0x0078, 0x0069, |
| 656 | 0x0004, 0x0001, 0x0007, 0x0068, 0x001C, 0x001F, 0x0004, 0x006B, 0x000C, |
| 657 | 0x0004, 0x001E, 0x0006, 0x006A, 0x0015, 0x000F, 0x0014, 0x0017, 0x0007, |
| 658 | 0x0016, 0x000E, 0x0011, 0x0009, 0x00D1, 0x00D0, 0x0181, 0x00D3, 0x007B, |
| 659 | 0x0010, 0x0013, 0x0004, 0x00D2, 0x0007, 0x0319, 0x0008, 0x007A, 0x00DD, |
| 660 | 0x0019, 0x0006, 0x000B, 0x0065, 0x00DC, 0x0012, 0x0064, 0x0180, 0x00DF, |
| 661 | 0x0006, 0x0018, 0x0001, 0x00DE, 0x001D, 0x00D9, 0x001B, 0x0067, 0x000A, |
| 662 | 0x00D8, 0x00DB, 0x001C, 0x0318, 0x00DA, 0x0635, 0x0183, 0x0000, 0x00C5, |
| 663 | 0x0066, 0x0061, 0x0035, 0x00C4, 0x0182, 0x0634, 0x031B, 0x00C7, 0x001F, |
| 664 | ], [ |
| 665 | 0x0005, 0x0001, 0x001D, 0x01C1, 0x0035, 0x00F1, 0x006D, 0x00F0, 0x0049, |
| 666 | 0x0000, 0x0004, 0x0003, 0x00F3, 0x0048, 0x0034, 0x006C, 0x01C0, 0x01C3, |
| 667 | 0x0007, 0x0006, 0x0001, 0x006F, 0x0002, 0x004B, 0x006E, 0x001C, 0x0005, |
| 668 | 0x0069, 0x0068, 0x006B, 0x0037, 0x01C2, 0x00F2, 0x0395, 0x01CD, 0x00FD, |
| 669 | 0x006A, 0x0036, 0x0015, 0x01CC, 0x0014, 0x0394, 0x004A, 0x00FC, 0x00FF, |
| 670 | 0x0017, 0x0031, 0x00FE, 0x01CF, 0x0397, 0x00F9, 0x01CE, 0x0725, 0x0396, |
| 671 | 0x0016, 0x0030, 0x0075, 0x0724, 0x00F8, 0x0727, 0x0033, 0x0391, 0x0390, |
| 672 | 0x0011, 0x0032, 0x001F, 0x00FB, 0x0074, 0x0726, 0x00FA, 0x001E, 0x0077, |
| 673 | 0x0019, 0x0018, 0x0004, 0x0010, 0x003D, 0x0076, 0x0071, 0x0013, 0x0001, |
| 674 | ], [ |
| 675 | 0x000D, 0x0019, 0x0011, 0x0015, 0x0061, 0x0019, 0x0014, 0x01AD, 0x0060, |
| 676 | 0x0018, 0x0001, 0x0005, 0x001B, 0x0010, 0x0019, 0x0005, 0x0017, 0x0018, |
| 677 | 0x0016, 0x0004, 0x0004, 0x0013, 0x000C, 0x0012, 0x001A, 0x0018, 0x0005, |
| 678 | 0x000F, 0x001B, 0x0004, 0x001D, 0x0011, 0x001C, 0x0010, 0x000E, 0x001B, |
| 679 | 0x0013, 0x001F, 0x001A, 0x0029, 0x0005, 0x0063, 0x001E, 0x0009, 0x0062, |
| 680 | 0x0008, 0x0007, 0x0007, 0x0019, 0x0004, 0x001A, 0x0018, 0x006D, 0x0007, |
| 681 | 0x001B, 0x0007, 0x001A, 0x006C, 0x0006, 0x0012, 0x0005, 0x006F, 0x000B, |
| 682 | 0x006E, 0x0069, 0x001D, 0x0359, 0x0028, 0x002B, 0x002A, 0x001C, 0x00D5, |
| 683 | 0x0358, 0x001F, 0x0001, 0x001E, 0x0068, 0x00D4, 0x00D7, 0x0019, 0x0000, |
| 684 | ], [ |
| 685 | 0x00B9, 0x0061, 0x0060, 0x00B8, 0x02B5, 0x01AD, 0x00BB, 0x0AF5, 0x0151, |
| 686 | 0x0001, 0x0001, 0x0005, 0x0000, 0x0003, 0x0005, 0x0004, 0x0063, 0x0025, |
| 687 | 0x00BA, 0x0004, 0x0007, 0x0062, 0x00A5, 0x0024, 0x006D, 0x0002, 0x006C, |
| 688 | 0x02B4, 0x000D, 0x006F, 0x0027, 0x00A4, 0x0026, 0x01AC, 0x0150, 0x01AF, |
| 689 | 0x01AE, 0x0021, 0x006E, 0x02B7, 0x0020, 0x0153, 0x0023, 0x00A7, 0x0152, |
| 690 | 0x00A6, 0x0006, 0x000C, 0x0022, 0x01A9, 0x0019, 0x002D, 0x02B6, 0x01A8, |
| 691 | 0x000F, 0x0007, 0x000E, 0x00A1, 0x0069, 0x002C, 0x0001, 0x01AB, 0x00A0, |
| 692 | 0x02B1, 0x00A3, 0x002F, 0x0AF4, 0x02B0, 0x0AF7, 0x02B3, 0x0068, 0x015D, |
| 693 | 0x0AF6, 0x01AA, 0x0055, 0x015C, 0x02B2, 0x0579, 0x0578, 0x015F, 0x00A2, |
| 694 | ], [ |
| 695 | 0x0905, 0x013D, 0x013C, 0x0904, 0x121D, 0x049D, 0x049C, 0x243D, 0x0907, |
| 696 | 0x00ED, 0x0001, 0x0015, 0x0041, 0x013F, 0x0031, 0x0014, 0x025D, 0x025C, |
| 697 | 0x013E, 0x000D, 0x0000, 0x0040, 0x0139, 0x0043, 0x0030, 0x0017, 0x0033, |
| 698 | 0x0906, 0x0032, 0x0042, 0x00EC, 0x025F, 0x00EF, 0x025E, 0x049F, 0x0138, |
| 699 | 0x0901, 0x013B, 0x0259, 0x121C, 0x049E, 0x0900, 0x0258, 0x243C, 0x121F, |
| 700 | 0x0903, 0x003D, 0x00EE, 0x025B, 0x025A, 0x004D, 0x013A, 0x0902, 0x0245, |
| 701 | 0x00E9, 0x0016, 0x00E8, 0x0499, 0x0125, 0x0244, 0x004C, 0x0498, 0x090D, |
| 702 | 0x00EB, 0x003C, 0x0011, 0x049B, 0x049A, 0x0485, 0x00EA, 0x003F, 0x0124, |
| 703 | 0x090C, 0x003E, 0x0039, 0x0095, 0x0247, 0x0246, 0x0484, 0x0094, 0x0038, |
| 704 | ], [ |
| 705 | 0x0F09, 0x00CD, 0x01FD, 0x0791, 0x1E6D, 0x0790, 0x03D9, 0x3CD1, 0x3CD0, |
| 706 | 0x0075, 0x0001, 0x0001, 0x0035, 0x00CC, 0x0011, 0x0000, 0x03D8, 0x01FC, |
| 707 | 0x03DB, 0x0010, 0x0003, 0x00CF, 0x03DA, 0x00CE, 0x0074, 0x0034, 0x0077, |
| 708 | 0x0793, 0x0013, 0x0076, 0x0071, 0x03C5, 0x0070, 0x01FF, 0x0792, 0x01FE, |
| 709 | 0x01F9, 0x0037, 0x00C9, 0x0F08, 0x01F8, 0x03C4, 0x00C8, 0x0F0B, 0x079D, |
| 710 | 0x03C7, 0x0001, 0x0012, 0x0073, 0x00CB, 0x0005, 0x0036, 0x03C6, 0x0072, |
| 711 | 0x007D, 0x0002, 0x00CA, 0x079C, 0x01FB, 0x00F5, 0x0031, 0x079F, 0x0F0A, |
| 712 | 0x0F35, 0x079E, 0x01FA, 0x1E6C, 0x1E6F, 0x3CD3, 0x0799, 0x03C1, 0x1E6E, |
| 713 | 0x3CD2, 0x0030, 0x00F4, 0x007C, 0x03C0, 0x03C3, 0x0798, 0x01E5, 0x00F7, |
| 714 | ], [ |
| 715 | 0x01A5, 0x0001, 0x001D, 0x0021, 0x00A1, 0x000D, 0x0061, 0x06B9, 0x00A0, |
| 716 | 0x0060, 0x0001, 0x0005, 0x000C, 0x0020, 0x001C, 0x0004, 0x01A4, 0x01A7, |
| 717 | 0x00A3, 0x001F, 0x001E, 0x0023, 0x0022, 0x002D, 0x002C, 0x0063, 0x0062, |
| 718 | 0x1A81, 0x01A6, 0x01A1, 0x06B8, 0x06BB, 0x00A2, 0x06BA, 0x0D59, 0x06A5, |
| 719 | 0x01A0, 0x000F, 0x006D, 0x06A4, 0x002F, 0x00AD, 0x006C, 0x06A7, 0x00AC, |
| 720 | 0x0D58, 0x000E, 0x01A3, 0x00AF, 0x00AE, 0x006F, 0x01A2, 0x0D5B, 0x00A9, |
| 721 | 0x0019, 0x0001, 0x0009, 0x00A8, 0x006E, 0x002E, 0x0000, 0x01AD, 0x00AB, |
| 722 | 0x00AA, 0x0355, 0x0029, 0x1A80, 0x1A83, 0x1A82, 0x0354, 0x01AC, 0x0D5A, |
| 723 | 0x1A8D, 0x01AF, 0x0357, 0x0D45, 0x0D44, 0x0D47, 0x1A8C, 0x06A6, 0x06A1, |
| 724 | ], [ |
| 725 | 0x0001, 0x0011, 0x0005, 0x0775, 0x00F9, 0x00F8, 0x0031, 0x0030, 0x0049, |
| 726 | 0x00FB, 0x0010, 0x0033, 0x0EC9, 0x038D, 0x038C, 0x00FA, 0x038F, 0x0774, |
| 727 | 0x0048, 0x0032, 0x0000, 0x01D5, 0x00E5, 0x038E, 0x00E4, 0x0013, 0x000D, |
| 728 | 0x0389, 0x0777, 0x0388, 0x038B, 0x1DF9, 0x0EC8, 0x3BC9, 0x1DF8, 0x038A, |
| 729 | 0x03B5, 0x0776, 0x00E7, 0x3BC8, 0x01D4, 0x3BCB, 0x0ECB, 0x0771, 0x0ECA, |
| 730 | 0x01D7, 0x03B4, 0x01D6, 0x1DFB, 0x0EF5, 0x0770, 0x0EF4, 0x3BCA, 0x0773, |
| 731 | 0x00E6, 0x03B7, 0x004B, 0x1DFA, 0x03B6, 0x0EF7, 0x00E1, 0x0EF6, 0x0EF1, |
| 732 | 0x03B1, 0x01D1, 0x003D, 0x0EF0, 0x0772, 0x077D, 0x077C, 0x003C, 0x01D0, |
| 733 | 0x03B0, 0x01D3, 0x003F, 0x03B3, 0x01D2, 0x0EF3, 0x077F, 0x00E0, 0x004A, |
| 734 | ], [ |
| 735 | 0x0015, 0x0049, 0x0014, 0x07D1, 0x03FD, 0x03FC, 0x01C1, 0x01C0, 0x00F1, |
| 736 | 0x0017, 0x0001, 0x0001, 0x01C3, 0x0048, 0x004B, 0x0016, 0x0031, 0x01C2, |
| 737 | 0x004A, 0x0011, 0x0000, 0x01CD, 0x00F0, 0x01CC, 0x0075, 0x0010, 0x000D, |
| 738 | 0x03FF, 0x01CF, 0x01CE, 0x07D0, 0x0F81, 0x07D3, 0x1F1D, 0x0F80, 0x07D2, |
| 739 | 0x01C9, 0x03FE, 0x0074, 0x07DD, 0x00F3, 0x1F1C, 0x07DC, 0x03F9, 0x07DF, |
| 740 | 0x00F2, 0x00FD, 0x0077, 0x07DE, 0x07D9, 0x01C8, 0x07D8, 0x0F83, 0x03F8, |
| 741 | 0x0030, 0x0076, 0x0013, 0x0F82, 0x00FC, 0x03FB, 0x0033, 0x03FA, 0x03E5, |
| 742 | 0x03E4, 0x01CB, 0x0032, 0x1F1F, 0x03E7, 0x07DB, 0x07DA, 0x003D, 0x01CA, |
| 743 | 0x07C5, 0x03E6, 0x0071, 0x0F8D, 0x07C4, 0x1F1E, 0x0F8C, 0x03E1, 0x01F5, |
| 744 | ], [ |
| 745 | 0x0019, 0x0065, 0x0018, 0x0351, 0x0350, 0x0353, 0x0021, 0x0020, 0x0064, |
| 746 | 0x001D, 0x0005, 0x0005, 0x01A5, 0x0023, 0x0067, 0x0005, 0x0066, 0x0022, |
| 747 | 0x001B, 0x0004, 0x0001, 0x0004, 0x001C, 0x0061, 0x001A, 0x0005, 0x0004, |
| 748 | 0x0007, 0x002D, 0x0006, 0x002C, 0x01A4, 0x002F, 0x0352, 0x035D, 0x0060, |
| 749 | 0x0001, 0x002E, 0x001F, 0x035C, 0x0000, 0x06B1, 0x01A7, 0x0029, 0x01A6, |
| 750 | 0x0028, 0x0063, 0x0062, 0x035F, 0x01A1, 0x002B, 0x06B0, 0x06B3, 0x01A0, |
| 751 | 0x0003, 0x006D, 0x001E, 0x035E, 0x006C, 0x06B2, 0x0002, 0x01A3, 0x01A2, |
| 752 | 0x000D, 0x0005, 0x0007, 0x01AD, 0x006F, 0x002A, 0x006E, 0x0004, 0x0004, |
| 753 | 0x000C, 0x0007, 0x0006, 0x000F, 0x000E, 0x00D5, 0x0009, 0x0006, 0x0007, |
| 754 | ], [ |
| 755 | 0x0065, 0x0181, 0x0064, 0x36C9, 0x06D5, 0x0DB5, 0x0379, 0x0180, 0x0183, |
| 756 | 0x00D5, 0x001D, 0x001C, 0x0DB4, 0x0182, 0x0378, 0x00D4, 0x00D7, 0x06D4, |
| 757 | 0x0067, 0x001F, 0x0001, 0x00D6, 0x00D1, 0x018D, 0x0066, 0x0001, 0x0000, |
| 758 | 0x037B, 0x06D7, 0x037A, 0x0DB7, 0x36C8, 0x06D6, 0x0DB6, 0x1B79, 0x0DB1, |
| 759 | 0x018C, 0x0365, 0x00D0, 0x1B78, 0x00D3, 0x1B7B, 0x0364, 0x06D1, 0x06D0, |
| 760 | 0x018F, 0x018E, 0x00D2, 0x36CB, 0x0367, 0x0366, 0x06D3, 0x0DB0, 0x06D2, |
| 761 | 0x0361, 0x06DD, 0x0189, 0x36CA, 0x0360, 0x36F5, 0x0188, 0x0DB3, 0x36F4, |
| 762 | 0x0009, 0x0008, 0x0005, 0x06DC, 0x00DD, 0x018B, 0x00DC, 0x0004, 0x000B, |
| 763 | 0x018A, 0x0061, 0x0003, 0x0363, 0x00DF, 0x06DF, 0x0362, 0x000A, 0x001E, |
| 764 | ], [ |
| 765 | 0x001D, 0x0061, 0x000D, 0x0D55, 0x06B9, 0x06B8, 0x01A5, 0x0021, 0x0020, |
| 766 | 0x0023, 0x000C, 0x0060, 0x0D54, 0x00AD, 0x00AC, 0x0022, 0x00AF, 0x06BB, |
| 767 | 0x000F, 0x001C, 0x0001, 0x002D, 0x0063, 0x01A4, 0x000E, 0x0001, 0x0005, |
| 768 | 0x01A7, 0x06BA, 0x01A6, 0x06A5, 0x0D57, 0x0D56, 0x1ABD, 0x0D51, 0x00AE, |
| 769 | 0x002C, 0x00A9, 0x002F, 0x0D50, 0x01A1, 0x1ABC, 0x06A4, 0x06A7, 0x06A6, |
| 770 | 0x00A8, 0x06A1, 0x01A0, 0x1ABF, 0x0D53, 0x06A0, 0x0D52, 0x1ABE, 0x06A3, |
| 771 | 0x0062, 0x002E, 0x0009, 0x0D5D, 0x01A3, 0x0D5C, 0x006D, 0x00AB, 0x06A2, |
| 772 | 0x006C, 0x001F, 0x0001, 0x06AD, 0x0029, 0x01A2, 0x0028, 0x0004, 0x001E, |
| 773 | 0x01AD, 0x006F, 0x0000, 0x01AC, 0x01AF, 0x06AC, 0x00AA, 0x006E, 0x0019, |
| 774 | ], [ |
| 775 | 0x0019, 0x007D, 0x0018, 0x01B5, 0x000D, 0x01B4, 0x007C, 0x007F, 0x01B7, |
| 776 | 0x000C, 0x001B, 0x001A, 0x01B6, 0x000F, 0x00D5, 0x0019, 0x007E, 0x00D4, |
| 777 | 0x0018, 0x001B, 0x0001, 0x000E, 0x0011, 0x0009, 0x0005, 0x0005, 0x0005, |
| 778 | 0x00D7, 0x01B1, 0x0008, 0x01B0, 0x0079, 0x06FD, 0x0371, 0x0370, 0x00D6, |
| 779 | 0x0078, 0x01B3, 0x0010, 0x0373, 0x0013, 0x06FC, 0x007B, 0x007A, 0x00D1, |
| 780 | 0x00D0, 0x00D3, 0x0065, 0x0372, 0x06FF, 0x0064, 0x06FE, 0x037D, 0x00D2, |
| 781 | 0x00DD, 0x0067, 0x0004, 0x037C, 0x0012, 0x01B2, 0x0007, 0x0066, 0x01BD, |
| 782 | 0x0006, 0x0061, 0x0004, 0x01BC, 0x001A, 0x0060, 0x001D, 0x0004, 0x001C, |
| 783 | 0x0063, 0x0001, 0x0007, 0x000B, 0x0000, 0x0062, 0x000A, 0x0005, 0x0007, |
| 784 | ], [ |
| 785 | 0x0069, 0x0045, 0x0068, 0x04BD, 0x0255, 0x04BC, 0x00E5, 0x00E4, 0x0031, |
| 786 | 0x0030, 0x0019, 0x0001, 0x0121, 0x00E7, 0x00E6, 0x0033, 0x00E1, 0x00E0, |
| 787 | 0x006B, 0x0018, 0x0001, 0x0044, 0x0032, 0x0047, 0x006A, 0x001B, 0x0005, |
| 788 | 0x003D, 0x0046, 0x0015, 0x0041, 0x0120, 0x0123, 0x04BF, 0x0122, 0x0040, |
| 789 | 0x003C, 0x00E3, 0x0014, 0x0254, 0x0043, 0x0975, 0x012D, 0x00E2, 0x00ED, |
| 790 | 0x0042, 0x00EC, 0x004D, 0x0257, 0x0256, 0x0251, 0x04BE, 0x0974, 0x0250, |
| 791 | 0x00EF, 0x00EE, 0x004C, 0x04B9, 0x012C, 0x04B8, 0x004F, 0x04BB, 0x0253, |
| 792 | 0x003F, 0x0017, 0x0001, 0x0252, 0x00E9, 0x00E8, 0x00EB, 0x0000, 0x0003, |
| 793 | 0x0016, 0x0002, 0x0004, 0x004E, 0x003E, 0x00EA, 0x0049, 0x000D, 0x0007, |
| 794 | ], [ |
| 795 | 0x000D, 0x01BD, 0x000C, 0x0D31, 0x0D30, 0x0D33, 0x0359, 0x0358, 0x002D, |
| 796 | 0x0065, 0x001D, 0x001C, 0x0D32, 0x035B, 0x035A, 0x002C, 0x01BC, 0x0345, |
| 797 | 0x000F, 0x001F, 0x0001, 0x002F, 0x0064, 0x01BF, 0x0067, 0x0001, 0x0005, |
| 798 | 0x0066, 0x002E, 0x0061, 0x0029, 0x0695, 0x0694, 0x0697, 0x0696, 0x0060, |
| 799 | 0x01BE, 0x0D3D, 0x0028, 0x1A49, 0x0344, 0x1A48, 0x1A4B, 0x0D3C, 0x0691, |
| 800 | 0x002B, 0x01B9, 0x002A, 0x0D3F, 0x0690, 0x0347, 0x0D3E, 0x1A4A, 0x0346, |
| 801 | 0x00D5, 0x0341, 0x0063, 0x0D39, 0x0340, 0x0D38, 0x01B8, 0x0D3B, 0x0D3A, |
| 802 | 0x00D4, 0x0062, 0x0000, 0x0693, 0x01BB, 0x0343, 0x0342, 0x001E, 0x000E, |
| 803 | 0x006D, 0x0009, 0x0001, 0x006C, 0x00D7, 0x034D, 0x01BA, 0x0008, 0x0004, |
| 804 | ], [ |
| 805 | 0x0075, 0x00CD, 0x0035, 0x03C1, 0x03C0, 0x07F9, 0x03C3, 0x1F8D, 0x00CC, |
| 806 | 0x0074, 0x0011, 0x0010, 0x03C2, 0x0FD9, 0x01F1, 0x00CF, 0x03CD, 0x00CE, |
| 807 | 0x0034, 0x0001, 0x0001, 0x0037, 0x00C9, 0x00C8, 0x0036, 0x0000, 0x0001, |
| 808 | 0x0FD8, 0x03CC, 0x00CB, 0x01F0, 0x07F8, 0x03CF, 0x07FB, 0x07FA, 0x00CA, |
| 809 | 0x01F3, 0x03CE, 0x00F5, 0x0FDB, 0x00F4, 0x07E5, 0x07E4, 0x07E7, 0x01F2, |
| 810 | 0x07E6, 0x03C9, 0x01FD, 0x0FDA, 0x1F8C, 0x07E1, 0x1F8F, 0x1F8E, 0x03C8, |
| 811 | 0x03CB, 0x0077, 0x0076, 0x0FC5, 0x03CA, 0x07E0, 0x00F7, 0x0FC4, 0x03F5, |
| 812 | 0x00F6, 0x01FC, 0x0003, 0x03F4, 0x0071, 0x03F7, 0x00F1, 0x0013, 0x0031, |
| 813 | 0x0030, 0x0070, 0x0005, 0x0012, 0x0073, 0x01FF, 0x0072, 0x007D, 0x0002, |
| 814 | ], [ |
| 815 | 0x0061, 0x0055, 0x0060, 0x02C9, 0x02C8, 0x02CB, 0x0171, 0x00B5, 0x0054, |
| 816 | 0x0001, 0x0001, 0x0001, 0x0057, 0x0001, 0x0063, 0x001D, 0x0062, 0x0039, |
| 817 | 0x006D, 0x0000, 0x0005, 0x0038, 0x0056, 0x00B4, 0x006C, 0x0003, 0x001C, |
| 818 | 0x006F, 0x003B, 0x0002, 0x003A, 0x0170, 0x00B7, 0x0173, 0x0051, 0x006E, |
| 819 | 0x0025, 0x0050, 0x0069, 0x02CA, 0x0024, 0x0027, 0x0172, 0x00B6, 0x00B1, |
| 820 | 0x000D, 0x000C, 0x001F, 0x017D, 0x0026, 0x0068, 0x0053, 0x017C, 0x006B, |
| 821 | 0x001E, 0x000F, 0x0004, 0x017F, 0x006A, 0x02F5, 0x0019, 0x0021, 0x0052, |
| 822 | 0x02F4, 0x02F7, 0x0020, 0x0BCD, 0x05E5, 0x05E4, 0x0BCC, 0x0023, 0x00B0, |
| 823 | 0x02F6, 0x00B3, 0x0022, 0x02F1, 0x02F0, 0x0BCF, 0x0BCE, 0x017E, 0x005D, |
| 824 | ], [ |
| 825 | 0x00BD, 0x0025, 0x01A1, 0x0159, 0x0299, 0x00BC, 0x0024, 0x0505, 0x0504, |
| 826 | 0x01A0, 0x0001, 0x001D, 0x006D, 0x001C, 0x0001, 0x0005, 0x0027, 0x01A3, |
| 827 | 0x0158, 0x001F, 0x001E, 0x01A2, 0x0026, 0x0021, 0x000D, 0x0020, 0x0023, |
| 828 | 0x0298, 0x006C, 0x0022, 0x00BF, 0x00BE, 0x01AD, 0x002D, 0x029B, 0x00B9, |
| 829 | 0x01AC, 0x00B8, 0x01AF, 0x029A, 0x006F, 0x015B, 0x006E, 0x0285, 0x0284, |
| 830 | 0x01AE, 0x0019, 0x002C, 0x01A9, 0x01A8, 0x000C, 0x000F, 0x015A, 0x00BB, |
| 831 | 0x000E, 0x0000, 0x0069, 0x01AB, 0x0018, 0x01AA, 0x0004, 0x0055, 0x00BA, |
| 832 | 0x0507, 0x0145, 0x0054, 0x0506, 0x00A5, 0x0501, 0x00A4, 0x0057, 0x0500, |
| 833 | 0x0A05, 0x0144, 0x00A7, 0x0287, 0x0286, 0x0503, 0x0147, 0x0A04, 0x0146, |
| 834 | ], [ |
| 835 | 0x0759, 0x0041, 0x00E5, 0x03BD, 0x0E9D, 0x012D, 0x012C, 0x3A1D, 0x03BC, |
| 836 | 0x012F, 0x000D, 0x0040, 0x00E4, 0x03BF, 0x0043, 0x0042, 0x0758, 0x03BE, |
| 837 | 0x00E7, 0x0001, 0x0000, 0x003D, 0x00E6, 0x0015, 0x0014, 0x0017, 0x003C, |
| 838 | 0x743D, 0x012E, 0x03B9, 0x03B8, 0x0E9C, 0x03BB, 0x075B, 0x3A1C, 0x0E9F, |
| 839 | 0x0129, 0x00E1, 0x0128, 0x0E9E, 0x012B, 0x075A, 0x00E0, 0x0E99, 0x0745, |
| 840 | 0x3A1F, 0x03BA, 0x0744, 0x0E98, 0x1D0D, 0x03A5, 0x0E9B, 0x743C, 0x0E9A, |
| 841 | 0x012A, 0x004D, 0x00E3, 0x0E85, 0x01D5, 0x0E84, 0x004C, 0x0747, 0x1D0C, |
| 842 | 0x01D4, 0x003F, 0x0016, 0x0746, 0x03A4, 0x0741, 0x004F, 0x003E, 0x01D7, |
| 843 | 0x0740, 0x000C, 0x0011, 0x004E, 0x00E2, 0x00ED, 0x00EC, 0x0049, 0x0048, |
| 844 | ] |
| 845 | ]; |
| 846 | const RV40_AIC_MODE2_BITS: [[u8; 81]; 20] = [ |
| 847 | [ |
| 848 | 1, 5, 4, 10, 6, 8, 5, 8, 8, |
| 849 | 7, 5, 7, 11, 10, 9, 8, 13, 11, |
| 850 | 6, 7, 3, 9, 8, 10, 9, 8, 5, |
| 851 | 10, 9, 10, 10, 14, 12, 14, 14, 12, |
| 852 | 8, 9, 7, 12, 8, 14, 9, 9, 12, |
| 853 | 8, 9, 11, 11, 13, 9, 11, 14, 12, |
| 854 | 6, 7, 9, 13, 9, 12, 7, 10, 12, |
| 855 | 11, 12, 8, 15, 10, 15, 13, 7, 12, |
| 856 | 10, 10, 8, 10, 13, 13, 13, 11, 8, |
| 857 | ], [ |
| 858 | 4, 6, 5, 11, 8, 10, 7, 11, 9, |
| 859 | 4, 1, 4, 9, 7, 7, 5, 9, 10, |
| 860 | 6, 7, 4, 9, 9, 10, 9, 9, 6, |
| 861 | 9, 10, 9, 10, 12, 12, 13, 12, 11, |
| 862 | 9, 9, 8, 12, 8, 14, 10, 11, 12, |
| 863 | 7, 8, 10, 11, 12, 9, 11, 13, 12, |
| 864 | 6, 7, 8, 12, 9, 12, 7, 11, 10, |
| 865 | 12, 12, 9, 14, 12, 15, 13, 8, 12, |
| 866 | 11, 11, 10, 12, 13, 15, 14, 12, 9, |
| 867 | ], [ |
| 868 | 5, 7, 6, 12, 9, 11, 8, 11, 10, |
| 869 | 7, 5, 7, 11, 10, 9, 8, 12, 12, |
| 870 | 5, 5, 1, 8, 7, 10, 8, 6, 4, |
| 871 | 8, 8, 8, 9, 12, 11, 13, 12, 11, |
| 872 | 8, 9, 8, 12, 8, 13, 10, 11, 11, |
| 873 | 8, 9, 11, 12, 13, 11, 12, 14, 13, |
| 874 | 8, 9, 10, 14, 11, 14, 9, 13, 13, |
| 875 | 8, 9, 6, 11, 10, 14, 11, 6, 10, |
| 876 | 6, 6, 4, 8, 9, 10, 10, 8, 5, |
| 877 | ], [ |
| 878 | 11, 7, 8, 10, 12, 9, 10, 14, 12, |
| 879 | 7, 1, 5, 7, 8, 6, 4, 10, 9, |
| 880 | 10, 5, 4, 8, 11, 8, 7, 6, 7, |
| 881 | 11, 6, 7, 8, 10, 8, 10, 11, 9, |
| 882 | 10, 8, 9, 13, 9, 12, 8, 11, 12, |
| 883 | 11, 4, 7, 8, 9, 6, 8, 12, 9, |
| 884 | 8, 5, 8, 12, 9, 10, 6, 12, 11, |
| 885 | 12, 12, 10, 15, 13, 13, 13, 10, 13, |
| 886 | 15, 10, 9, 10, 12, 13, 13, 10, 9, |
| 887 | ], [ |
| 888 | 11, 8, 8, 11, 13, 10, 11, 15, 12, |
| 889 | 7, 1, 4, 7, 7, 5, 4, 8, 9, |
| 890 | 11, 5, 5, 8, 11, 9, 8, 7, 8, |
| 891 | 13, 7, 8, 9, 11, 9, 10, 12, 10, |
| 892 | 10, 9, 8, 13, 9, 12, 9, 11, 12, |
| 893 | 11, 5, 7, 9, 10, 6, 9, 13, 10, |
| 894 | 7, 4, 7, 11, 8, 9, 5, 10, 11, |
| 895 | 13, 11, 9, 15, 13, 15, 13, 8, 12, |
| 896 | 15, 10, 10, 12, 13, 14, 14, 12, 11, |
| 897 | ], [ |
| 898 | 12, 9, 9, 12, 13, 11, 11, 14, 12, |
| 899 | 8, 2, 5, 7, 9, 6, 5, 10, 10, |
| 900 | 9, 4, 2, 7, 9, 7, 6, 5, 6, |
| 901 | 12, 6, 7, 8, 10, 8, 10, 11, 9, |
| 902 | 12, 9, 10, 13, 11, 12, 10, 14, 13, |
| 903 | 12, 6, 8, 10, 10, 7, 9, 12, 10, |
| 904 | 8, 5, 8, 11, 9, 10, 7, 11, 12, |
| 905 | 8, 6, 5, 11, 11, 11, 8, 6, 9, |
| 906 | 12, 6, 6, 8, 10, 10, 11, 8, 6, |
| 907 | ], [ |
| 908 | 13, 9, 10, 12, 14, 12, 11, 15, 15, |
| 909 | 8, 1, 5, 7, 9, 6, 5, 11, 10, |
| 910 | 11, 6, 5, 9, 11, 9, 8, 7, 8, |
| 911 | 12, 6, 8, 8, 11, 8, 10, 12, 10, |
| 912 | 10, 7, 9, 13, 10, 11, 9, 13, 12, |
| 913 | 11, 3, 6, 8, 9, 4, 7, 11, 8, |
| 914 | 8, 5, 9, 12, 10, 9, 7, 12, 13, |
| 915 | 13, 12, 10, 14, 14, 15, 12, 11, 14, |
| 916 | 15, 7, 9, 8, 11, 11, 12, 10, 9, |
| 917 | ], [ |
| 918 | 10, 5, 6, 9, 11, 7, 8, 12, 11, |
| 919 | 8, 1, 4, 7, 9, 6, 4, 10, 10, |
| 920 | 11, 6, 6, 9, 9, 9, 9, 8, 8, |
| 921 | 14, 10, 10, 12, 12, 11, 12, 13, 12, |
| 922 | 10, 7, 8, 12, 9, 11, 8, 12, 11, |
| 923 | 13, 7, 10, 11, 11, 8, 10, 13, 11, |
| 924 | 6, 3, 7, 11, 8, 9, 5, 10, 11, |
| 925 | 11, 11, 9, 14, 14, 14, 11, 10, 13, |
| 926 | 14, 10, 11, 13, 13, 13, 14, 12, 12, |
| 927 | ], [ |
| 928 | 2, 5, 3, 11, 8, 8, 6, 6, 7, |
| 929 | 8, 5, 6, 12, 10, 10, 8, 10, 11, |
| 930 | 7, 6, 2, 9, 8, 10, 8, 5, 4, |
| 931 | 10, 11, 10, 10, 13, 12, 14, 13, 10, |
| 932 | 10, 11, 8, 14, 9, 14, 12, 11, 12, |
| 933 | 9, 10, 9, 13, 12, 11, 12, 14, 11, |
| 934 | 8, 10, 7, 13, 10, 12, 8, 12, 12, |
| 935 | 10, 9, 6, 12, 11, 11, 11, 6, 9, |
| 936 | 10, 9, 6, 10, 9, 12, 11, 8, 7, |
| 937 | ], [ |
| 938 | 6, 8, 6, 12, 11, 11, 10, 10, 9, |
| 939 | 6, 1, 3, 10, 8, 8, 6, 7, 10, |
| 940 | 8, 6, 3, 10, 9, 10, 8, 6, 5, |
| 941 | 11, 10, 10, 12, 13, 12, 14, 13, 12, |
| 942 | 10, 11, 8, 12, 9, 14, 12, 11, 12, |
| 943 | 9, 9, 8, 12, 12, 10, 12, 13, 11, |
| 944 | 7, 8, 6, 13, 9, 11, 7, 11, 11, |
| 945 | 11, 10, 7, 14, 11, 12, 12, 7, 10, |
| 946 | 12, 11, 8, 13, 12, 14, 13, 11, 10, |
| 947 | ], [ |
| 948 | 7, 10, 7, 13, 13, 13, 11, 11, 10, |
| 949 | 8, 5, 6, 12, 11, 10, 9, 10, 11, |
| 950 | 7, 5, 1, 9, 8, 10, 7, 4, 4, |
| 951 | 9, 11, 9, 11, 12, 11, 13, 13, 10, |
| 952 | 9, 11, 8, 13, 9, 14, 12, 11, 12, |
| 953 | 11, 10, 10, 13, 12, 11, 14, 14, 12, |
| 954 | 9, 10, 8, 13, 10, 14, 9, 12, 12, |
| 955 | 9, 7, 4, 12, 10, 11, 10, 6, 7, |
| 956 | 9, 7, 4, 9, 9, 11, 9, 7, 5, |
| 957 | ], [ |
| 958 | 7, 9, 7, 14, 11, 12, 10, 9, 9, |
| 959 | 8, 5, 5, 12, 9, 10, 8, 8, 11, |
| 960 | 7, 5, 2, 8, 8, 9, 7, 4, 4, |
| 961 | 10, 11, 10, 12, 14, 11, 12, 13, 12, |
| 962 | 9, 10, 8, 13, 8, 13, 10, 11, 11, |
| 963 | 9, 9, 8, 14, 10, 10, 11, 12, 11, |
| 964 | 10, 11, 9, 14, 10, 14, 9, 12, 14, |
| 965 | 6, 6, 3, 11, 8, 9, 8, 3, 6, |
| 966 | 9, 7, 4, 10, 8, 11, 10, 6, 5, |
| 967 | ], [ |
| 968 | 6, 8, 7, 13, 12, 12, 10, 9, 9, |
| 969 | 9, 7, 8, 13, 11, 11, 9, 11, 12, |
| 970 | 7, 6, 1, 9, 8, 10, 7, 5, 4, |
| 971 | 10, 12, 10, 12, 13, 13, 14, 13, 11, |
| 972 | 9, 11, 9, 13, 10, 14, 12, 12, 12, |
| 973 | 11, 12, 10, 14, 13, 12, 13, 14, 12, |
| 974 | 8, 9, 7, 13, 10, 13, 8, 11, 12, |
| 975 | 8, 6, 3, 12, 9, 10, 9, 4, 6, |
| 976 | 10, 8, 5, 10, 10, 12, 11, 8, 6, |
| 977 | ], [ |
| 978 | 7, 10, 7, 12, 9, 12, 10, 10, 12, |
| 979 | 9, 7, 7, 12, 9, 11, 6, 10, 11, |
| 980 | 6, 6, 1, 9, 8, 9, 7, 4, 5, |
| 981 | 11, 12, 9, 12, 10, 14, 13, 13, 11, |
| 982 | 10, 12, 8, 13, 8, 14, 10, 10, 11, |
| 983 | 11, 11, 10, 13, 14, 10, 14, 13, 11, |
| 984 | 11, 10, 7, 13, 8, 12, 7, 10, 12, |
| 985 | 7, 10, 4, 12, 6, 10, 8, 5, 8, |
| 986 | 10, 7, 4, 9, 7, 10, 9, 6, 5, |
| 987 | ], [ |
| 988 | 7, 9, 7, 13, 12, 13, 10, 10, 8, |
| 989 | 8, 5, 6, 11, 10, 10, 8, 10, 10, |
| 990 | 7, 5, 2, 9, 8, 9, 7, 5, 3, |
| 991 | 8, 9, 7, 9, 11, 11, 13, 11, 9, |
| 992 | 8, 10, 7, 12, 9, 14, 11, 10, 10, |
| 993 | 9, 10, 9, 12, 12, 12, 13, 14, 12, |
| 994 | 10, 10, 9, 13, 11, 13, 9, 13, 12, |
| 995 | 8, 7, 4, 12, 10, 10, 10, 6, 6, |
| 996 | 7, 6, 3, 9, 8, 10, 9, 6, 3, |
| 997 | ], [ |
| 998 | 7, 10, 7, 13, 13, 13, 11, 11, 9, |
| 999 | 8, 6, 6, 13, 11, 11, 9, 10, 11, |
| 1000 | 7, 6, 1, 9, 8, 10, 8, 5, 4, |
| 1001 | 8, 9, 8, 9, 12, 12, 12, 12, 8, |
| 1002 | 10, 13, 9, 14, 11, 14, 14, 13, 12, |
| 1003 | 9, 10, 9, 13, 12, 11, 13, 14, 11, |
| 1004 | 9, 11, 8, 13, 11, 13, 10, 13, 13, |
| 1005 | 9, 8, 5, 12, 10, 11, 11, 6, 7, |
| 1006 | 8, 7, 3, 8, 9, 11, 10, 7, 4, |
| 1007 | ], [ |
| 1008 | 8, 9, 7, 11, 11, 12, 11, 14, 9, |
| 1009 | 8, 6, 6, 11, 13, 10, 9, 11, 9, |
| 1010 | 7, 5, 1, 7, 9, 9, 7, 5, 3, |
| 1011 | 13, 11, 9, 10, 12, 11, 12, 12, 9, |
| 1012 | 10, 11, 9, 13, 9, 12, 12, 12, 10, |
| 1013 | 12, 11, 10, 13, 14, 12, 14, 14, 11, |
| 1014 | 11, 8, 8, 13, 11, 12, 9, 13, 11, |
| 1015 | 9, 10, 5, 11, 8, 11, 9, 6, 7, |
| 1016 | 7, 8, 4, 6, 8, 10, 8, 8, 5, |
| 1017 | ], [ |
| 1018 | 8, 10, 8, 13, 13, 13, 12, 11, 10, |
| 1019 | 5, 1, 3, 10, 7, 8, 6, 8, 9, |
| 1020 | 8, 7, 4, 9, 10, 11, 8, 7, 6, |
| 1021 | 8, 9, 7, 9, 12, 11, 12, 10, 8, |
| 1022 | 9, 10, 8, 13, 9, 9, 12, 11, 11, |
| 1023 | 7, 7, 6, 12, 9, 8, 10, 12, 8, |
| 1024 | 6, 7, 4, 12, 8, 13, 6, 9, 10, |
| 1025 | 13, 13, 9, 15, 14, 14, 15, 9, 11, |
| 1026 | 13, 11, 9, 13, 13, 15, 15, 12, 10, |
| 1027 | ], [ |
| 1028 | 10, 8, 9, 11, 12, 10, 8, 13, 13, |
| 1029 | 9, 2, 5, 7, 5, 4, 3, 8, 9, |
| 1030 | 11, 5, 5, 9, 8, 8, 6, 8, 8, |
| 1031 | 12, 7, 8, 10, 10, 9, 8, 12, 10, |
| 1032 | 9, 10, 9, 12, 7, 11, 7, 12, 12, |
| 1033 | 9, 5, 8, 9, 9, 6, 6, 11, 10, |
| 1034 | 6, 4, 7, 9, 5, 9, 3, 9, 10, |
| 1035 | 13, 11, 9, 13, 10, 13, 10, 9, 13, |
| 1036 | 14, 11, 10, 12, 12, 13, 11, 14, 11, |
| 1037 | ], [ |
| 1038 | 11, 7, 8, 10, 12, 9, 9, 14, 10, |
| 1039 | 9, 4, 7, 8, 10, 7, 7, 11, 10, |
| 1040 | 8, 2, 2, 6, 8, 5, 5, 5, 6, |
| 1041 | 15, 9, 10, 10, 12, 10, 11, 14, 12, |
| 1042 | 9, 8, 9, 12, 9, 11, 8, 12, 11, |
| 1043 | 14, 10, 11, 12, 13, 10, 12, 15, 12, |
| 1044 | 9, 7, 8, 12, 9, 12, 7, 11, 13, |
| 1045 | 9, 6, 5, 11, 10, 11, 7, 6, 9, |
| 1046 | 11, 4, 5, 7, 8, 8, 8, 7, 7, |
| 1047 | ] |
| 1048 | ]; |
| 1049 | |
| 1050 | const RV40_PTYPE_CODES: &[[u8; 8]; 7] = &[ |
| 1051 | [ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 ], |
| 1052 | [ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 ], |
| 1053 | [ 0x0D, 0x05, 0x01, 0x04, 0x01, 0x00, 0x07, 0x0C ], |
| 1054 | [ 0x09, 0x11, 0x01, 0x00, 0x05, 0x03, 0x21, 0x20 ], |
| 1055 | [ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 ], |
| 1056 | [ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 ], |
| 1057 | [ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 ] |
| 1058 | ]; |
| 1059 | const RV40_PTYPE_BITS: &[[u8; 8]; 7] = &[ |
| 1060 | [ 1, 2, 3, 6, 5, 4, 7, 7 ], |
| 1061 | [ 3, 1, 2, 7, 6, 5, 4, 7 ], |
| 1062 | [ 5, 4, 1, 4, 3, 3, 4, 5 ], |
| 1063 | [ 4, 5, 2, 2, 3, 2, 6, 6 ], |
| 1064 | [ 5, 6, 1, 4, 2, 3, 7, 7 ], |
| 1065 | [ 5, 6, 1, 4, 3, 2, 7, 7 ], |
| 1066 | [ 6, 3, 2, 7, 5, 4, 1, 7 ] |
| 1067 | ]; |
| 1068 | const RV40_PTYPE_SYMS: &[MBType; 8] = &[ |
| 1069 | MBType::MBIntra, |
| 1070 | MBType::MBIntra16, |
| 1071 | MBType::MBP16x16, |
| 1072 | MBType::MBP8x8, |
| 1073 | MBType::MBP16x8, |
| 1074 | MBType::MBP8x16, |
| 1075 | MBType::MBP16x16Mix, |
| 1076 | MBType::Invalid, |
| 1077 | ]; |
| 1078 | |
| 1079 | const RV40_BTYPE_CODES: &[[u8; 7]; 6] = &[ |
| 1080 | [ 0x01, 0x05, 0x00, 0x03, 0x11, 0x09, 0x10 ], |
| 1081 | [ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 ], |
| 1082 | [ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 ], |
| 1083 | [ 0x09, 0x01, 0x00, 0x01, 0x05, 0x03, 0x08 ], |
| 1084 | [ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 ], |
| 1085 | [ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 ] |
| 1086 | ]; |
| 1087 | const RV40_BTYPE_BITS: &[[u8; 7]; 6] = &[ |
| 1088 | [ 2, 3, 2, 2, 5, 4, 5 ], |
| 1089 | [ 4, 1, 3, 2, 6, 5, 6 ], |
| 1090 | [ 6, 4, 1, 2, 5, 3, 6 ], |
| 1091 | [ 5, 3, 3, 1, 4, 3, 5 ], |
| 1092 | [ 6, 5, 3, 2, 4, 1, 6 ], |
| 1093 | [ 6, 5, 3, 1, 4, 2, 6 ] |
| 1094 | ]; |
| 1095 | const RV40_BTYPE_SYMS: &[MBType; 7] = &[ |
| 1096 | MBType::MBIntra, |
| 1097 | MBType::MBIntra16, |
| 1098 | MBType::MBForward, |
| 1099 | MBType::MBBackward, |
| 1100 | MBType::MBBidir, |
| 1101 | MBType::MBDirect, |
| 1102 | MBType::Invalid, |
| 1103 | ]; |