1pub mod codec;
31pub mod det_math;
32pub mod stego;
33
34pub use codec::jpeg as jpeg;
36
37pub use codec::jpeg::error::{JpegError, Result as JpegResult};
38pub use codec::jpeg::dct::{DctGrid, QuantTable};
39pub use codec::jpeg::frame::FrameInfo;
40pub use codec::jpeg::JpegImage;
41pub use stego::{ghost_encode, ghost_decode, ghost_encode_with_files, ghost_encode_si, ghost_encode_si_with_files, ghost_capacity, ghost_capacity_si, StegoError, GHOST_DECODE_STEPS, GHOST_ENCODE_STEPS};
42pub use stego::{ghost_encode_with_quality, ghost_encode_with_files_quality, ghost_encode_si_with_quality, ghost_encode_si_with_files_quality};
43pub use stego::{ghost_encode_with_shadows, ghost_encode_si_with_shadows, ghost_shadow_decode, ShadowLayer, GHOST_ENCODE_WITH_SHADOWS_STEPS, shadow_capacity, estimate_shadow_capacity, ghost_capacity_with_shadows};
44pub use stego::{ghost_encode_with_shadows_quality, ghost_encode_si_with_shadows_quality};
45pub use stego::{armor_encode, armor_encode_with_quality, armor_decode, armor_capacity, armor_capacity_info, smart_decode, DecodeQuality, ArmorCapacityInfo};
46pub use stego::EncodeQuality;
47pub use stego::{validate_encode_dimensions, MAX_DIMENSION, MAX_PIXELS, MIN_ENCODE_DIMENSION, ARMOR_TARGET_DIMENSION};
48pub use stego::{PayloadData, FileEntry, compressed_payload_size};
49pub use stego::progress;
50pub use stego::{optimize_cover, OptimizerConfig, OptimizerMode};
51
52#[cfg(feature = "video")]
54pub use stego::video::{
55 h264_ghost_encode, h264_ghost_encode_inplace,
56 h264_ghost_decode, h264_ghost_capacity, h264_ghost_capacity_max,
57 h264_ghost_encode_path, h264_ghost_decode_path,
58 h264_ghost_capacity_path, h264_ghost_capacity_max_path,
59 is_mp4,
60};
61
62#[cfg(feature = "h264-encoder")]
68pub use codec::h264::encoder::baseline_transcode::{
69 BaselineTranscodeConfig, StreamingEncoder, transcode_yuv_to_baseline_cavlc_h264,
70};
71
72#[cfg(feature = "cabac-stego")]
78pub use codec::h264::stego::encode_pixels::{
79 h264_stego_encode_i_frames_only, h264_stego_encode_i_then_p_frames,
80 h264_stego_encode_i_then_p_frames_4domain,
81 h264_stego_encode_i_then_p_frames_4domain_multigop,
82 h264_stego_encode_yuv_string, h264_stego_encode_yuv_string_4domain,
83 h264_stego_encode_yuv_string_4domain_multigop,
84 h264_stego_encode_yuv_string_4domain_multigop_streaming,
85 h264_stego_encode_yuv_string_4domain_multigop_streaming_v2,
86 h264_stego_encode_yuv_string_4domain_multigop_with_pattern,
87 h264_stego_encode_yuv_string_i_then_p,
88 h264_stego_encode_yuv_string_with_n_shadows,
89 h264_stego_encode_yuv_string_with_n_shadows_with_pattern,
90 h264_stego_encode_yuv_string_with_shadow,
91 h264_stego_encode_yuv_string_with_shadow_with_pattern,
92 h264_stego_shadow_capacity, H264ShadowCapacityInfo,
93};
94#[cfg(feature = "cabac-stego")]
95pub use codec::h264::stego::gop_pattern::{FrameType, GopPattern};
96
97#[cfg(feature = "cabac-stego")]
103pub use codec::h264::stego::decode_pixels::{
104 h264_stego_decode_yuv_string, h264_stego_decode_yuv_string_4domain,
105 h264_stego_shadow_decode, h264_stego_smart_decode_video,
106};
107
108#[cfg(feature = "video")]
117#[derive(Debug, Clone, Copy, PartialEq, Eq)]
118pub enum VideoCodec {
119 H264,
121 Hevc,
124 Unknown,
126}
127
128#[cfg(feature = "video")]
131pub fn detect_video_codec(mp4_bytes: &[u8]) -> VideoCodec {
132 if !is_mp4(mp4_bytes) {
133 return VideoCodec::Unknown;
134 }
135 let Ok(file) = codec::mp4::demux::demux(mp4_bytes) else {
136 return VideoCodec::Unknown;
137 };
138 let Some(idx) = file.video_track_idx else {
139 return VideoCodec::Unknown;
140 };
141 let track = &file.tracks[idx];
142 if track.is_h264() {
143 VideoCodec::H264
144 } else if track.is_hevc() {
145 VideoCodec::Hevc
146 } else {
147 VideoCodec::Unknown
148 }
149}