pub const VIDEO_DEFAULT_QUEUE_CAPACITY: usize = 6;
pub const VIDEO_DEFAULT_POOL_CAPACITY: usize = 8;
pub const VIDEO_DEFAULT_MAX_LATE_US: i64 = 50_000;
pub const VIDEO_PRESENT_TOLERANCE_US: i64 = 500;
pub const VIDEO_MICROS_PER_SEC: u64 = 1_000_000;
pub const VIDEO_SW_FRAME_MAGIC: &[u8; 4] = b"EVF1";
pub const VIDEO_SW_PACKET_INTRA_RGBA: u8 = 0;
pub const VIDEO_SW_PACKET_INTRA_YUV420P: u8 = 1;
pub const VIDEO_SW_PACKET_DELTA_XOR: u8 = 2;
pub(crate) const MP4_BOX_FTYP: [u8; 4] = *b"ftyp";
pub(crate) const MP4_BOX_MOOV: [u8; 4] = *b"moov";
pub(crate) const MP4_BOX_MVHD: [u8; 4] = *b"mvhd";
pub(crate) const MP4_BOX_TRAK: [u8; 4] = *b"trak";
pub(crate) const MP4_BOX_TKHD: [u8; 4] = *b"tkhd";
pub(crate) const MP4_BOX_MDIA: [u8; 4] = *b"mdia";
pub(crate) const MP4_BOX_MDHD: [u8; 4] = *b"mdhd";
pub(crate) const MP4_BOX_HDLR: [u8; 4] = *b"hdlr";
pub(crate) const MP4_BOX_MINF: [u8; 4] = *b"minf";
pub(crate) const MP4_BOX_STBL: [u8; 4] = *b"stbl";
pub(crate) const MP4_BOX_STSD: [u8; 4] = *b"stsd";
pub(crate) const MP4_BOX_COLR: [u8; 4] = *b"colr";
pub(crate) const MP4_BOX_NCLX: [u8; 4] = *b"nclx";
pub(crate) const MP4_BOX_STTS: [u8; 4] = *b"stts";
pub(crate) const MP4_BOX_CTTS: [u8; 4] = *b"ctts";
pub(crate) const MP4_BOX_STSS: [u8; 4] = *b"stss";
pub(crate) const MP4_BOX_STSC: [u8; 4] = *b"stsc";
pub(crate) const MP4_BOX_STSZ: [u8; 4] = *b"stsz";
pub(crate) const MP4_BOX_STCO: [u8; 4] = *b"stco";
pub(crate) const MP4_BOX_CO64: [u8; 4] = *b"co64";
pub(crate) const MP4_BOX_MDAT: [u8; 4] = *b"mdat";
pub(crate) const MP4_HANDLER_VIDE: [u8; 4] = *b"vide";
pub(crate) const MP4_HANDLER_SOUN: [u8; 4] = *b"soun";
pub(crate) const MP4_BRAND_ISOM: [u8; 4] = *b"isom";
pub(crate) const MP4_BRAND_MP42: [u8; 4] = *b"mp42";
pub(crate) const MP4_CODEC_AVC1: [u8; 4] = *b"avc1";
pub(crate) const MP4_CODEC_AVC3: [u8; 4] = *b"avc3";
pub(crate) const MP4_CODEC_HVC1: [u8; 4] = *b"hvc1";
pub(crate) const MP4_CODEC_HEV1: [u8; 4] = *b"hev1";
pub(crate) const MP4_CODEC_VP09: [u8; 4] = *b"vp09";
pub(crate) const MP4_CODEC_AV01: [u8; 4] = *b"av01";
pub(crate) const MP4_CODEC_RAWV: [u8; 4] = *b"rawv";
pub(crate) const MP4_CODEC_RGBA: [u8; 4] = *b"rgba";
pub(crate) const MP4_CODEC_MP4A: [u8; 4] = *b"mp4a";
pub(crate) const MP4_CODEC_OPUS: [u8; 4] = *b"Opus";
#[cfg(not(target_arch = "wasm32"))]
pub(crate) const VIDEO_WORKER_THREAD_NAME: &str = "euv-video-decode";
pub(crate) const VIDEO_ERR_MP4_EMPTY: &str = "MP4 container buffer is empty";
pub(crate) const VIDEO_ERR_MP4_TRUNCATED_BOX: &str = "MP4 box header or payload is truncated";
pub(crate) const VIDEO_ERR_MP4_NO_MOOV: &str = "MP4 container is missing a moov box";
pub(crate) const VIDEO_ERR_MP4_NO_VIDEO_TRACK: &str = "MP4 container has no decodable video track";
pub(crate) const VIDEO_ERR_MP4_SAMPLE_BOUNDS: &str =
"MP4 sample byte range exceeds container bounds";
pub(crate) const VIDEO_ERR_SW_PACKET_INVALID: &str =
"Software video decoder received malformed packet";
pub(crate) const VIDEO_ERR_SW_PACKET_SIZE: &str =
"Software video packet payload size does not match frame dimensions";
pub(crate) const VIDEO_ERR_SW_DELTA_NO_REF: &str =
"Delta video frame cannot be decoded before an intra keyframe";
pub(crate) const VIDEO_ERR_POOL_EXHAUSTED: &str =
"Bounded CPU video frame pool has no available slots";
pub(crate) const VIDEO_ERR_UNSUPPORTED_DIMENSIONS: &str =
"Video frame dimensions exceed valid non-zero bounds";
pub(crate) const VIDEO_ERR_UNSUPPORTED_CODEC: &str =
"Software fallback cannot decode compressed bitstream without a hardware or codec backend";
pub(crate) const VIDEO_DEFAULT_BRAND_STR: &str = "isom";
pub(crate) const VIDEO_FORMAT_MP4_PREFIX: &str = "MP4 ยท ";
pub(crate) const VIDEO_CODEC_LABEL_H264: &str = "H.264";
pub(crate) const VIDEO_CODEC_LABEL_H265: &str = "H.265";
pub(crate) const VIDEO_CODEC_LABEL_VP9: &str = "VP9";
pub(crate) const VIDEO_CODEC_LABEL_AV1: &str = "AV1";
pub(crate) const VIDEO_CODEC_LABEL_RAW: &str = "RawFrames";
#[cfg(not(target_arch = "wasm32"))]
pub(crate) const VIDEO_FAST_HOLD_NONE: u64 = u64::MAX;
#[cfg(not(target_arch = "wasm32"))]
pub(crate) const VIDEO_FAST_HOLD_COVERED: u64 = u64::MAX - 1;
pub(crate) const YUV_Q16_SHIFT: i32 = 16;
pub(crate) const YUV_Q16_HALF: i32 = 32_768;
pub(crate) const YUV_LIMITED_Y_MIN: i32 = 16;
pub(crate) const YUV_LIMITED_Y_MAX: i32 = 235;
pub(crate) const YUV_CHROMA_BIAS: i32 = 128;
pub(crate) const YUV_COEFFS_BT601_LIMITED: [i32; 5] = [76_309, 104_597, -25_675, -53_279, 132_201];
pub(crate) const YUV_COEFFS_BT601_FULL: [i32; 5] = [65_536, 91_881, -22_553, -46_802, 116_130];
pub(crate) const YUV_COEFFS_BT709_LIMITED: [i32; 5] = [76_309, 117_489, -13_975, -34_925, 138_438];
pub(crate) const YUV_COEFFS_BT709_FULL: [i32; 5] = [65_536, 103_206, -12_276, -30_679, 121_609];
pub(crate) const YUV_COEFFS_BT2020_LIMITED: [i32; 5] = [76_309, 110_014, -12_277, -42_626, 140_363];
pub(crate) const YUV_COEFFS_BT2020_FULL: [i32; 5] = [65_536, 96_639, -10_784, -37_444, 123_299];