Commit f63f5e99 authored by Raphael Zumer's avatar Raphael Zumer Committed by Thomas Daede

Revert "Revert "Enable and test high bit depth input (#437)" (#442)" (#447)

* Attempt to process 10-bit Y4M input

Currently compiles, encodes and decodes with desynchronization

* Use high bit depth quantization tables

* Move context::clamp() to util.rs

* Fix partition context initialization for high bit depth

* Enable and test 10-bit input

* Add 10- and 12-bit test clips to build.sh

Commented out by default, to enable as needed for local testing.

* Use the same bit depth as y4m_dec for y4m_enc

* Fix benchmark module compilation

* Fix high bit depth test encoding in 8-bit

* Fix header syntax for 12-bit 4:2:0 input

* Enable and test 12-bit input

* Reflect 12-bit support in README.md

* Keep the default C420jpeg color space in y4m_encoder

* Do not allow reconstruction output at high bit depths

* Fix reconstruction output at high bit depths

* Clean up reconstruction copy to frame buffers
parent 55bc456b
[submodule "aom"]
path = aom_build/aom
url = https://gitlab.xiph.org/xiph/aom-rav1e.git
branch = rav1e_15b
branch = rav1e_16b
......@@ -17,7 +17,7 @@ clap = "2"
libc = "0.2"
rand = "0.5"
rustyline = { version = "1", optional = true }
y4m = "0.2"
y4m = "0.3"
enum-iterator-derive = "0.1.1"
backtrace = "0.3"
......
......@@ -15,6 +15,7 @@ rav1e temporarily uses libaom's transforms and CDF initialization tables, but is
* 4x4 to 32x32 RDO-selected square blocks
* DC, H, V, Paeth, and smooth prediction modes
* 4x4 DCT and ADST transforms
* 8-, 10- and 12-bit depth color
* Variable speed settings
* ~10 fps encoding @ 480p
......@@ -38,7 +39,7 @@ On Windows, pkg-config is not required. A Perl distribution such as Strawberry P
# Compressing video
Input videos must be 8-bit 4:2:0, in y4m format.
Input videos must be in y4m format and have 4:2:0 chroma subsampling.
```
cargo run --release --bin rav1e -- input.y4m -o output.ivf
......
Subproject commit 76d7f5da327b209a4b936bfea7ad450e6cc157ab
Subproject commit 82e0d124dba5db07f73c52b3d93b0460b4a83cdf
......@@ -73,7 +73,7 @@ fn write_b_bench(b: &mut Bencher, tx_size: TxSize, qindex: usize) {
b.iter(|| {
for &mode in RAV1E_INTRA_MODES {
let sbo = SuperBlockOffset { x: sbx, y: sby };
fs.qc.update(fi.config.quantizer, tx_size, mode.is_intra());
fs.qc.update(fi.config.quantizer, tx_size, mode.is_intra(), 8);
for p in 1..3 {
for by in 0..8 {
for bx in 0..8 {
......@@ -95,7 +95,8 @@ fn write_b_bench(b: &mut Bencher, tx_size: TxSize, qindex: usize) {
tx_type,
tx_size.block_size(),
&po,
false
false,
8
);
}
}
......
......@@ -7,7 +7,12 @@ set -e
if [[ -z "${SEQ}" ]]; then
SEQ=nyan.y4m
SEQ10=nyan10.y4m
SEQ12=nyan12.y4m
wget -nc https://mf4.xiph.org/~ltrudeau/videos/nyan.y4m
#wget -nc https://people.xiph.org/~tdaede/nyan10.y4m
#wget -nc https://people.xiph.org/~tdaede/nyan12.y4m
fi
......@@ -92,3 +97,12 @@ cmp <(tail -n+2 $DEC_FILE) <(tail -n+2 $REC_FILE)
# Show decoded sequence
# --pause
mpv --loop $DEC_FILE
# Repeat for high bit depth clips
#cargo run --bin rav1e --release -- $SEQ10 -o $ENC_FILE -s 3
#${AOM_TEST}/aomdec $ENC_FILE -o $DEC_FILE
#mpv --loop $DEC_FILE
#cargo run --bin rav1e --release -- $SEQ12 -o $ENC_FILE -s 3
#${AOM_TEST}/aomdec $ENC_FILE -o $DEC_FILE
#mpv --loop $DEC_FILE
......@@ -18,14 +18,17 @@ fn main() {
let width = y4m_dec.get_width();
let height = y4m_dec.get_height();
let framerate = y4m_dec.get_framerate();
let bit_depth = y4m_dec.get_bit_depth();
let mut y4m_enc = match io.rec.as_mut() {
Some(rec) =>
Some(y4m::encode(width, height, framerate).write_header(rec).unwrap()),
Some(y4m::encode(width, height, framerate)
.with_colorspace(y4m_dec.get_colorspace()).write_header(rec).unwrap()),
None => None
};
let mut fi = FrameInvariants::new(width, height, config);
let mut sequence = Sequence::new(width, height);
let mut sequence = Sequence::new(width, height, bit_depth);
write_ivf_header(
&mut io.output,
width,
......
......@@ -12,6 +12,7 @@
use std::cmp;
use context::*;
use plane::*;
use util::clamp;
use FrameInvariants;
use Frame;
......
......@@ -22,6 +22,7 @@ use partition::PredictionMode::*;
use partition::TxType::*;
use partition::*;
use plane::*;
use util::clamp;
use std::*;
use REF_CONTEXTS;
......@@ -667,16 +668,6 @@ static mag_ref_offset_with_txclass: [[[usize; 2]; CONTEXT_MAG_POSITION_NUM]; 3]
// End of Level Map
pub fn clamp(val: i32, min: i32, max: i32) -> i32 {
if val < min {
min
} else if val > max {
max
} else {
val
}
}
pub fn has_chroma(
bo: &BlockOffset, bsize: BlockSize, subsampling_x: usize,
subsampling_y: usize
......
This diff is collapsed.
......@@ -355,32 +355,32 @@ use plane::*;
use predict::*;
impl PredictionMode {
pub fn predict_intra<'a>(self, dst: &'a mut PlaneMutSlice<'a>, tx_size: TxSize) {
pub fn predict_intra<'a>(self, dst: &'a mut PlaneMutSlice<'a>, tx_size: TxSize, bit_depth: usize) {
assert!(self.is_intra());
match tx_size {
TxSize::TX_4X4 => self.predict_intra_inner::<Block4x4>(dst),
TxSize::TX_8X8 => self.predict_intra_inner::<Block8x8>(dst),
TxSize::TX_16X16 => self.predict_intra_inner::<Block16x16>(dst),
TxSize::TX_32X32 => self.predict_intra_inner::<Block32x32>(dst),
TxSize::TX_4X4 => self.predict_intra_inner::<Block4x4>(dst, bit_depth),
TxSize::TX_8X8 => self.predict_intra_inner::<Block8x8>(dst, bit_depth),
TxSize::TX_16X16 => self.predict_intra_inner::<Block16x16>(dst, bit_depth),
TxSize::TX_32X32 => self.predict_intra_inner::<Block32x32>(dst, bit_depth),
_ => unimplemented!()
}
}
#[inline(always)]
fn predict_intra_inner<'a, B: Intra>(self, dst: &'a mut PlaneMutSlice<'a>) {
fn predict_intra_inner<'a, B: Intra>(self, dst: &'a mut PlaneMutSlice<'a>, bit_depth: usize) {
// above and left arrays include above-left sample
// above array includes above-right samples
// left array includes below-left samples
let above = &mut [127u16; 2 * MAX_TX_SIZE + 1][..B::W + B::H + 1];
let left = &mut [129u16; 2 * MAX_TX_SIZE + 1][..B::H + B::W + 1];
let bd = bit_depth;
let base = 128 << (bd - 8);
let above = &mut [(base - 1) as u16; 2 * MAX_TX_SIZE + 1][..B::W + B::H + 1];
let left = &mut [(base + 1) as u16; 2 * MAX_TX_SIZE + 1][..B::H + B::W + 1];
let stride = dst.plane.cfg.stride;
let x = dst.x;
let y = dst.y;
// TODO: pass bd (bitdepth) as a parameter
let bd = 8;
let base = 128 << (bd - 8);
if y != 0 {
if self != PredictionMode::H_PRED {
......@@ -436,6 +436,7 @@ impl PredictionMode {
}
if x == 0 && y == 0 {
above[0] = base;
left[0] = base;
}
}
......@@ -445,9 +446,9 @@ impl PredictionMode {
match self {
PredictionMode::DC_PRED => match (x, y) {
(0, 0) => B::pred_dc_128(slice, stride),
(_, 0) => B::pred_dc_left(slice, stride, above_slice, left_slice),
(0, _) => B::pred_dc_top(slice, stride, above_slice, left_slice),
(0, 0) => B::pred_dc_128(slice, stride, bit_depth),
(_, 0) => B::pred_dc_left(slice, stride, above_slice, left_slice, bit_depth),
(0, _) => B::pred_dc_top(slice, stride, above_slice, left_slice, bit_depth),
_ => B::pred_dc(slice, stride, above_slice, left_slice)
},
PredictionMode::H_PRED => match (x, y) {
......
......@@ -197,17 +197,17 @@ pub trait Intra: Dim {
}
#[cfg_attr(feature = "comparative_bench", inline(never))]
fn pred_dc_128(output: &mut [u16], stride: usize) {
fn pred_dc_128(output: &mut [u16], stride: usize, bit_depth: usize) {
for y in 0..Self::H {
for x in 0..Self::W {
output[y * stride + x] = 128;
output[y * stride + x] = 128 << (bit_depth - 8);
}
}
}
#[cfg_attr(feature = "comparative_bench", inline(never))]
fn pred_dc_left(
output: &mut [u16], stride: usize, above: &[u16], left: &[u16]
output: &mut [u16], stride: usize, above: &[u16], left: &[u16], bit_depth: usize
) {
unsafe {
highbd_dc_left_predictor(
......@@ -217,14 +217,14 @@ pub trait Intra: Dim {
Self::H as libc::c_int,
above.as_ptr(),
left.as_ptr(),
8
bit_depth as libc::c_int
);
}
}
#[cfg_attr(feature = "comparative_bench", inline(never))]
fn pred_dc_top(
output: &mut [u16], stride: usize, above: &[u16], left: &[u16]
output: &mut [u16], stride: usize, above: &[u16], left: &[u16], bit_depth: usize
) {
unsafe {
highbd_dc_top_predictor(
......@@ -234,7 +234,7 @@ pub trait Intra: Dim {
Self::H as libc::c_int,
above.as_ptr(),
left.as_ptr(),
8
bit_depth as libc::c_int
);
}
}
......@@ -331,7 +331,6 @@ pub trait Intra: Dim {
let output_index = r * stride + c;
// Clamp the output to the correct bit depth
output[output_index] = this_pred as u16;
}
}
......@@ -368,7 +367,6 @@ pub trait Intra: Dim {
let output_index = r * stride + c;
// Clamp the output to the correct bit depth
output[output_index] = this_pred as u16;
}
}
......@@ -405,7 +403,6 @@ pub trait Intra: Dim {
let output_index = r * stride + c;
// Clamp the output to the correct bit depth
output[output_index] = this_pred as u16;
}
}
......
......@@ -10,10 +10,16 @@
#![cfg_attr(feature = "cargo-clippy", allow(cast_lossless))]
use partition::TxSize;
use std::mem;
extern {
static dc_qlookup_Q3: [i16; 256];
static ac_qlookup_Q3: [i16; 256];
static dc_qlookup_10_Q3: [i16; 256];
static dc_qlookup_12_Q3: [i16; 256];
static ac_qlookup_Q3: [i16; 256];
static ac_qlookup_10_Q3: [i16; 256];
static ac_qlookup_12_Q3: [i16; 256];
}
fn get_tx_scale(tx_size: TxSize) -> u8 {
......@@ -24,12 +30,26 @@ fn get_tx_scale(tx_size: TxSize) -> u8 {
}
}
pub fn dc_q(qindex: usize) -> i16 {
unsafe { dc_qlookup_Q3[qindex] }
pub fn dc_q(qindex: usize, bit_depth: usize) -> i16 {
let &table = match bit_depth {
8 => &dc_qlookup_Q3,
10 => &dc_qlookup_10_Q3,
12 => &dc_qlookup_12_Q3,
_ => unimplemented!()
};
table[qindex]
}
pub fn ac_q(qindex: usize) -> i16 {
unsafe { ac_qlookup_Q3[qindex] }
pub fn ac_q(qindex: usize, bit_depth: usize) -> i16 {
let &table = match bit_depth {
8 => &ac_qlookup_Q3,
10 => &ac_qlookup_10_Q3,
12 => &ac_qlookup_12_Q3,
_ => unimplemented!()
};
table[qindex]
}
#[derive(Debug, Default, Clone, Copy)]
......@@ -44,8 +64,6 @@ pub struct QuantizationContext {
ac_mul_add: (u32, u32, u32)
}
use std::mem;
fn divu_gen(d: u32) -> (u32, u32, u32) {
let nbits = (mem::size_of_val(&d) as u64) * 8;
let m = nbits - d.leading_zeros() as u64 - 1;
......@@ -101,13 +119,13 @@ mod test {
}
impl QuantizationContext {
pub fn update(&mut self, qindex: usize, tx_size: TxSize, is_intra: bool) {
pub fn update(&mut self, qindex: usize, tx_size: TxSize, is_intra: bool, bit_depth: usize) {
self.tx_scale = get_tx_scale(tx_size) as i32;
self.dc_quant = dc_q(qindex) as u32;
self.dc_quant = dc_q(qindex, bit_depth) as u32;
self.dc_mul_add = divu_gen(self.dc_quant);
self.ac_quant = ac_q(qindex) as u32;
self.ac_quant = ac_q(qindex, bit_depth) as u32;
self.ac_mul_add = divu_gen(self.ac_quant);
self.dc_offset = self.dc_quant as i32 * (if is_intra {21} else {15}) / 64;
......@@ -128,11 +146,11 @@ impl QuantizationContext {
}
}
pub fn quantize_in_place(qindex: usize, coeffs: &mut [i32], tx_size: TxSize) {
pub fn quantize_in_place(qindex: usize, coeffs: &mut [i32], tx_size: TxSize, bit_depth: usize) {
let tx_scale = get_tx_scale(tx_size) as i32;
let dc_quant = dc_q(qindex) as i32;
let ac_quant = ac_q(qindex) as i32;
let dc_quant = dc_q(qindex, bit_depth) as i32;
let ac_quant = ac_q(qindex, bit_depth) as i32;
// using 21/64=0.328125 as rounding offset. To be tuned
let dc_offset = dc_quant * 21 / 64 as i32;
......@@ -150,12 +168,12 @@ pub fn quantize_in_place(qindex: usize, coeffs: &mut [i32], tx_size: TxSize) {
}
pub fn dequantize(
qindex: usize, coeffs: &[i32], rcoeffs: &mut [i32], tx_size: TxSize
qindex: usize, coeffs: &[i32], rcoeffs: &mut [i32], tx_size: TxSize, bit_depth: usize
) {
let tx_scale = get_tx_scale(tx_size) as i32;
rcoeffs[0] = (coeffs[0] * dc_q(qindex) as i32) / tx_scale;
let ac_quant = ac_q(qindex) as i32;
rcoeffs[0] = (coeffs[0] * dc_q(qindex, bit_depth) as i32) / tx_scale;
let ac_quant = ac_q(qindex, bit_depth) as i32;
for (r, &c) in rcoeffs.iter_mut().zip(coeffs.iter()).skip(1) {
*r = c * ac_quant / tx_scale;
......
......@@ -52,9 +52,9 @@ pub struct RDOPartitionOutput {
}
#[allow(unused)]
fn cdef_dist_wxh_8x8(src1: &PlaneSlice, src2: &PlaneSlice) -> u64 {
//TODO: Handle high bit-depth here by setting coeff_shift
let coeff_shift = 0;
fn cdef_dist_wxh_8x8(src1: &PlaneSlice, src2: &PlaneSlice, bit_depth: usize) -> u64 {
let coeff_shift = bit_depth - 8;
let mut sum_s: i32 = 0;
let mut sum_d: i32 = 0;
let mut sum_s2: i64 = 0;
......@@ -82,7 +82,7 @@ fn cdef_dist_wxh_8x8(src1: &PlaneSlice, src2: &PlaneSlice) -> u64 {
#[allow(unused)]
fn cdef_dist_wxh(
src1: &PlaneSlice, src2: &PlaneSlice, w: usize, h: usize
src1: &PlaneSlice, src2: &PlaneSlice, w: usize, h: usize, bit_depth: usize
) -> u64 {
assert!(w & 0x7 == 0);
assert!(h & 0x7 == 0);
......@@ -92,7 +92,8 @@ fn cdef_dist_wxh(
for i in 0..w / 8 {
sum += cdef_dist_wxh_8x8(
&src1.subslice(i * 8, j * 8),
&src2.subslice(i * 8, j * 8)
&src2.subslice(i * 8, j * 8),
bit_depth
)
}
}
......@@ -114,9 +115,9 @@ fn sse_wxh(src1: &PlaneSlice, src2: &PlaneSlice, w: usize, h: usize) -> u64 {
// Compute the rate-distortion cost for an encode
fn compute_rd_cost(
fi: &FrameInvariants, fs: &FrameState, w_y: usize, h_y: usize, w_uv: usize,
h_uv: usize, bo: &BlockOffset, bit_cost: u32
h_uv: usize, bo: &BlockOffset, bit_cost: u32, bit_depth: usize
) -> f64 {
let q = dc_q(fi.config.quantizer) as f64;
let q = dc_q(fi.config.quantizer, bit_depth) as f64;
// Convert q into Q0 precision, given that libaom quantizers are Q3
let q0 = q / 8.0_f64;
......@@ -139,7 +140,8 @@ fn compute_rd_cost(
&fs.input.planes[0].slice(&po),
&fs.rec.planes[0].slice(&po),
w_y,
h_y
h_y,
bit_depth
)
} else {
unimplemented!();
......@@ -195,12 +197,12 @@ pub fn rdo_mode_decision(
let cw_checkpoint = cw.checkpoint();
// Exclude complex prediction modes at higher speed levels
let mode_set = if fi.config.speed <= 3 {
(if fi.frame_type == FrameType::INTER { RAV1E_INTER_MODES }
else { RAV1E_INTRA_MODES })
let mode_set = if fi.frame_type == FrameType::INTER {
RAV1E_INTER_MODES
} else if fi.config.speed <= 3 {
RAV1E_INTRA_MODES
} else {
(if fi.frame_type == FrameType::INTER { RAV1E_INTER_MODES }
else { RAV1E_INTRA_MODES_MINIMAL })
RAV1E_INTRA_MODES_MINIMAL
};
for &luma_mode in mode_set {
......@@ -213,7 +215,7 @@ pub fn rdo_mode_decision(
let tell = wr.tell_frac();
encode_block_a(seq, cw, wr, bsize, bo, skip);
encode_block_b(fi, fs, cw, wr, luma_mode, chroma_mode, bsize, bo, skip);
encode_block_b(fi, fs, cw, wr, luma_mode, chroma_mode, bsize, bo, skip, seq.bit_depth);
let cost = wr.tell_frac() - tell;
let rd = compute_rd_cost(
......@@ -224,7 +226,8 @@ pub fn rdo_mode_decision(
w_uv,
h_uv,
bo,
cost
cost,
seq.bit_depth
);
if rd < best_rd {
......@@ -240,7 +243,7 @@ pub fn rdo_mode_decision(
let mut wr: &mut Writer = &mut WriterCounter::new();
let tell = wr.tell_frac();
encode_block_a(seq, cw, wr, bsize, bo, skip);
encode_block_b(fi, fs, cw, wr, luma_mode, luma_mode, bsize, bo, skip);
encode_block_b(fi, fs, cw, wr, luma_mode, luma_mode, bsize, bo, skip, seq.bit_depth);
let cost = wr.tell_frac() - tell;
let rd = compute_rd_cost(
......@@ -251,7 +254,8 @@ pub fn rdo_mode_decision(
w_uv,
h_uv,
bo,
cost
cost,
seq.bit_depth
);
if rd < best_rd {
......@@ -284,7 +288,7 @@ pub fn rdo_mode_decision(
pub fn rdo_tx_type_decision(
fi: &FrameInvariants, fs: &mut FrameState, cw: &mut ContextWriter,
mode: PredictionMode, bsize: BlockSize, bo: &BlockOffset, tx_size: TxSize,
tx_set: TxSet
tx_set: TxSet, bit_depth: usize
) -> TxType {
let mut best_type = TxType::DCT_DCT;
let mut best_rd = std::f64::MAX;
......@@ -317,11 +321,11 @@ pub fn rdo_tx_type_decision(
let tell = wr.tell_frac();
if is_inter {
write_tx_tree(
fi, fs, cw, wr, mode, mode, bo, bsize, tx_size, tx_type, false,
fi, fs, cw, wr, mode, mode, bo, bsize, tx_size, tx_type, false, bit_depth
);
} else {
write_tx_blocks(
fi, fs, cw, wr, mode, mode, bo, bsize, tx_size, tx_type, false,
fi, fs, cw, wr, mode, mode, bo, bsize, tx_size, tx_type, false, bit_depth
);
}
......@@ -334,7 +338,8 @@ pub fn rdo_tx_type_decision(
w_uv,
h_uv,
bo,
cost
cost,
bit_depth
);
if rd < best_rd {
......@@ -542,7 +547,7 @@ pub fn rdo_cdef_decision(sbo: &SuperBlockOffset, fi: &FrameInvariants,
let ydec = in_plane.cfg.ydec;
if p==0 {
err += cdef_dist_wxh_8x8(&in_slice, &out_slice);
err += cdef_dist_wxh_8x8(&in_slice, &out_slice, bit_depth);
} else {
err += sse_wxh(&in_slice, &out_slice, 8>>xdec, 8>>ydec);
}
......
......@@ -95,44 +95,44 @@ extern "C" {
pub fn forward_transform(
input: &[i16], output: &mut [i32], stride: usize, tx_size: TxSize,
tx_type: TxType
tx_type: TxType, bit_depth: usize
) {
match tx_size {
TxSize::TX_4X4 => fht4x4(input, output, stride, tx_type),
TxSize::TX_8X8 => fht8x8(input, output, stride, tx_type),
TxSize::TX_16X16 => fht16x16(input, output, stride, tx_type),
TxSize::TX_32X32 => fht32x32(input, output, stride, tx_type),
TxSize::TX_4X4 => fht4x4(input, output, stride, tx_type, bit_depth),
TxSize::TX_8X8 => fht8x8(input, output, stride, tx_type, bit_depth),
TxSize::TX_16X16 => fht16x16(input, output, stride, tx_type, bit_depth),
TxSize::TX_32X32 => fht32x32(input, output, stride, tx_type, bit_depth),
_ => panic!("unimplemented tx size")
}
}
pub fn inverse_transform_add(
input: &[i32], output: &mut [u16], stride: usize, tx_size: TxSize,
tx_type: TxType
tx_type: TxType, bit_depth: usize
) {
match tx_size {
TxSize::TX_4X4 => iht4x4_add(input, output, stride, tx_type),
TxSize::TX_8X8 => iht8x8_add(input, output, stride, tx_type),
TxSize::TX_16X16 => iht16x16_add(input, output, stride, tx_type),
TxSize::TX_32X32 => iht32x32_add(input, output, stride, tx_type),
TxSize::TX_4X4 => iht4x4_add(input, output, stride, tx_type, bit_depth),
TxSize::TX_8X8 => iht8x8_add(input, output, stride, tx_type, bit_depth),
TxSize::TX_16X16 => iht16x16_add(input, output, stride, tx_type, bit_depth),
TxSize::TX_32X32 => iht32x32_add(input, output, stride, tx_type, bit_depth),
_ => panic!("unimplemented tx size")
}
}
fn fht4x4(input: &[i16], output: &mut [i32], stride: usize, tx_type: TxType) {
fn fht4x4(input: &[i16], output: &mut [i32], stride: usize, tx_type: TxType, bit_depth: usize) {
unsafe {
av1_fwd_txfm2d_4x4_c(
input.as_ptr(),
output.as_mut_ptr(),
stride as libc::c_int,
tx_type as libc::c_int,
8
bit_depth as libc::c_int
);
}
}
fn iht4x4_add(
input: &[i32], output: &mut [u16], stride: usize, tx_type: TxType
input: &[i32], output: &mut [u16], stride: usize, tx_type: TxType, bit_depth: usize
) {
// SIMD code may assert for transform types beyond TxType::IDTX.
if tx_type < TxType::IDTX {
......@@ -142,7 +142,7 @@ fn iht4x4_add(
output.as_mut_ptr(),
stride as libc::c_int,
tx_type as libc::c_int,
8
bit_depth as libc::c_int
);
}
} else {
......@@ -152,26 +152,26 @@ fn iht4x4_add(
output.as_mut_ptr(),
stride as libc::c_int,
tx_type as libc::c_int,
8
bit_depth as libc::c_int
);
}
}
}
fn fht8x8(input: &[i16], output: &mut [i32], stride: usize, tx_type: TxType) {
fn fht8x8(input: &[i16], output: &mut [i32], stride: usize, tx_type: TxType, bit_depth: usize) {
unsafe {
av1_fwd_txfm2d_8x8_c(
input.as_ptr(),
output.as_mut_ptr(),
stride as libc::c_int,
tx_type as libc::c_int,
8
bit_depth as libc::c_int
);
}
}
fn iht8x8_add(
input: &[i32], output: &mut [u16], stride: usize, tx_type: TxType
input: &[i32], output: &mut [u16], stride: usize, tx_type: TxType, bit_depth: usize
) {
// SIMD code may assert for transform types beyond TxType::IDTX.
if tx_type < TxType::IDTX {
......@@ -181,7 +181,7 @@ fn iht8x8_add(
output.as_mut_ptr(),
stride as libc::c_int,
tx_type as libc::c_int,
8
bit_depth as libc::c_int
);
}
} else {
......@@ -191,14 +191,14 @@ fn iht8x8_add(
output.as_mut_ptr(),
stride as libc::c_int,
tx_type as libc::c_int,
8
bit_depth as libc::c_int
);
}
}
}
fn fht16x16(
input: &[i16], output: &mut [i32], stride: usize, tx_type: TxType
input: &[i16], output: &mut [i32], stride: usize, tx_type: TxType, bit_depth: usize
) {
unsafe {
av1_fwd_txfm2d_16x16_c(
......@@ -206,13 +206,13 @@ fn fht16x16(
output.as_mut_ptr(),
stride as libc::c_int,
tx_type as libc::c_int,
8
bit_depth as libc::c_int
);
}
}
fn iht16x16_add(
input: &[i32], output: &mut [u16], stride: usize, tx_type: TxType
input: &[i32], output: &mut [u16], stride: usize, tx_type: TxType, bit_depth: usize
) {
unsafe {
if tx_type < TxType::IDTX {
......@@ -222,7 +222,7 @@ fn iht16x16_add(
output.as_mut_ptr(),
stride as libc::c_int,
tx_type as libc::c_int,
8
bit_depth as libc::c_int
);
} else {
av1_inv_txfm2d_add_16x16_c(
......@@ -230,14 +230,14 @@ fn iht16x16_add(
output.as_mut_ptr(),
stride as libc::c_int,
tx_type as libc::c_int,
8
bit_depth as libc::c_int
);
}
}
}
fn fht32x32(
input: &[i16], output: &mut [i32], stride: usize, tx_type: TxType
input: &[i16], output: &mut [i32], stride: usize, tx_type: TxType, bit_depth: usize