#![allow(clippy::needless_range_loop)]
#![allow(clippy::too_many_arguments)]
#![allow(clippy::identity_op)]
#![allow(clippy::manual_range_contains)]
#![allow(clippy::manual_div_ceil)]
pub mod decoder;
pub mod demux;
pub mod encoder;
pub mod encoder_anim;
pub mod encoder_vp8;
pub mod riff;
pub mod vp8l;
use oxideav_core::ContainerRegistry;
use oxideav_core::{CodecCapabilities, CodecId, CodecParameters, Result};
use oxideav_core::{CodecInfo, CodecRegistry, Decoder, Encoder};
pub const CODEC_ID_VP8L: &str = "webp_vp8l";
pub const CODEC_ID_VP8: &str = "webp_vp8";
pub fn register_codecs(reg: &mut CodecRegistry) {
let caps = CodecCapabilities::video("webp_vp8l_sw")
.with_intra_only(true)
.with_lossless(true)
.with_max_size(16384, 16384);
reg.register(
CodecInfo::new(CodecId::new(CODEC_ID_VP8L))
.capabilities(caps)
.decoder(make_vp8l_decoder)
.encoder(make_vp8l_encoder),
);
let vp8_caps = CodecCapabilities::video("webp_vp8_sw_enc")
.with_intra_only(true)
.with_lossy(true)
.with_max_size(16383, 16383);
reg.register(
CodecInfo::new(CodecId::new(CODEC_ID_VP8))
.capabilities(vp8_caps)
.encoder(make_vp8_encoder),
);
}
pub fn register_containers(reg: &mut ContainerRegistry) {
demux::register(reg);
}
pub fn register(codecs: &mut CodecRegistry, containers: &mut ContainerRegistry) {
register_codecs(codecs);
register_containers(containers);
}
fn make_vp8l_decoder(params: &CodecParameters) -> Result<Box<dyn Decoder>> {
decoder::make_vp8l_decoder(params)
}
fn make_vp8l_encoder(params: &CodecParameters) -> Result<Box<dyn Encoder>> {
encoder::make_encoder(params)
}
fn make_vp8_encoder(params: &CodecParameters) -> Result<Box<dyn Encoder>> {
encoder_vp8::make_encoder(params)
}
pub use decoder::{decode_webp, WebpFrame, WebpImage};
pub use encoder_anim::{build_animated_webp, AnimFrame};
pub use vp8l::{encode_vp8l_argb, encode_vp8l_argb_with, EncoderOptions};