h264: more micro-optimisations
[nihav.git] / nihav-itu / src / codecs / h264 / types.rs
index 1310daaa9ddc022259ae165cf5e5cb1bfb144fd9..4bcdb4943547318d09df4c858f7412fa7aedd080 100644 (file)
@@ -383,8 +383,9 @@ pub struct MBData {
 }
 
 pub fn blk4_to_blk8(blk4: usize) -> usize {
-    const MAP: [usize; 16] = [ 0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3 ];
-    MAP[blk4 & 0xF]
+    /*const MAP: [usize; 16] = [ 0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3 ];
+    MAP[blk4 & 0xF]*/
+    ((blk4 & 2) >> 1) | ((blk4 & 8) >> 2)
 }
 
 #[derive(Clone,Copy)]