projects
/
nihav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
23eeced
)
move zigzag scan to common place
author
Kostya Shishkov
<kostya.shishkov@gmail.com>
Wed, 3 Jul 2019 16:05:11 +0000
(18:05 +0200)
committer
Kostya Shishkov
<kostya.shishkov@gmail.com>
Wed, 3 Jul 2019 16:05:11 +0000
(18:05 +0200)
nihav-commonfmt/src/codecs/clearvideo.rs
patch
|
blob
|
blame
|
history
nihav-core/src/codecs/h263/data.rs
patch
|
blob
|
blame
|
history
nihav-core/src/codecs/mod.rs
patch
|
blob
|
blame
|
history
nihav-duck/src/codecs/vp3.rs
patch
|
blob
|
blame
|
history
nihav-indeo/src/codecs/indeo4.rs
patch
|
blob
|
blame
|
history
nihav-indeo/src/codecs/indeo5.rs
patch
|
blob
|
blame
|
history
nihav-indeo/src/codecs/intel263.rs
patch
|
blob
|
blame
|
history
nihav-indeo/src/codecs/ivi.rs
patch
|
blob
|
blame
|
history
nihav-realmedia/src/codecs/rv10.rs
patch
|
blob
|
blame
|
history
nihav-realmedia/src/codecs/rv20.rs
patch
|
blob
|
blame
|
history
diff --git
a/nihav-commonfmt/src/codecs/clearvideo.rs
b/nihav-commonfmt/src/codecs/clearvideo.rs
index 46cbb5435c406752b789fe231111a68a4c186feb..3e913a9dcc0a769d0adfab8b215809c87de12b11 100644
(file)
--- a/
nihav-commonfmt/src/codecs/clearvideo.rs
+++ b/
nihav-commonfmt/src/codecs/clearvideo.rs
@@
-815,17
+815,6
@@
const CLV_AC_BITS: &[u8] = &[
const CLV_AC_ESCAPE: u16 = 0x1BFF;
const CLV_AC_ESCAPE: u16 = 0x1BFF;
-const ZIGZAG: &[usize] = &[
- 0, 1, 8, 16, 9, 2, 3, 10,
- 17, 24, 32, 25, 18, 11, 4, 5,
- 12, 19, 26, 33, 40, 48, 41, 34,
- 27, 20, 13, 6, 7, 14, 21, 28,
- 35, 42, 49, 56, 57, 50, 43, 36,
- 29, 22, 15, 23, 30, 37, 44, 51,
- 58, 59, 52, 45, 38, 31, 39, 46,
- 53, 60, 61, 54, 47, 55, 62, 63
-];
-
const CLV_BIAS_ESCAPE: u16 = 0x100;
const CLV_MVY_0_BITS: &[u8] = &[
const CLV_BIAS_ESCAPE: u16 = 0x100;
const CLV_MVY_0_BITS: &[u8] = &[
diff --git
a/nihav-core/src/codecs/h263/data.rs
b/nihav-core/src/codecs/h263/data.rs
index 4f6a7057535dbd2c926219c62c36e729d778d969..de827d461e1ceb86a0b24b722cc4d8f4d9455583 100644
(file)
--- a/
nihav-core/src/codecs/h263/data.rs
+++ b/
nihav-core/src/codecs/h263/data.rs
@@
-8,17
+8,6
@@
pub const H263_SCALES: &[u8] = &[
pub const H263_DC_SCALES: &[u8] = &[
0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62 ];
pub const H263_DC_SCALES: &[u8] = &[
0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62 ];
-pub const H263_ZIGZAG: &[usize] = &[
- 0, 1, 8, 16, 9, 2, 3, 10,
- 17, 24, 32, 25, 18, 11, 4, 5,
- 12, 19, 26, 33, 40, 48, 41, 34,
- 27, 20, 13, 6, 7, 14, 21, 28,
- 35, 42, 49, 56, 57, 50, 43, 36,
- 29, 22, 15, 23, 30, 37, 44, 51,
- 58, 59, 52, 45, 38, 31, 39, 46,
- 53, 60, 61, 54, 47, 55, 62, 63
-];
-
pub const H263_SCAN_H: &[usize] = &[
0, 1, 2, 3, 8, 9, 16, 17,
10, 11, 4, 5, 6, 7, 15, 14,
pub const H263_SCAN_H: &[usize] = &[
0, 1, 2, 3, 8, 9, 16, 17,
10, 11, 4, 5, 6, 7, 15, 14,
diff --git
a/nihav-core/src/codecs/mod.rs
b/nihav-core/src/codecs/mod.rs
index 6cc8880e6d9d3e3a63de612c2324203e39fb6981..ee6f5cdc2bae6d5432a540abac063ed7e1ad0206 100644
(file)
--- a/
nihav-core/src/codecs/mod.rs
+++ b/
nihav-core/src/codecs/mod.rs
@@
-293,3
+293,14
@@
impl RegisteredDecoders {
self.decs.iter()
}
}
self.decs.iter()
}
}
+
+pub const ZIGZAG: [usize; 64] = [
+ 0, 1, 8, 16, 9, 2, 3, 10,
+ 17, 24, 32, 25, 18, 11, 4, 5,
+ 12, 19, 26, 33, 40, 48, 41, 34,
+ 27, 20, 13, 6, 7, 14, 21, 28,
+ 35, 42, 49, 56, 57, 50, 43, 36,
+ 29, 22, 15, 23, 30, 37, 44, 51,
+ 58, 59, 52, 45, 38, 31, 39, 46,
+ 53, 60, 61, 54, 47, 55, 62, 63
+];
diff --git
a/nihav-duck/src/codecs/vp3.rs
b/nihav-duck/src/codecs/vp3.rs
index 698d623746d1dcee1990bda9cbb655b54bdb9c5f..487c671dd00bfdab01867cccd644dfbab2f51dd6 100644
(file)
--- a/
nihav-duck/src/codecs/vp3.rs
+++ b/
nihav-duck/src/codecs/vp3.rs
@@
-2048,17
+2048,6
@@
const VP3_QMAT_INTER: &[i16; 64] = &[
40, 48, 64, 64, 64, 96, 128, 128
];
40, 48, 64, 64, 64, 96, 128, 128
];
-const ZIGZAG: [usize; 64] = [
- 0, 1, 8, 16, 9, 2, 3, 10,
- 17, 24, 32, 25, 18, 11, 4, 5,
- 12, 19, 26, 33, 40, 48, 41, 34,
- 27, 20, 13, 6, 7, 14, 21, 28,
- 35, 42, 49, 56, 57, 50, 43, 36,
- 29, 22, 15, 23, 30, 37, 44, 51,
- 58, 59, 52, 45, 38, 31, 39, 46,
- 53, 60, 61, 54, 47, 55, 62, 63
-];
-
const VP31_DC_CODES: [[u16; 32]; 16] = [
[
0x002D, 0x0026, 0x0166, 0x004E, 0x02CE, 0x059E, 0x027D, 0x0008,
const VP31_DC_CODES: [[u16; 32]; 16] = [
[
0x002D, 0x0026, 0x0166, 0x004E, 0x02CE, 0x059E, 0x027D, 0x0008,
diff --git
a/nihav-indeo/src/codecs/indeo4.rs
b/nihav-indeo/src/codecs/indeo4.rs
index ce6bc35632da07dccd3586cc0d6f732eb628b69a..15cae6d2ad2eb80bfd33849979b627eb592d80f5 100644
(file)
--- a/
nihav-indeo/src/codecs/indeo4.rs
+++ b/
nihav-indeo/src/codecs/indeo4.rs
@@
-506,7
+506,7
@@
const INDEO4_SCAN_4X4_VER: [usize; 16] = [ 0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 1
const INDEO4_SCAN_4X4_HOR: [usize; 16] = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ];
const INDEO4_SCANS_8X8: [&[usize; 64]; 5] = [
const INDEO4_SCAN_4X4_HOR: [usize; 16] = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ];
const INDEO4_SCANS_8X8: [&[usize; 64]; 5] = [
- &
IVI_ZIGZAG, &INDEO4_SCAN_8X8_ALT, &IVI_SCAN_8X8_HOR, &IVI_SCAN_8X8_VER, &IVI_
ZIGZAG
+ &
ZIGZAG, &INDEO4_SCAN_8X8_ALT, &IVI_SCAN_8X8_HOR, &IVI_SCAN_8X8_VER, &
ZIGZAG
];
const INDEO4_SCANS_4X4: [&[usize; 16]; 5] = [
&IVI_SCAN_4X4, &INDEO4_SCAN_4X4_ALT, &INDEO4_SCAN_4X4_VER, &INDEO4_SCAN_4X4_HOR, &IVI_SCAN_4X4
];
const INDEO4_SCANS_4X4: [&[usize; 16]; 5] = [
&IVI_SCAN_4X4, &INDEO4_SCAN_4X4_ALT, &INDEO4_SCAN_4X4_VER, &INDEO4_SCAN_4X4_HOR, &IVI_SCAN_4X4
diff --git
a/nihav-indeo/src/codecs/indeo5.rs
b/nihav-indeo/src/codecs/indeo5.rs
index aece25dc6d637e2bfeadfba279d346b07ed6d69d..eec603a08bde181e8ac39775ffa644f03bd3990c 100644
(file)
--- a/
nihav-indeo/src/codecs/indeo5.rs
+++ b/
nihav-indeo/src/codecs/indeo5.rs
@@
-662,7
+662,7
@@
const INDEO5_Q4_INTRA: &[u16; 16] = &INDEO5_QUANT4X4_INTRA;
const INDEO5_Q4_INTER: &[u16; 16] = &INDEO5_QUANT4X4_INTER;
const INDEO5_SCAN8X8: [&[usize; 64]; 4] = [
const INDEO5_Q4_INTER: &[u16; 16] = &INDEO5_QUANT4X4_INTER;
const INDEO5_SCAN8X8: [&[usize; 64]; 4] = [
- &
IVI_
ZIGZAG, &IVI_SCAN_8X8_VER, &IVI_SCAN_8X8_HOR, &IVI_SCAN_8X8_HOR
+ &ZIGZAG, &IVI_SCAN_8X8_VER, &IVI_SCAN_8X8_HOR, &IVI_SCAN_8X8_HOR
];
const INDEO5_SCAN4X4: &[usize; 16] = &IVI_SCAN_4X4;
];
const INDEO5_SCAN4X4: &[usize; 16] = &IVI_SCAN_4X4;
diff --git
a/nihav-indeo/src/codecs/intel263.rs
b/nihav-indeo/src/codecs/intel263.rs
index be286016232532aae67b7b600bd155e0d3f1f259..fb23bfce77894b091e3eff3dbd2d6b5a437b54f3 100644
(file)
--- a/
nihav-indeo/src/codecs/intel263.rs
+++ b/
nihav-indeo/src/codecs/intel263.rs
@@
-92,7
+92,7
@@
impl<'a> Intel263BR<'a> {
}
idx += run;
validate!(idx < 64);
}
idx += run;
validate!(idx < 64);
- let oidx =
H263_
ZIGZAG[idx as usize];
+ let oidx = ZIGZAG[idx as usize];
blk[oidx] = level;
idx += 1;
if last { break; }
blk[oidx] = level;
idx += 1;
if last { break; }
diff --git
a/nihav-indeo/src/codecs/ivi.rs
b/nihav-indeo/src/codecs/ivi.rs
index 612572a3d8b94121b42ac76978237892ca260128..ab1c91d6091b3c90fd8f3da54954f59ad931c6d2 100644
(file)
--- a/
nihav-indeo/src/codecs/ivi.rs
+++ b/
nihav-indeo/src/codecs/ivi.rs
@@
-250,16
+250,6
@@
impl IVITile {
}
}
}
}
-pub const IVI_ZIGZAG: [usize; 64] = [
- 0, 1, 8, 16, 9, 2, 3, 10,
- 17, 24, 32, 25, 18, 11, 4, 5,
- 12, 19, 26, 33, 40, 48, 41, 34,
- 27, 20, 13, 6, 7, 14, 21, 28,
- 35, 42, 49, 56, 57, 50, 43, 36,
- 29, 22, 15, 23, 30, 37, 44, 51,
- 58, 59, 52, 45, 38, 31, 39, 46,
- 53, 60, 61, 54, 47, 55, 62, 63
-];
pub const IVI_SCAN_8X8_VER: [usize; 64] = [
0, 8, 16, 24, 32, 40, 48, 56,
1, 9, 17, 25, 33, 41, 49, 57,
pub const IVI_SCAN_8X8_VER: [usize; 64] = [
0, 8, 16, 24, 32, 40, 48, 56,
1, 9, 17, 25, 33, 41, 49, 57,
diff --git
a/nihav-realmedia/src/codecs/rv10.rs
b/nihav-realmedia/src/codecs/rv10.rs
index 4b75a4035e95798ce706630e7b6e97e090875edb..d6d4dc6c957e64581ddae72a1bdcffadf86968d5 100644
(file)
--- a/
nihav-realmedia/src/codecs/rv10.rs
+++ b/
nihav-realmedia/src/codecs/rv10.rs
@@
-185,7
+185,7
@@
impl<'a> RealVideo10BR<'a> {
}
idx += run;
validate!(idx < 64);
}
idx += run;
validate!(idx < 64);
- let oidx =
H263_
ZIGZAG[idx as usize];
+ let oidx = ZIGZAG[idx as usize];
blk[oidx] = level;
idx += 1;
if last { break; }
blk[oidx] = level;
idx += 1;
if last { break; }
diff --git
a/nihav-realmedia/src/codecs/rv20.rs
b/nihav-realmedia/src/codecs/rv20.rs
index 66413b2438178170cb2403659d55c4e04d2f2f78..81556d88d9c00afddbd3c5c00627a0095480de2c 100644
(file)
--- a/
nihav-realmedia/src/codecs/rv20.rs
+++ b/
nihav-realmedia/src/codecs/rv20.rs
@@
-126,7
+126,7
@@
impl<'a> RealVideo20BR<'a> {
let scan = match acpred {
ACPredMode::Hor => H263_SCAN_V,
ACPredMode::Ver => H263_SCAN_H,
let scan = match acpred {
ACPredMode::Hor => H263_SCAN_V,
ACPredMode::Ver => H263_SCAN_H,
- _ =>
H263_
ZIGZAG,
+ _ =>
&
ZIGZAG,
};
let rl_cb = if sstate.is_iframe { &self.tables.aic_rl_cb } else { &self.tables.rl_cb };
};
let rl_cb = if sstate.is_iframe { &self.tables.aic_rl_cb } else { &self.tables.rl_cb };