Skip to content

Commit

Permalink
enum {Rect,}TxfmSize, struct BlockContext::tx: Make u8s not `i8…
Browse files Browse the repository at this point in the history
…`s (#428)
  • Loading branch information
kkysen authored Aug 31, 2023
2 parents 66f0ae1 + becc4f0 commit 695f058
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions src/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1016,8 +1016,8 @@ unsafe fn read_tx_tree(
let bx4 = t.bx & 31;
let by4 = t.by & 31;
let t_dim = &dav1d_txfm_dimensions[from as usize];
let txw = t_dim.lw as i8;
let txh = t_dim.lh as i8;
let txw = t_dim.lw;
let txh = t_dim.lh;
let is_split;

if depth < 2 && from > TX_4X4 {
Expand All @@ -1037,7 +1037,7 @@ unsafe fn read_tx_tree(
}
if is_split && t_dim.max as TxfmSize > TX_8X8 {
let sub = t_dim.sub as RectTxfmSize;
let sub_t_dim = &dav1d_txfm_dimensions[sub as usize];
let sub_t_dim = &dav1d_txfm_dimensions[usize::from(sub)]; // `from` used instead of `into` for rust-analyzer type inference
let txsw = sub_t_dim.w as libc::c_int;
let txsh = sub_t_dim.h as libc::c_int;

Expand Down Expand Up @@ -1733,7 +1733,7 @@ unsafe fn read_vartx_tree(
[bh4 as usize, bw4 as usize],
[by4 as usize, bx4 as usize],
|case, (dir, dir_index)| {
case.set(&mut dir.tx.0, b_dim[2 + dir_index] as i8);
case.set(&mut dir.tx.0, b_dim[2 + dir_index]);
},
);
}
Expand Down Expand Up @@ -2854,8 +2854,7 @@ unsafe fn decode_b(
[bh4 as usize, bw4 as usize],
[by4 as usize, bx4 as usize],
|case, (dir, lw_lh, dir_index)| {
let lw_lh = lw_lh as i8;
case.set(&mut dir.tx_intra.0, lw_lh);
case.set(&mut dir.tx_intra.0, lw_lh as i8);
case.set(&mut dir.tx.0, lw_lh);
case.set(&mut dir.mode.0, y_mode_nofilt);
case.set(&mut dir.pal_sz.0, b.pal_sz()[0]);
Expand Down
2 changes: 1 addition & 1 deletion src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub struct BlockContext {
pub r#ref: Align8<[[int8_t; 32]; 2]>,
pub filter: Align8<[[uint8_t; 32]; 2]>,
pub tx_intra: Align8<[int8_t; 32]>,
pub tx: Align8<[int8_t; 32]>,
pub tx: Align8<[uint8_t; 32]>,
pub tx_lpf_y: Align8<[uint8_t; 32]>,
pub tx_lpf_uv: Align8<[uint8_t; 32]>,
pub partition: Align8<[uint8_t; 16]>,
Expand Down
4 changes: 2 additions & 2 deletions src/levels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub const OBU_META_ITUT_T35: ObuMetaType = 4;
pub const OBU_META_SCALABILITY: ObuMetaType = 3;
pub const OBU_META_HDR_MDCV: ObuMetaType = 2;
pub const OBU_META_HDR_CLL: ObuMetaType = 1;
pub type TxfmSize = i8;
pub type TxfmSize = u8;
pub const N_TX_SIZES: TxfmSize = 5;
pub const TX_64X64: TxfmSize = 4;
pub const TX_32X32: TxfmSize = 3;
Expand All @@ -25,7 +25,7 @@ pub const BL_16X16: BlockLevel = 3;
pub const BL_32X32: BlockLevel = 2;
pub const BL_64X64: BlockLevel = 1;
pub const BL_128X128: BlockLevel = 0;
pub type RectTxfmSize = i8;
pub type RectTxfmSize = u8;
pub const N_RECT_TX_SIZES: usize = 19;
pub const RTX_64X16: RectTxfmSize = 18;
pub const RTX_16X64: RectTxfmSize = 17;
Expand Down

0 comments on commit 695f058

Please sign in to comment.