projects
/
nihav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4ee6b98
)
make encoder test functions accept encoder-specific options
author
Kostya Shishkov
<kostya.shishkov@gmail.com>
Sun, 8 Aug 2021 10:55:53 +0000
(12:55 +0200)
committer
Kostya Shishkov
<kostya.shishkov@gmail.com>
Sun, 8 Aug 2021 10:55:53 +0000
(12:55 +0200)
nihav-codec-support/src/test/enc_video.rs
patch
|
blob
|
blame
|
history
nihav-commonfmt/src/codecs/cinepakenc.rs
patch
|
blob
|
blame
|
history
nihav-commonfmt/src/codecs/zmbvenc.rs
patch
|
blob
|
blame
|
history
nihav-ms/src/codecs/msadpcm.rs
patch
|
blob
|
blame
|
history
nihav-ms/src/codecs/msvideo1enc.rs
patch
|
blob
|
blame
|
history
diff --git
a/nihav-codec-support/src/test/enc_video.rs
b/nihav-codec-support/src/test/enc_video.rs
index e9fcf1f0cf84ae4b03e353a90d0f19656be7e0d9..16ea415136052f7f38af895a56ebfaffa5c1ef34 100644
(file)
--- a/
nihav-codec-support/src/test/enc_video.rs
+++ b/
nihav-codec-support/src/test/enc_video.rs
@@
-210,7
+210,7
@@
pub fn test_remuxing_md5(dec_config: &DecoderTestParams, muxer: &str, mux_reg: &
}
/// Tests an encoder by decoding a stream from input file, feeding it to the encoder and muxing the result into output file.
}
/// Tests an encoder by decoding a stream from input file, feeding it to the encoder and muxing the result into output file.
-pub fn test_encoding_to_file(dec_config: &DecoderTestParams, enc_config: &EncoderTestParams, mut enc_params: EncodeParameters) {
+pub fn test_encoding_to_file(dec_config: &DecoderTestParams, enc_config: &EncoderTestParams, mut enc_params: EncodeParameters
, enc_options: &[NAOption]
) {
let dmx_f = dec_config.dmx_reg.find_demuxer(dec_config.demuxer).unwrap();
let mut file = File::open(dec_config.in_name).unwrap();
let mut fr = FileReader::new_read(&mut file);
let dmx_f = dec_config.dmx_reg.find_demuxer(dec_config.demuxer).unwrap();
let mut file = File::open(dec_config.in_name).unwrap();
let mut fr = FileReader::new_read(&mut file);
@@
-256,6
+256,7
@@
pub fn test_encoding_to_file(dec_config: &DecoderTestParams, enc_config: &Encode
let encfunc = enc_config.enc_reg.find_encoder(enc_config.enc_name).unwrap();
let mut encoder = (encfunc)();
let encfunc = enc_config.enc_reg.find_encoder(enc_config.enc_name).unwrap();
let mut encoder = (encfunc)();
+ encoder.set_options(enc_options);
let out_str = encoder.init(0, enc_params).unwrap();
out_sm.add_stream(NAStream::clone(&out_str));
let out_str = encoder.init(0, enc_params).unwrap();
out_sm.add_stream(NAStream::clone(&out_str));
@@
-318,7
+319,7
@@
pub fn test_encoding_to_file(dec_config: &DecoderTestParams, enc_config: &Encode
}
/// Tests an encoder by decoding a stream from input file, feeding it to the encoder and calculating the hash of codec information and packet data.
}
/// Tests an encoder by decoding a stream from input file, feeding it to the encoder and calculating the hash of codec information and packet data.
-pub fn test_encoding_md5(dec_config: &DecoderTestParams, enc_config: &EncoderTestParams, mut enc_params: EncodeParameters, ref_hash: &[u32; 4]) {
+pub fn test_encoding_md5(dec_config: &DecoderTestParams, enc_config: &EncoderTestParams, mut enc_params: EncodeParameters,
enc_options: &[NAOption],
ref_hash: &[u32; 4]) {
let dmx_f = dec_config.dmx_reg.find_demuxer(dec_config.demuxer).unwrap();
let mut file = File::open(dec_config.in_name).unwrap();
let mut fr = FileReader::new_read(&mut file);
let dmx_f = dec_config.dmx_reg.find_demuxer(dec_config.demuxer).unwrap();
let mut file = File::open(dec_config.in_name).unwrap();
let mut fr = FileReader::new_read(&mut file);
@@
-363,6
+364,7
@@
pub fn test_encoding_md5(dec_config: &DecoderTestParams, enc_config: &EncoderTes
let encfunc = enc_config.enc_reg.find_encoder(enc_config.enc_name).unwrap();
let mut encoder = (encfunc)();
let encfunc = enc_config.enc_reg.find_encoder(enc_config.enc_name).unwrap();
let mut encoder = (encfunc)();
+ encoder.set_options(enc_options);
let out_str = encoder.init(0, enc_params).unwrap();
let mut md5 = MD5::new();
let out_str = encoder.init(0, enc_params).unwrap();
let mut md5 = MD5::new();
diff --git
a/nihav-commonfmt/src/codecs/cinepakenc.rs
b/nihav-commonfmt/src/codecs/cinepakenc.rs
index 38f7cecb5c0365e28871caf8e75cf0210af12f43..01e5714615a283bffb71a2642e7a20d049841591 100644
(file)
--- a/
nihav-commonfmt/src/codecs/cinepakenc.rs
+++ b/
nihav-commonfmt/src/codecs/cinepakenc.rs
@@
-1128,8
+1128,8
@@
mod test {
tb_den: 0,
flags: 0,
};
tb_den: 0,
flags: 0,
};
- //test_encoding_to_file(&dec_config, &enc_config, enc_params);
- test_encoding_md5(&dec_config, &enc_config, enc_params,
+ //test_encoding_to_file(&dec_config, &enc_config, enc_params
, &[]
);
+ test_encoding_md5(&dec_config, &enc_config, enc_params,
&[],
&[0xd73cb3c7, 0x30d59f90, 0x1d6e0e28, 0x5b72cc0c]);
}
}
&[0xd73cb3c7, 0x30d59f90, 0x1d6e0e28, 0x5b72cc0c]);
}
}
diff --git
a/nihav-commonfmt/src/codecs/zmbvenc.rs
b/nihav-commonfmt/src/codecs/zmbvenc.rs
index 0d5c1afa8388e9f66a730290fb008f3cf85cae4d..7de6c23a8f97162cb31ca53a24edbc0d0993e44f 100644
(file)
--- a/
nihav-commonfmt/src/codecs/zmbvenc.rs
+++ b/
nihav-commonfmt/src/codecs/zmbvenc.rs
@@
-588,8
+588,9
@@
mod test {
tb_den: 0,
flags: 0,
};
tb_den: 0,
flags: 0,
};
- //test_encoding_to_file(&dec_config, &enc_config, enc_params);
- test_encoding_md5(&dec_config, &enc_config, enc_params,
+ let enc_options = &[];
+ //test_encoding_to_file(&dec_config, &enc_config, enc_params, enc_options);
+ test_encoding_md5(&dec_config, &enc_config, enc_params, enc_options,
&[0x50df10e2, 0x606f3268, 0xdd4bc2ff, 0x844e7d87]);
}
&[0x50df10e2, 0x606f3268, 0xdd4bc2ff, 0x844e7d87]);
}
@@
-632,8
+633,9
@@
mod test {
tb_den: 0,
flags: 0,
};
tb_den: 0,
flags: 0,
};
- //test_encoding_to_file(&dec_config, &enc_config, enc_params);
- test_encoding_md5(&dec_config, &enc_config, enc_params,
+ let enc_options = &[];
+ //test_encoding_to_file(&dec_config, &enc_config, enc_params, enc_options);
+ test_encoding_md5(&dec_config, &enc_config, enc_params, enc_options,
&[0x0b4cb528, 0x66c91f6c, 0x1c2187a5, 0x2723a08d]);
}
&[0x0b4cb528, 0x66c91f6c, 0x1c2187a5, 0x2723a08d]);
}
@@
-676,8
+678,9
@@
mod test {
tb_den: 0,
flags: 0,
};
tb_den: 0,
flags: 0,
};
- //test_encoding_to_file(&dec_config, &enc_config, enc_params);
- test_encoding_md5(&dec_config, &enc_config, enc_params,
+ let enc_options = &[];
+ //test_encoding_to_file(&dec_config, &enc_config, enc_params, enc_options);
+ test_encoding_md5(&dec_config, &enc_config, enc_params, enc_options,
&[0x1a522743, 0x6c320a6e, 0xd08539e1, 0x03fc17ea]);
}
&[0x1a522743, 0x6c320a6e, 0xd08539e1, 0x03fc17ea]);
}
@@
-720,8
+723,9
@@
mod test {
tb_den: 0,
flags: 0,
};
tb_den: 0,
flags: 0,
};
- //test_encoding_to_file(&dec_config, &enc_config, enc_params);
- test_encoding_md5(&dec_config, &enc_config, enc_params,
+ let enc_options = &[];
+ //test_encoding_to_file(&dec_config, &enc_config, enc_params, enc_options);
+ test_encoding_md5(&dec_config, &enc_config, enc_params, enc_options,
&[0x3880e045, 0xe6c88dc7, 0x21066058, 0xc789f1e9]);
}
}
&[0x3880e045, 0xe6c88dc7, 0x21066058, 0xc789f1e9]);
}
}
diff --git
a/nihav-ms/src/codecs/msadpcm.rs
b/nihav-ms/src/codecs/msadpcm.rs
index 5010c03dc330457ef6e8de7a5b8d56af9be5c1bc..dfcf6403dbbabadacc206604dce9e2afc9a360aa 100644
(file)
--- a/
nihav-ms/src/codecs/msadpcm.rs
+++ b/
nihav-ms/src/codecs/msadpcm.rs
@@
-464,7
+464,7
@@
mod test {
tb_den: 0,
flags: 0,
};
tb_den: 0,
flags: 0,
};
- test_encoding_md5(&dec_config, &enc_config, enc_params,
+ test_encoding_md5(&dec_config, &enc_config, enc_params,
&[],
&[0xe1591a1e, 0x816d0239, 0x4cc42291, 0x4e6b69cb]);
}
}
&[0xe1591a1e, 0x816d0239, 0x4cc42291, 0x4e6b69cb]);
}
}
diff --git
a/nihav-ms/src/codecs/msvideo1enc.rs
b/nihav-ms/src/codecs/msvideo1enc.rs
index d2e5c34278f9f986e01e9f2c5cd5507f24f78220..89b4b2200aed810f46ecc15ed45609a60177283f 100644
(file)
--- a/
nihav-ms/src/codecs/msvideo1enc.rs
+++ b/
nihav-ms/src/codecs/msvideo1enc.rs
@@
-610,8
+610,8
@@
mod test {
tb_den: 0,
flags: 0,
};
tb_den: 0,
flags: 0,
};
- //test_encoding_to_file(&dec_config, &enc_config, enc_params);
- test_encoding_md5(&dec_config, &enc_config, enc_params,
+ //test_encoding_to_file(&dec_config, &enc_config, enc_params
, &[]
);
+ test_encoding_md5(&dec_config, &enc_config, enc_params,
&[],
&[0x4339421d, 0x6393f1b6, 0x653d6cd2, 0x3a184382]);
}
}
&[0x4339421d, 0x6393f1b6, 0x653d6cd2, 0x3a184382]);
}
}