mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 08:47:28 +01:00
std/xz: implement apply_filter_07_arm
This commit is contained in:
1 parent
764169165a
commit
af6c7b56af
6 files changed
+56
-6
No files matched your search
@@ -51,5 +51,30 @@ pri func decoder.apply_non_final_filters!(dst_slice: slice base.u8) base.u8,
|
||||
}
|
||||
|
||||
pri func decoder.apply_filter_07_arm!(dst_slice: slice base.u8) base.u8 {
|
||||
return 0
|
||||
var s : slice base.u8
|
||||
var p : base.u32
|
||||
var x : base.u32
|
||||
|
||||
s = args.dst_slice
|
||||
p = this.bcj_pos ~mod+ 8
|
||||
|
||||
while s.length() >= 4,
|
||||
post s.length() < 4,
|
||||
{
|
||||
if s[3] == 0xEB {
|
||||
x = ((s[0] as base.u32) << 0x00) |
|
||||
((s[1] as base.u32) << 0x08) |
|
||||
((s[2] as base.u32) << 0x10) |
|
||||
((s[3] as base.u32) << 0x18)
|
||||
x = (((x & 0xFF_FFFF) << 2) ~mod- p) >> 2
|
||||
s[0] = ((x >> 0x00) & 0xFF) as base.u8
|
||||
s[1] = ((x >> 0x08) & 0xFF) as base.u8
|
||||
s[2] = ((x >> 0x10) & 0xFF) as base.u8
|
||||
}
|
||||
p ~mod+= 4
|
||||
s = s[4 ..]
|
||||
} endwhile
|
||||
|
||||
this.bcj_pos = p ~mod- 8
|
||||
return s.length() as base.u8
|
||||
}
|
||||
@@ -44,11 +44,12 @@ pub struct decoder? implements base.io_transformer(
|
||||
|
||||
ignore_checksum : base.bool,
|
||||
|
||||
bcj_undo_index : base.u8,
|
||||
|
||||
block_has_compressed_size : base.bool,
|
||||
block_has_uncompressed_size : base.bool,
|
||||
|
||||
bcj_undo_index : base.u8,
|
||||
bcj_pos : base.u32,
|
||||
|
||||
block_compressed_size : base.u64,
|
||||
block_uncompressed_size : base.u64,
|
||||
|
||||
@@ -384,6 +385,7 @@ pri func decoder.decode_block_header_sans_padding?(src: base.io_reader) {
|
||||
|
||||
// Configure the non-final filters.
|
||||
|
||||
this.bcj_pos = 0
|
||||
choose apply_non_final_filters = [apply_non_final_filters]
|
||||
f = 0
|
||||
while f < this.num_non_final_filters {
|
||||
|
||||
Reference in new issue
Block a user