forge
Explore
Log in

Don't you dare go Hollow

wip(hbd): 42 -> 5 errors -- mc/warp/obmc/interintra call sites widened, only encode.rs+motion.rs remain

Browse files at this commit

04357c7b4e3735788d8a275cf1f916ce68d27498Ahmet Kaan GümüşParent: 4ad151b
crates/ec-av1/src/decode.rsmodified+25 -25
@@ -6712,7 +6712,7 @@ fn read_inter_plane(
6712 y: usize,6712 y: usize,
6713 side: usize,6713 side: usize,
6714 base_q_idx: u8,6714 base_q_idx: u8,
6715- prediction: &[u8],6715+ prediction: &[u16],
6716 // lane-chromau: this block's own luma transform's *actual coded*6716 // lane-chromau: this block's own luma transform's *actual coded*
6717 // `tx_type` -- `av1_get_tx_type` (libaom `blockd.h`): an inter block's6717 // `tx_type` -- `av1_get_tx_type` (libaom `blockd.h`): an inter block's
6718 // chroma plane never codes its own `tx_type` symbol, but (unlike an6718 // chroma plane never codes its own `tx_type` symbol, but (unlike an
@@ -7143,8 +7143,8 @@ fn obmc_neighbour_pred(
7143 luma: bool,7143 luma: bool,
7144 h_kind: mc::InterpFilterKind,7144 h_kind: mc::InterpFilterKind,
7145 v_kind: mc::InterpFilterKind,7145 v_kind: mc::InterpFilterKind,
7146-) -> Vec<u8> {7146+) -> Vec<u16> {
7147- let mut out = vec![0u8; w * h];7147+ let mut out = vec![0u16; w * h];
7148 mc::predict_with_filters(7148 mc::predict_with_filters(
7149 &refplane.data,7149 &refplane.data,
7150 refplane.width,7150 refplane.width,
@@ -7191,7 +7191,7 @@ fn interintra_blend(
7191 side: usize,7191 side: usize,
7192 ii_mode: u8,7192 ii_mode: u8,
7193 wedge: Option<(&'static [u8], usize)>,7193 wedge: Option<(&'static [u8], usize)>,
7194- pred: &mut [u8],7194+ pred: &mut [u16],
7195 ) {7195 ) {
7196 // `interintra_to_intra_mode`: II_DC/II_V/II_H/II_SMOOTH.7196 // `interintra_to_intra_mode`: II_DC/II_V/II_H/II_SMOOTH.
7197 let intra_mode = match ii_mode {7197 let intra_mode = match ii_mode {
@@ -7209,7 +7209,7 @@ fn interintra_blend(
7209 below_left: false,7209 below_left: false,
7210 },7210 },
7211 );7211 );
7212- let mut intra = vec![0u8; side * side];7212+ let mut intra = vec![0u16; side * side];
7213 // Edge filtering never applies here: V/H at delta 0 are plain edge7213 // Edge filtering never applies here: V/H at delta 0 are plain edge
7214 // copies (angle 90/180 skip the directional walk), DC/SMOOTH carry no7214 // copies (angle 90/180 skip the directional walk), DC/SMOOTH carry no
7215 // angle at all.7215 // angle at all.
@@ -7253,33 +7253,33 @@ fn interintra_blend(
7253 });7253 });
7254 let idx = i * side + j;7254 let idx = i * side + j;
7255 pred[idx] =7255 pred[idx] =
7256- ((m * u32::from(intra[idx]) + (64 - m) * u32::from(pred[idx]) + 32) >> 6) as u8;7256+ ((m * u32::from(intra[idx]) + (64 - m) * u32::from(pred[idx]) + 32) >> 6) as u16;
7257 }7257 }
7258 }7258 }
7259 }7259 }
7260 7260
7261-fn obmc_blend_v(dst: &mut [u8], stride: usize, ox: usize, oy: usize, w: usize, h: usize, tmp: &[u8]) {7261+fn obmc_blend_v(dst: &mut [u16], stride: usize, ox: usize, oy: usize, w: usize, h: usize, tmp: &[u16]) {
7262 let mask = obmc_mask(h);7262 let mask = obmc_mask(h);
7263 for row in 0..h {7263 for row in 0..h {
7264 let m = u32::from(mask[row]);7264 let m = u32::from(mask[row]);
7265 for col in 0..w {7265 for col in 0..w {
7266 let d = &mut dst[(oy + row) * stride + ox + col];7266 let d = &mut dst[(oy + row) * stride + ox + col];
7267 let t = u32::from(tmp[row * w + col]);7267 let t = u32::from(tmp[row * w + col]);
7268- *d = ((m * u32::from(*d) + (64 - m) * t + 32) >> 6) as u8;7268+ *d = ((m * u32::from(*d) + (64 - m) * t + 32) >> 6) as u16;
7269 }7269 }
7270 }7270 }
7271 }7271 }
7272 7272
7273 /// Blends `tmp` into `dst` at `(ox, oy)`, mask varying by column (the7273 /// Blends `tmp` into `dst` at `(ox, oy)`, mask varying by column (the
7274 /// left-neighbour pass, `aom_blend_a64_hmask`).7274 /// left-neighbour pass, `aom_blend_a64_hmask`).
7275-fn obmc_blend_h(dst: &mut [u8], stride: usize, ox: usize, oy: usize, w: usize, h: usize, tmp: &[u8]) {7275+fn obmc_blend_h(dst: &mut [u16], stride: usize, ox: usize, oy: usize, w: usize, h: usize, tmp: &[u16]) {
7276 let mask = obmc_mask(w);7276 let mask = obmc_mask(w);
7277 for row in 0..h {7277 for row in 0..h {
7278 for col in 0..w {7278 for col in 0..w {
7279 let m = u32::from(mask[col]);7279 let m = u32::from(mask[col]);
7280 let d = &mut dst[(oy + row) * stride + ox + col];7280 let d = &mut dst[(oy + row) * stride + ox + col];
7281 let t = u32::from(tmp[row * w + col]);7281 let t = u32::from(tmp[row * w + col]);
7282- *d = ((m * u32::from(*d) + (64 - m) * t + 32) >> 6) as u8;7282+ *d = ((m * u32::from(*d) + (64 - m) * t + 32) >> 6) as u16;
7283 }7283 }
7284 }7284 }
7285 }7285 }
@@ -7318,9 +7318,9 @@ fn obmc_blend(
7318 ref_v: &PlaneBuf,7318 ref_v: &PlaneBuf,
7319 other_refs: &RefSlots,7319 other_refs: &RefSlots,
7320 interp_fixed: Option<mc::InterpFilterKind>,7320 interp_fixed: Option<mc::InterpFilterKind>,
7321- pred_y: &mut [u8],7321+ pred_y: &mut [u16],
7322- pred_u: &mut [u8],7322+ pred_u: &mut [u16],
7323- pred_v: &mut [u8],7323+ pred_v: &mut [u16],
7324 ) -> Result<()> {7324 ) -> Result<()> {
7325 // lane-rect r2 (libaom av1_build_obmc_inter_prediction): each pass has7325 // lane-rect r2 (libaom av1_build_obmc_inter_prediction): each pass has
7326 // its OWN neighbour cap (width-log2 for above, height-log2 for left) and7326 // its OWN neighbour cap (width-log2 for above, height-log2 for left) and
@@ -8382,7 +8382,7 @@ fn decode_inter_block(
8382 v_filter,8382 v_filter,
8383 &mut inter1_y,8383 &mut inter1_y,
8384 );8384 );
8385- let mut pred_y = vec![0u8; side * side];8385+ let mut pred_y = vec![0u16; side * side];
8386 let mut diffwtd_mask_y = Vec::new();8386 let mut diffwtd_mask_y = Vec::new();
8387 // lane-wedge r3: `mask_y` is the DIFFWTD buffer just computed OR8387 // lane-wedge r3: `mask_y` is the DIFFWTD buffer just computed OR
8388 // the wedge codebook lookup (comp_group_idx==1's two mutually8388 // the wedge codebook lookup (comp_group_idx==1's two mutually
@@ -8431,7 +8431,7 @@ fn decode_inter_block(
8431 v_filter,8431 v_filter,
8432 &mut inter1_u,8432 &mut inter1_u,
8433 );8433 );
8434- let mut pred_u = vec![0u8; chroma_side * chroma_side];8434+ let mut pred_u = vec![0u16; chroma_side * chroma_side];
8435 if let Some(mask_y) = mask_y {8435 if let Some(mask_y) = mask_y {
8436 mc::blend_masked_compound(8436 mc::blend_masked_compound(
8437 &inter0_u,8437 &inter0_u,
@@ -8475,7 +8475,7 @@ fn decode_inter_block(
8475 v_filter,8475 v_filter,
8476 &mut inter1_v,8476 &mut inter1_v,
8477 );8477 );
8478- let mut pred_v = vec![0u8; chroma_side * chroma_side];8478+ let mut pred_v = vec![0u16; chroma_side * chroma_side];
8479 if let Some(mask_y) = mask_y {8479 if let Some(mask_y) = mask_y {
8480 mc::blend_masked_compound(8480 mc::blend_masked_compound(
8481 &inter0_v,8481 &inter0_v,
@@ -9028,7 +9028,7 @@ fn decode_inter_block(
9028 mode_for_tx = 0;9028 mode_for_tx = 0;
9029 uv_predict_mode = DC_PRED;9029 uv_predict_mode = DC_PRED;
9030 9030
9031- let mut pred_y = vec![0u8; side * side];9031+ let mut pred_y = vec![0u16; side * side];
9032 mc::predict_with_filters(9032 mc::predict_with_filters(
9033 &py_ref.data,9033 &py_ref.data,
9034 py_ref.width,9034 py_ref.width,
@@ -9042,7 +9042,7 @@ fn decode_inter_block(
9042 v_filter,9042 v_filter,
9043 &mut pred_y,9043 &mut pred_y,
9044 );9044 );
9045- let mut pred_u = vec![0u8; chroma_side * chroma_side];9045+ let mut pred_u = vec![0u16; chroma_side * chroma_side];
9046 mc::predict_with_filters(9046 mc::predict_with_filters(
9047 &pu_ref.data,9047 &pu_ref.data,
9048 pu_ref.width,9048 pu_ref.width,
@@ -9056,7 +9056,7 @@ fn decode_inter_block(
9056 v_filter,9056 v_filter,
9057 &mut pred_u,9057 &mut pred_u,
9058 );9058 );
9059- let mut pred_v = vec![0u8; chroma_side * chroma_side];9059+ let mut pred_v = vec![0u16; chroma_side * chroma_side];
9060 mc::predict_with_filters(9060 mc::predict_with_filters(
9061 &pv_ref.data,9061 &pv_ref.data,
9062 pv_ref.width,9062 pv_ref.width,
@@ -9843,7 +9843,7 @@ fn decode_inter_block8(
9843 Regular,9843 Regular,
9844 &mut inter1_y,9844 &mut inter1_y,
9845 );9845 );
9846- let mut pred_y = vec![0u8; SIDE * SIDE];9846+ let mut pred_y = vec![0u16; SIDE * SIDE];
9847 let mut diffwtd_mask_y = Vec::new();9847 let mut diffwtd_mask_y = Vec::new();
9848 let mask_y: Option<&[u8]> = if let Some(mask_type) = diffwtd_mask_type {9848 let mask_y: Option<&[u8]> = if let Some(mask_type) = diffwtd_mask_type {
9849 diffwtd_mask_y = vec![0u8; SIDE * SIDE];9849 diffwtd_mask_y = vec![0u8; SIDE * SIDE];
@@ -9888,7 +9888,7 @@ fn decode_inter_block8(
9888 Regular,9888 Regular,
9889 &mut inter1_u,9889 &mut inter1_u,
9890 );9890 );
9891- let mut pred_u = vec![0u8; CHROMA_SIDE * CHROMA_SIDE];9891+ let mut pred_u = vec![0u16; CHROMA_SIDE * CHROMA_SIDE];
9892 if let Some(mask_y) = mask_y {9892 if let Some(mask_y) = mask_y {
9893 mc::blend_masked_compound(9893 mc::blend_masked_compound(
9894 &inter0_u,9894 &inter0_u,
@@ -9932,7 +9932,7 @@ fn decode_inter_block8(
9932 Regular,9932 Regular,
9933 &mut inter1_v,9933 &mut inter1_v,
9934 );9934 );
9935- let mut pred_v = vec![0u8; CHROMA_SIDE * CHROMA_SIDE];9935+ let mut pred_v = vec![0u16; CHROMA_SIDE * CHROMA_SIDE];
9936 if let Some(mask_y) = mask_y {9936 if let Some(mask_y) = mask_y {
9937 mc::blend_masked_compound(9937 mc::blend_masked_compound(
9938 &inter0_v,9938 &inter0_v,
@@ -10199,7 +10199,7 @@ fn decode_inter_block8(
10199 }10199 }
10200 mode_for_tx = 0;10200 mode_for_tx = 0;
10201 10201
10202- let mut pred_y = vec![0u8; SIDE * SIDE];10202+ let mut pred_y = vec![0u16; SIDE * SIDE];
10203 mc::predict(10203 mc::predict(
10204 &ref_y.data,10204 &ref_y.data,
10205 ref_y.width,10205 ref_y.width,
@@ -10211,7 +10211,7 @@ fn decode_inter_block8(
10211 SIDE,10211 SIDE,
10212 &mut pred_y,10212 &mut pred_y,
10213 );10213 );
10214- let mut pred_u = vec![0u8; CHROMA_SIDE * CHROMA_SIDE];10214+ let mut pred_u = vec![0u16; CHROMA_SIDE * CHROMA_SIDE];
10215 mc::predict(10215 mc::predict(
10216 &ref_u.data,10216 &ref_u.data,
10217 ref_u.width,10217 ref_u.width,
@@ -10223,7 +10223,7 @@ fn decode_inter_block8(
10223 CHROMA_SIDE,10223 CHROMA_SIDE,
10224 &mut pred_u,10224 &mut pred_u,
10225 );10225 );
10226- let mut pred_v = vec![0u8; CHROMA_SIDE * CHROMA_SIDE];10226+ let mut pred_v = vec![0u16; CHROMA_SIDE * CHROMA_SIDE];
10227 mc::predict(10227 mc::predict(
10228 &ref_v.data,10228 &ref_v.data,
10229 ref_v.width,10229 ref_v.width,
crates/ec-av1/src/warp.rsmodified+2 -2
@@ -427,11 +427,11 @@ fn clip_pixel(v: i32) -> u16 {
427 #[allow(clippy::too_many_arguments)]427 #[allow(clippy::too_many_arguments)]
428 pub fn warp_affine(428 pub fn warp_affine(
429 params: &WarpParams,429 params: &WarpParams,
430- reference: &[u8],430+ reference: &[u16],
431 width: i32,431 width: i32,
432 height: i32,432 height: i32,
433 stride: i32,433 stride: i32,
434- dst: &mut [u8],434+ dst: &mut [u16],
435 p_col: i32,435 p_col: i32,
436 p_row: i32,436 p_row: i32,
437 p_width: i32,437 p_width: i32,