mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 08:38:14 +01:00
std/jpeg: implement block smoothing
"script/confirm-matches-djpeg.sh test/data/*.jpeg" is now all matches. name old speed new speed delta wuffs_jpeg_decode_19k_8bpp/clang11 369MB/s ± 0% 366MB/s ± 0% -0.79% (p=0.008 n=5+5) wuffs_jpeg_decode_30k_24bpp_progressive/clang11 335MB/s ± 0% 302MB/s ± 0% -9.93% (p=0.008 n=5+5) wuffs_jpeg_decode_30k_24bpp_sequential/clang11 1.01GB/s ± 0% 1.00GB/s ± 0% -1.07% (p=0.008 n=5+5) wuffs_jpeg_decode_77k_24bpp/clang11 829MB/s ± 0% 820MB/s ± 0% -1.03% (p=0.008 n=5+5) wuffs_jpeg_decode_552k_24bpp_420/clang11 903MB/s ± 0% 895MB/s ± 0% -0.93% (p=0.008 n=5+5) wuffs_jpeg_decode_552k_24bpp_444/clang11 1.12GB/s ± 0% 1.11GB/s ± 0% -1.28% (p=0.008 n=5+5) wuffs_jpeg_decode_4002k_24bpp/clang11 906MB/s ± 0% 897MB/s ± 0% -0.93% (p=0.008 n=5+5) wuffs_jpeg_decode_19k_8bpp/gcc10 350MB/s ± 0% 370MB/s ± 0% +5.54% (p=0.016 n=4+5) wuffs_jpeg_decode_30k_24bpp_progressive/gcc10 334MB/s ± 0% 309MB/s ± 0% -7.46% (p=0.008 n=5+5) wuffs_jpeg_decode_30k_24bpp_sequential/gcc10 924MB/s ± 0% 948MB/s ± 0% +2.61% (p=0.008 n=5+5) wuffs_jpeg_decode_77k_24bpp/gcc10 745MB/s ± 0% 769MB/s ± 0% +3.25% (p=0.008 n=5+5) wuffs_jpeg_decode_552k_24bpp_420/gcc10 813MB/s ± 0% 841MB/s ± 0% +3.41% (p=0.029 n=4+4) wuffs_jpeg_decode_552k_24bpp_444/gcc10 1.00GB/s ± 0% 1.00GB/s ± 0% +0.25% (p=0.029 n=4+4) wuffs_jpeg_decode_4002k_24bpp/gcc10 821MB/s ± 0% 846MB/s ± 0% +3.00% (p=0.008 n=5+5)
This commit is contained in:
1 parent
d60bfb05e8
commit
41d0c095c8
5 files changed
+1749
-35
No files matched your search
+93
-16
@@ -247,6 +247,11 @@ pub struct decoder? implements base.image_decoder(
|
||||
|
||||
mcu_previous_dc_values : array[4] base.u16,
|
||||
|
||||
block_smoothing_lowest_scan_al : array[4] array[10] base.u8[..= 16],
|
||||
block_smoothing_dc_values : array[5] array[5] base.u16,
|
||||
block_smoothing_mx_max_incl : base.u32[..= 0x1FFF],
|
||||
block_smoothing_my_max_incl : base.u32[..= 0x1FFF],
|
||||
|
||||
restart_interval : base.u16,
|
||||
saved_restart_interval : base.u16,
|
||||
restarts_remaining : base.u16,
|
||||
@@ -699,6 +704,18 @@ pri func decoder.decode_sof?(src: base.io_reader) {
|
||||
if this.sof_marker >= 0xC2 {
|
||||
// Pre-IDCT block coefficients (mcu_blocks elements) are 2 bytes each.
|
||||
progressive = 2
|
||||
|
||||
i = 0
|
||||
while i < 4 {
|
||||
j = 0
|
||||
while j < 10,
|
||||
inv i < 4,
|
||||
{
|
||||
this.block_smoothing_lowest_scan_al[i][j] = 16
|
||||
j += 1
|
||||
} endwhile
|
||||
i += 1
|
||||
} endwhile
|
||||
}
|
||||
|
||||
this.components_workbuf_offsets[0] = 0
|
||||
@@ -1252,10 +1269,11 @@ pri func decoder.decode_sos?(dst: ptr base.pixel_buffer, src: base.io_reader, wo
|
||||
}
|
||||
|
||||
pri func decoder.prepare_scan?(src: base.io_reader) {
|
||||
var c : base.u8
|
||||
var i : base.u32
|
||||
var j : base.u32
|
||||
var failed : base.bool
|
||||
var c : base.u8
|
||||
var i : base.u32
|
||||
var j : base.u32
|
||||
var j_max_incl : base.u32[..= 9]
|
||||
var failed : base.bool
|
||||
|
||||
if (this.payload_length < 6) or (this.payload_length > 12) {
|
||||
return "#bad SOS marker"
|
||||
@@ -1386,6 +1404,16 @@ pri func decoder.prepare_scan?(src: base.io_reader) {
|
||||
return "#missing Huffman table"
|
||||
}
|
||||
|
||||
j = this.scan_ss as base.u32
|
||||
j_max_incl = (this.scan_se.min(no_more_than: 9)) as base.u32
|
||||
while j <= j_max_incl,
|
||||
inv i < 4,
|
||||
{
|
||||
assert j <= 9 via "a <= b: a <= c; c <= b"(c: j_max_incl)
|
||||
this.block_smoothing_lowest_scan_al[this.scan_comps_cselector[i]][j] = this.scan_al
|
||||
j += 1
|
||||
} endwhile
|
||||
|
||||
i += 1
|
||||
} endwhile
|
||||
|
||||
@@ -1550,21 +1578,19 @@ pri func decoder.fill_bitstream!(src: base.io_reader) {
|
||||
this.bitstream_wi = wi
|
||||
}
|
||||
|
||||
pri func decoder.load_mcu_blocks_for_single_component!(mx: base.u32[..= 0x2000], my: base.u32[..= 0x2000], workbuf: slice base.u8, csel: base.u32[..= 3]) {
|
||||
pri func decoder.load_mcu_blocks_for_single_component!(mx: base.u32[..= 0x2000], my: base.u32[..= 0x2000], workbuf: slice base.u8, csel: base.u32[..= 3]),
|
||||
choosy,
|
||||
{
|
||||
var stride16 : base.u64[..= 0x10_0080]
|
||||
var offset : base.u64
|
||||
|
||||
// "while true" is redundant but minimizes the diff with load_mcu_blocks.
|
||||
while true {
|
||||
stride16 = (this.components_workbuf_widths[args.csel] * 16) as base.u64
|
||||
offset = this.components_workbuf_offsets[args.csel | 4] +
|
||||
((args.mx as base.u64) * 128) +
|
||||
((args.my as base.u64) * stride16)
|
||||
if offset <= args.workbuf.length() {
|
||||
this.mcu_blocks[.. 1].bulk_load_host_endian!(src: args.workbuf[offset ..])
|
||||
}
|
||||
break
|
||||
} endwhile
|
||||
stride16 = (this.components_workbuf_widths[args.csel] * 16) as base.u64
|
||||
offset = this.components_workbuf_offsets[args.csel | 4] +
|
||||
((args.mx as base.u64) * 128) +
|
||||
((args.my as base.u64) * stride16)
|
||||
if offset <= args.workbuf.length() {
|
||||
this.mcu_blocks[.. 1].bulk_load_host_endian!(src: args.workbuf[offset ..])
|
||||
}
|
||||
}
|
||||
|
||||
pri func decoder.load_mcu_blocks!(mx: base.u32[..= 0x2000], my: base.u32[..= 0x2000], workbuf: slice base.u8) {
|
||||
@@ -1674,6 +1700,8 @@ pri func decoder.skip_past_the_next_restart_marker?(src: base.io_reader) {
|
||||
pri func decoder.apply_progressive_idct!(workbuf: slice base.u8) {
|
||||
var csel : base.u32
|
||||
|
||||
var block_smoothing_applicable : base.bool
|
||||
|
||||
var scan_width_in_mcus : base.u32[..= 0x2000]
|
||||
var scan_height_in_mcus : base.u32[..= 0x2000]
|
||||
var mcu_blocks_mx_mul_0 : base.u32[..= 0x00_0020]
|
||||
@@ -1685,6 +1713,17 @@ pri func decoder.apply_progressive_idct!(workbuf: slice base.u8) {
|
||||
var stride : base.u64[..= 0x1_0008]
|
||||
var offset : base.u64
|
||||
|
||||
block_smoothing_applicable = true
|
||||
csel = 0
|
||||
while csel < this.num_components {
|
||||
assert csel < 4 via "a < b: a < c; c <= b"(c: this.num_components)
|
||||
if (this.block_smoothing_lowest_scan_al[csel][0] >= 16) or
|
||||
this.top_left_quants_has_zero(q: this.components_tq[csel] as base.u32) {
|
||||
block_smoothing_applicable = false
|
||||
}
|
||||
csel += 1
|
||||
} endwhile
|
||||
|
||||
csel = 0
|
||||
while csel < this.num_components {
|
||||
assert csel < 4 via "a < b: a < c; c <= b"(c: this.num_components)
|
||||
@@ -1697,6 +1736,25 @@ pri func decoder.apply_progressive_idct!(workbuf: slice base.u8) {
|
||||
mcu_blocks_mx_mul_0 = 8
|
||||
mcu_blocks_my_mul_0 = 8 * this.components_workbuf_widths[csel]
|
||||
|
||||
// For partially loaded progressive JPEGs, apply what libjpeg-turbo
|
||||
// calls "block smoothing".
|
||||
if block_smoothing_applicable and (0 <> (
|
||||
this.block_smoothing_lowest_scan_al[csel][1] |
|
||||
this.block_smoothing_lowest_scan_al[csel][2] |
|
||||
this.block_smoothing_lowest_scan_al[csel][3] |
|
||||
this.block_smoothing_lowest_scan_al[csel][4] |
|
||||
this.block_smoothing_lowest_scan_al[csel][5] |
|
||||
this.block_smoothing_lowest_scan_al[csel][6] |
|
||||
this.block_smoothing_lowest_scan_al[csel][8] |
|
||||
this.block_smoothing_lowest_scan_al[csel][8] |
|
||||
this.block_smoothing_lowest_scan_al[csel][9])) {
|
||||
choose load_mcu_blocks_for_single_component = [load_mcu_blocks_for_single_component_smooth]
|
||||
this.block_smoothing_mx_max_incl = scan_width_in_mcus ~sat- 1
|
||||
this.block_smoothing_my_max_incl = scan_height_in_mcus ~sat- 1
|
||||
} else {
|
||||
choose load_mcu_blocks_for_single_component = [load_mcu_blocks_for_single_component]
|
||||
}
|
||||
|
||||
// Apply IDCT to the MCU blocks in the csel'th component.
|
||||
my = 0
|
||||
while my < scan_height_in_mcus,
|
||||
@@ -1872,12 +1930,16 @@ pub func decoder.restart_frame!(index: base.u64, io_position: base.u64) base.sta
|
||||
if args.index <> 0 {
|
||||
return base."#bad argument"
|
||||
}
|
||||
|
||||
this.call_sequence = 0x28
|
||||
this.frame_config_io_position = args.io_position
|
||||
this.scan_count = 0
|
||||
this.restart_interval = this.saved_restart_interval
|
||||
|
||||
i = 0
|
||||
while i < 4 {
|
||||
this.seen_dqt[i] = this.saved_seen_dqt[i]
|
||||
j = 0
|
||||
while j < 64,
|
||||
inv i < 4,
|
||||
{
|
||||
@@ -1886,10 +1948,25 @@ pub func decoder.restart_frame!(index: base.u64, io_position: base.u64) base.sta
|
||||
} endwhile
|
||||
i += 1
|
||||
} endwhile
|
||||
|
||||
i = 0
|
||||
while i < 4 {
|
||||
j = 0
|
||||
while j < 10,
|
||||
inv i < 4,
|
||||
{
|
||||
this.block_smoothing_lowest_scan_al[i][j] = 16
|
||||
j += 1
|
||||
} endwhile
|
||||
i += 1
|
||||
} endwhile
|
||||
|
||||
i = 0
|
||||
while i < 8 {
|
||||
this.seen_dht[i] = false
|
||||
i += 1
|
||||
} endwhile
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,892 @@
|
||||
// Copyright 2023 The Wuffs Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// ----
|
||||
|
||||
// Consider the 8×8 = 64 coefficients (1 DC, 63 AC) in a block. The low
|
||||
// frequency ones are in the top-left corner and their offsets into the
|
||||
// this.mcu_blocks[0] array are:
|
||||
//
|
||||
// 0x00 0x01 0x02 0x03 .... .... .... .... // 0x00 is the DC coefficient.
|
||||
// 0x08 0x09 0x0A .... .... .... .... ....
|
||||
// 0x10 0x11 .... .... .... .... .... ....
|
||||
// 0x18 .... .... .... .... .... .... ....
|
||||
// .... .... .... .... .... .... .... ....
|
||||
// .... .... .... .... .... .... .... ....
|
||||
// .... .... .... .... .... .... .... ....
|
||||
// .... .... .... .... .... .... .... ....
|
||||
//
|
||||
// These are the first 10 coefficients (in zig-zag order), the 10 elements of
|
||||
// each this.block_smoothing_lowest_scan_al[csel] array:
|
||||
//
|
||||
// zig0 zig1 zig5 zig6 .... .... .... .... // zig0 is the DC coefficient.
|
||||
// zig2 zig4 zig7 .... .... .... .... ....
|
||||
// zig3 zig8 .... .... .... .... .... ....
|
||||
// zig9 .... .... .... .... .... .... ....
|
||||
// .... .... .... .... .... .... .... ....
|
||||
// .... .... .... .... .... .... .... ....
|
||||
// .... .... .... .... .... .... .... ....
|
||||
// .... .... .... .... .... .... .... ....
|
||||
|
||||
pri func decoder.top_left_quants_has_zero(q: base.u32[..= 3]) base.bool {
|
||||
// Examine the top-left 10 of the 8×8 = 64 quantization factors.
|
||||
return (this.quant_tables[args.q][0x00] == 0) or
|
||||
(this.quant_tables[args.q][0x01] == 0) or
|
||||
(this.quant_tables[args.q][0x02] == 0) or
|
||||
(this.quant_tables[args.q][0x03] == 0) or
|
||||
(this.quant_tables[args.q][0x08] == 0) or
|
||||
(this.quant_tables[args.q][0x09] == 0) or
|
||||
(this.quant_tables[args.q][0x0A] == 0) or
|
||||
(this.quant_tables[args.q][0x10] == 0) or
|
||||
(this.quant_tables[args.q][0x11] == 0) or
|
||||
(this.quant_tables[args.q][0x18] == 0)
|
||||
}
|
||||
|
||||
pri func decoder.load_mcu_blocks_for_single_component_smooth!(mx: base.u32[..= 0x2000], my: base.u32[..= 0x2000], workbuf: slice base.u8, csel: base.u32[..= 3]) {
|
||||
var stride16 : base.u64[..= 0x10_0080]
|
||||
var offset : base.u64
|
||||
|
||||
var dx : base.u32
|
||||
var dy : base.u32
|
||||
|
||||
var mx : base.u32[..= 0x1FFF]
|
||||
var my : base.u32[..= 0x1FFF]
|
||||
|
||||
var q : base.u8[..= 3]
|
||||
var q_00 : base.u32
|
||||
var q_xy : base.u32
|
||||
var al : base.u8[..= 16]
|
||||
var scratch : base.u32
|
||||
var limit : base.u32
|
||||
|
||||
stride16 = (this.components_workbuf_widths[args.csel] * 16) as base.u64
|
||||
offset = this.components_workbuf_offsets[args.csel | 4] +
|
||||
((args.mx as base.u64) * 128) +
|
||||
((args.my as base.u64) * stride16)
|
||||
if offset <= args.workbuf.length() {
|
||||
this.mcu_blocks[.. 1].bulk_load_host_endian!(src: args.workbuf[offset ..])
|
||||
}
|
||||
|
||||
dy = 0
|
||||
while dy < 5 {
|
||||
my = this.block_smoothing_my_max_incl.min(no_more_than: (args.my + dy) ~sat- 2)
|
||||
dx = 0
|
||||
while dx < 5,
|
||||
inv dy < 5,
|
||||
{
|
||||
mx = this.block_smoothing_mx_max_incl.min(no_more_than: (args.mx + dx) ~sat- 2)
|
||||
|
||||
offset = this.components_workbuf_offsets[args.csel | 4] +
|
||||
((mx as base.u64) * 128) +
|
||||
((my as base.u64) * stride16)
|
||||
if offset <= args.workbuf.length() {
|
||||
assert dx <= (dx + 1) via "a <= (a + b): 0 <= b"()
|
||||
this.block_smoothing_dc_values[dy][dx .. (dx + 1)].bulk_load_host_endian!(src: args.workbuf[offset ..])
|
||||
}
|
||||
|
||||
dx += 1
|
||||
} endwhile
|
||||
dy += 1
|
||||
} endwhile
|
||||
|
||||
q = this.components_tq[args.csel]
|
||||
q_00 = this.quant_tables[q][0x00] as base.u32
|
||||
if q_00 <= 0 {
|
||||
return nothing
|
||||
}
|
||||
|
||||
// See "Consider the 8×8" above.
|
||||
//
|
||||
// There are two sets of formulae, adjusting 10 or 5 coefficients:
|
||||
// - Major: 0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x10, 0x11, 0x18.
|
||||
// zig0, zig1, zig5, zig6, zig2, zig4, zig7, zig3, zig8, zig9.
|
||||
// - Minor: 0x01, 0x02, 0x08, 0x09, 0x10.
|
||||
// zig1, zig5, zig2, zig4, zig3.
|
||||
//
|
||||
// We only do major smoothing (including DC interpolation) if no AC
|
||||
// coefficients are available.
|
||||
if 0 <> (16 &
|
||||
this.block_smoothing_lowest_scan_al[args.csel][1] &
|
||||
this.block_smoothing_lowest_scan_al[args.csel][2] &
|
||||
this.block_smoothing_lowest_scan_al[args.csel][3] &
|
||||
this.block_smoothing_lowest_scan_al[args.csel][4] &
|
||||
this.block_smoothing_lowest_scan_al[args.csel][5] &
|
||||
this.block_smoothing_lowest_scan_al[args.csel][6] &
|
||||
this.block_smoothing_lowest_scan_al[args.csel][7] &
|
||||
this.block_smoothing_lowest_scan_al[args.csel][8] &
|
||||
this.block_smoothing_lowest_scan_al[args.csel][9]) {
|
||||
// Major smoothing.
|
||||
|
||||
// Offset=0x00 DC coefficient. Weights total to +256:
|
||||
//
|
||||
// -2 -6 -8 -6 -2
|
||||
// -6 +6 +42 +6 -6
|
||||
// -8 +42 +152 +42 -8
|
||||
// -6 +6 +42 +6 -6
|
||||
// -2 -6 -8 -6 -2
|
||||
if true {
|
||||
scratch = 0
|
||||
|
||||
scratch ~mod+= 0xFFFF_FFFE ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][0])
|
||||
scratch ~mod+= 0xFFFF_FFFA ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][1])
|
||||
scratch ~mod+= 0xFFFF_FFF8 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][2])
|
||||
scratch ~mod+= 0xFFFF_FFFA ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][3])
|
||||
scratch ~mod+= 0xFFFF_FFFE ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][4])
|
||||
|
||||
scratch ~mod+= 0xFFFF_FFFA ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][0])
|
||||
scratch ~mod+= 0x0000_0006 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][1])
|
||||
scratch ~mod+= 0x0000_002A ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][2])
|
||||
scratch ~mod+= 0x0000_0006 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][3])
|
||||
scratch ~mod+= 0xFFFF_FFFA ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][4])
|
||||
|
||||
scratch ~mod+= 0xFFFF_FFF8 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][0])
|
||||
scratch ~mod+= 0x0000_002A ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][1])
|
||||
scratch ~mod+= 0x0000_0098 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][2])
|
||||
scratch ~mod+= 0x0000_002A ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][3])
|
||||
scratch ~mod+= 0xFFFF_FFF8 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][4])
|
||||
|
||||
scratch ~mod+= 0xFFFF_FFFA ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][0])
|
||||
scratch ~mod+= 0x0000_0006 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][1])
|
||||
scratch ~mod+= 0x0000_002A ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][2])
|
||||
scratch ~mod+= 0x0000_0006 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][3])
|
||||
scratch ~mod+= 0xFFFF_FFFA ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][4])
|
||||
|
||||
scratch ~mod+= 0xFFFF_FFFE ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][0])
|
||||
scratch ~mod+= 0xFFFF_FFFA ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][1])
|
||||
scratch ~mod+= 0xFFFF_FFF8 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][2])
|
||||
scratch ~mod+= 0xFFFF_FFFA ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][3])
|
||||
scratch ~mod+= 0xFFFF_FFFE ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][4])
|
||||
|
||||
if scratch < 0x8000_0000 {
|
||||
scratch = 0 ~mod+ (((0 ~mod+ scratch) ~mod+ (1 << 7)) / (1 << 8))
|
||||
} else {
|
||||
scratch = 0 ~mod- (((0 ~mod- scratch) ~mod+ (1 << 7)) / (1 << 8))
|
||||
}
|
||||
this.mcu_blocks[0][0x00] = (scratch & 0xFFFF) as base.u16
|
||||
}
|
||||
|
||||
// Offset=0x01 AC coefficient. Weights total to zero:
|
||||
//
|
||||
// -1 -1 0 +1 +1
|
||||
// -3 +13 0 -13 +3
|
||||
// -3 +38 0 -38 +3
|
||||
// -3 +13 0 -13 +3
|
||||
// -1 -1 0 +1 +1
|
||||
q_xy = this.quant_tables[q][0x01] as base.u32
|
||||
if (q_xy > 0) and (this.mcu_blocks[0][0x01] == 0) {
|
||||
scratch = 0
|
||||
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][0])
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][2])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][3])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][4])
|
||||
|
||||
scratch ~mod+= 0xFFFF_FFFD ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][0])
|
||||
scratch ~mod+= 0x0000_000D ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][2])
|
||||
scratch ~mod+= 0xFFFF_FFF3 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][3])
|
||||
scratch ~mod+= 0x0000_0003 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][4])
|
||||
|
||||
scratch ~mod+= 0xFFFF_FFFD ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][0])
|
||||
scratch ~mod+= 0x0000_0026 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][2])
|
||||
scratch ~mod+= 0xFFFF_FFDA ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][3])
|
||||
scratch ~mod+= 0x0000_0003 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][4])
|
||||
|
||||
scratch ~mod+= 0xFFFF_FFFD ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][0])
|
||||
scratch ~mod+= 0x0000_000D ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][2])
|
||||
scratch ~mod+= 0xFFFF_FFF3 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][3])
|
||||
scratch ~mod+= 0x0000_0003 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][4])
|
||||
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][0])
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][2])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][3])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][4])
|
||||
|
||||
scratch ~mod*= q_00
|
||||
if scratch < 0x8000_0000 {
|
||||
scratch = 0 ~mod+ (((0 ~mod+ scratch) ~mod+ (q_xy << 7)) / (q_xy << 8))
|
||||
} else {
|
||||
scratch = 0 ~mod- (((0 ~mod- scratch) ~mod+ (q_xy << 7)) / (q_xy << 8))
|
||||
}
|
||||
this.mcu_blocks[0][0x01] = (scratch & 0xFFFF) as base.u16
|
||||
}
|
||||
|
||||
// Offset=0x02 AC coefficient. Weights total to zero:
|
||||
//
|
||||
// 0 0 0 0 0
|
||||
// 0 +2 -5 +2 0
|
||||
// +1 +7 -14 +7 +1
|
||||
// 0 +2 -5 +2 0
|
||||
// 0 0 0 0 0
|
||||
q_xy = this.quant_tables[q][0x02] as base.u32
|
||||
if (q_xy > 0) and (this.mcu_blocks[0][0x02] == 0) {
|
||||
scratch = 0
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][0])
|
||||
scratch ~mod+= 0x0000_0002 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][1])
|
||||
scratch ~mod+= 0xFFFF_FFFB ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][2])
|
||||
scratch ~mod+= 0x0000_0002 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][0])
|
||||
scratch ~mod+= 0x0000_0007 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][1])
|
||||
scratch ~mod+= 0xFFFF_FFF2 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][2])
|
||||
scratch ~mod+= 0x0000_0007 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][3])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][0])
|
||||
scratch ~mod+= 0x0000_0002 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][1])
|
||||
scratch ~mod+= 0xFFFF_FFFB ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][2])
|
||||
scratch ~mod+= 0x0000_0002 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][4])
|
||||
|
||||
scratch ~mod*= q_00
|
||||
if scratch < 0x8000_0000 {
|
||||
scratch = 0 ~mod+ (((0 ~mod+ scratch) ~mod+ (q_xy << 7)) / (q_xy << 8))
|
||||
} else {
|
||||
scratch = 0 ~mod- (((0 ~mod- scratch) ~mod+ (q_xy << 7)) / (q_xy << 8))
|
||||
}
|
||||
this.mcu_blocks[0][0x02] = (scratch & 0xFFFF) as base.u16
|
||||
}
|
||||
|
||||
// Offset=0x03 AC coefficient. Weights total to zero:
|
||||
//
|
||||
// 0 0 0 0 0
|
||||
// 0 +1 0 -1 0
|
||||
// 0 +2 0 -2 0
|
||||
// 0 +1 0 -1 0
|
||||
// 0 0 0 0 0
|
||||
q_xy = this.quant_tables[q][0x03] as base.u32
|
||||
if (q_xy > 0) and (this.mcu_blocks[0][0x03] == 0) {
|
||||
scratch = 0
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][0])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][2])
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][0])
|
||||
scratch ~mod+= 0x0000_0002 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][2])
|
||||
scratch ~mod+= 0xFFFF_FFFE ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][0])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][2])
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][4])
|
||||
|
||||
scratch ~mod*= q_00
|
||||
if scratch < 0x8000_0000 {
|
||||
scratch = 0 ~mod+ (((0 ~mod+ scratch) ~mod+ (q_xy << 7)) / (q_xy << 8))
|
||||
} else {
|
||||
scratch = 0 ~mod- (((0 ~mod- scratch) ~mod+ (q_xy << 7)) / (q_xy << 8))
|
||||
}
|
||||
this.mcu_blocks[0][0x03] = (scratch & 0xFFFF) as base.u16
|
||||
}
|
||||
|
||||
// Offset=0x08 AC coefficient. Weights total to zero:
|
||||
//
|
||||
// -1 -3 -3 -3 -1
|
||||
// -1 +13 +38 +13 -1
|
||||
// 0 0 0 0 0
|
||||
// +1 -13 -38 -13 +1
|
||||
// +1 +3 +3 +3 +1
|
||||
q_xy = this.quant_tables[q][0x08] as base.u32
|
||||
if (q_xy > 0) and (this.mcu_blocks[0][0x08] == 0) {
|
||||
scratch = 0
|
||||
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][0])
|
||||
scratch ~mod+= 0xFFFF_FFFD ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][1])
|
||||
scratch ~mod+= 0xFFFF_FFFD ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][2])
|
||||
scratch ~mod+= 0xFFFF_FFFD ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][3])
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][4])
|
||||
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][0])
|
||||
scratch ~mod+= 0x0000_000D ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][1])
|
||||
scratch ~mod+= 0x0000_0026 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][2])
|
||||
scratch ~mod+= 0x0000_000D ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][3])
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][0])
|
||||
scratch ~mod+= 0xFFFF_FFF3 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][1])
|
||||
scratch ~mod+= 0xFFFF_FFDA ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][2])
|
||||
scratch ~mod+= 0xFFFF_FFF3 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][3])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][0])
|
||||
scratch ~mod+= 0x0000_0003 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][1])
|
||||
scratch ~mod+= 0x0000_0003 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][2])
|
||||
scratch ~mod+= 0x0000_0003 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][3])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][4])
|
||||
|
||||
scratch ~mod*= q_00
|
||||
if scratch < 0x8000_0000 {
|
||||
scratch = 0 ~mod+ (((0 ~mod+ scratch) ~mod+ (q_xy << 7)) / (q_xy << 8))
|
||||
} else {
|
||||
scratch = 0 ~mod- (((0 ~mod- scratch) ~mod+ (q_xy << 7)) / (q_xy << 8))
|
||||
}
|
||||
this.mcu_blocks[0][0x08] = (scratch & 0xFFFF) as base.u16
|
||||
}
|
||||
|
||||
// Offset=0x09 AC coefficient. Weights total to zero:
|
||||
//
|
||||
// -1 0 0 0 +1
|
||||
// 0 +9 0 -9 0
|
||||
// 0 0 0 0 0
|
||||
// 0 -9 0 +9 0
|
||||
// +1 0 0 0 -1
|
||||
q_xy = this.quant_tables[q][0x09] as base.u32
|
||||
if (q_xy > 0) and (this.mcu_blocks[0][0x09] == 0) {
|
||||
scratch = 0
|
||||
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][3])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][0])
|
||||
scratch ~mod+= 0x0000_0009 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][2])
|
||||
scratch ~mod+= 0xFFFF_FFF7 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][0])
|
||||
scratch ~mod+= 0xFFFF_FFF7 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][2])
|
||||
scratch ~mod+= 0x0000_0009 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][3])
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][4])
|
||||
|
||||
scratch ~mod*= q_00
|
||||
if scratch < 0x8000_0000 {
|
||||
scratch = 0 ~mod+ (((0 ~mod+ scratch) ~mod+ (q_xy << 7)) / (q_xy << 8))
|
||||
} else {
|
||||
scratch = 0 ~mod- (((0 ~mod- scratch) ~mod+ (q_xy << 7)) / (q_xy << 8))
|
||||
}
|
||||
this.mcu_blocks[0][0x09] = (scratch & 0xFFFF) as base.u16
|
||||
}
|
||||
|
||||
// Offset=0x0A AC coefficient. Weights total to zero:
|
||||
//
|
||||
// 0 0 0 0 0
|
||||
// 0 +1 -3 +1 0
|
||||
// 0 0 0 0 0
|
||||
// 0 -1 +3 -1 0
|
||||
// 0 0 0 0 0
|
||||
q_xy = this.quant_tables[q][0x0A] as base.u32
|
||||
if (q_xy > 0) and (this.mcu_blocks[0][0x0A] == 0) {
|
||||
scratch = 0
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][0])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][1])
|
||||
scratch ~mod+= 0xFFFF_FFFD ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][2])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][0])
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][1])
|
||||
scratch ~mod+= 0x0000_0003 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][2])
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][4])
|
||||
|
||||
scratch ~mod*= q_00
|
||||
if scratch < 0x8000_0000 {
|
||||
scratch = 0 ~mod+ (((0 ~mod+ scratch) ~mod+ (q_xy << 7)) / (q_xy << 8))
|
||||
} else {
|
||||
scratch = 0 ~mod- (((0 ~mod- scratch) ~mod+ (q_xy << 7)) / (q_xy << 8))
|
||||
}
|
||||
this.mcu_blocks[0][0x0A] = (scratch & 0xFFFF) as base.u16
|
||||
}
|
||||
|
||||
// Offset=0x10 AC coefficient. Weights total to zero:
|
||||
//
|
||||
// 0 0 +1 0 0
|
||||
// 0 +2 +7 +2 0
|
||||
// 0 -5 -14 -5 0
|
||||
// 0 +2 +7 +2 0
|
||||
// 0 0 +1 0 0
|
||||
q_xy = this.quant_tables[q][0x10] as base.u32
|
||||
if (q_xy > 0) and (this.mcu_blocks[0][0x10] == 0) {
|
||||
scratch = 0
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][1])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][0])
|
||||
scratch ~mod+= 0x0000_0002 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][1])
|
||||
scratch ~mod+= 0x0000_0007 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][2])
|
||||
scratch ~mod+= 0x0000_0002 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][0])
|
||||
scratch ~mod+= 0xFFFF_FFFB ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][1])
|
||||
scratch ~mod+= 0xFFFF_FFF2 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][2])
|
||||
scratch ~mod+= 0xFFFF_FFFB ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][0])
|
||||
scratch ~mod+= 0x0000_0002 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][1])
|
||||
scratch ~mod+= 0x0000_0007 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][2])
|
||||
scratch ~mod+= 0x0000_0002 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][1])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][4])
|
||||
|
||||
scratch ~mod*= q_00
|
||||
if scratch < 0x8000_0000 {
|
||||
scratch = 0 ~mod+ (((0 ~mod+ scratch) ~mod+ (q_xy << 7)) / (q_xy << 8))
|
||||
} else {
|
||||
scratch = 0 ~mod- (((0 ~mod- scratch) ~mod+ (q_xy << 7)) / (q_xy << 8))
|
||||
}
|
||||
this.mcu_blocks[0][0x10] = (scratch & 0xFFFF) as base.u16
|
||||
}
|
||||
|
||||
// Offset=0x11 AC coefficient. Weights total to zero:
|
||||
//
|
||||
// 0 0 0 0 0
|
||||
// 0 +1 0 -1 0
|
||||
// 0 -3 0 +3 0
|
||||
// 0 +1 0 -1 0
|
||||
// 0 0 0 0 0
|
||||
q_xy = this.quant_tables[q][0x11] as base.u32
|
||||
if (q_xy > 0) and (this.mcu_blocks[0][0x11] == 0) {
|
||||
scratch = 0
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][0])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][2])
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][0])
|
||||
scratch ~mod+= 0xFFFF_FFFD ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][2])
|
||||
scratch ~mod+= 0x0000_0003 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][0])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][2])
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][4])
|
||||
|
||||
scratch ~mod*= q_00
|
||||
if scratch < 0x8000_0000 {
|
||||
scratch = 0 ~mod+ (((0 ~mod+ scratch) ~mod+ (q_xy << 7)) / (q_xy << 8))
|
||||
} else {
|
||||
scratch = 0 ~mod- (((0 ~mod- scratch) ~mod+ (q_xy << 7)) / (q_xy << 8))
|
||||
}
|
||||
this.mcu_blocks[0][0x11] = (scratch & 0xFFFF) as base.u16
|
||||
}
|
||||
|
||||
// Offset=0x18 AC coefficient. Weights total to zero:
|
||||
//
|
||||
// 0 0 0 0 0
|
||||
// 0 +1 +2 +1 0
|
||||
// 0 0 0 0 0
|
||||
// 0 -1 -2 -1 0
|
||||
// 0 0 0 0 0
|
||||
q_xy = this.quant_tables[q][0x18] as base.u32
|
||||
if (q_xy > 0) and (this.mcu_blocks[0][0x18] == 0) {
|
||||
scratch = 0
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][0])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][1])
|
||||
scratch ~mod+= 0x0000_0002 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][2])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][0])
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][1])
|
||||
scratch ~mod+= 0xFFFF_FFFE ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][2])
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][4])
|
||||
|
||||
scratch ~mod*= q_00
|
||||
if scratch < 0x8000_0000 {
|
||||
scratch = 0 ~mod+ (((0 ~mod+ scratch) ~mod+ (q_xy << 7)) / (q_xy << 8))
|
||||
} else {
|
||||
scratch = 0 ~mod- (((0 ~mod- scratch) ~mod+ (q_xy << 7)) / (q_xy << 8))
|
||||
}
|
||||
this.mcu_blocks[0][0x18] = (scratch & 0xFFFF) as base.u16
|
||||
}
|
||||
|
||||
} else {
|
||||
// Minor smoothing.
|
||||
|
||||
// Offset=0x01 AC coefficient. Weights total to zero:
|
||||
//
|
||||
// 0 0 0 0 0
|
||||
// 0 0 0 0 0
|
||||
// -7 +50 0 -50 +7
|
||||
// 0 0 0 0 0
|
||||
// 0 0 0 0 0
|
||||
al = this.block_smoothing_lowest_scan_al[args.csel][1]
|
||||
q_xy = this.quant_tables[q][0x01] as base.u32
|
||||
if (al > 0) and (q_xy > 0) and (this.mcu_blocks[0][0x01] == 0) {
|
||||
limit = ((1 as base.u32) << al) - 1
|
||||
scratch = 0
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][4])
|
||||
|
||||
scratch ~mod+= 0xFFFF_FFF9 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][0])
|
||||
scratch ~mod+= 0x0000_0032 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][2])
|
||||
scratch ~mod+= 0xFFFF_FFCE ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][3])
|
||||
scratch ~mod+= 0x0000_0007 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][4])
|
||||
|
||||
scratch ~mod*= q_00
|
||||
if scratch < 0x8000_0000 {
|
||||
scratch = 0 ~mod+ limit.min(no_more_than: (((0 ~mod+ scratch) ~mod+ (q_xy << 7)) / (q_xy << 8)))
|
||||
} else {
|
||||
scratch = 0 ~mod- limit.min(no_more_than: (((0 ~mod- scratch) ~mod+ (q_xy << 7)) / (q_xy << 8)))
|
||||
}
|
||||
this.mcu_blocks[0][0x01] = (scratch & 0xFFFF) as base.u16
|
||||
}
|
||||
|
||||
// Offset=0x02 AC coefficient. Weights total to zero:
|
||||
//
|
||||
// 0 0 0 0 0
|
||||
// 0 0 0 0 0
|
||||
// -1 +13 -24 +13 -1
|
||||
// 0 0 0 0 0
|
||||
// 0 0 0 0 0
|
||||
al = this.block_smoothing_lowest_scan_al[args.csel][5]
|
||||
q_xy = this.quant_tables[q][0x02] as base.u32
|
||||
if (al > 0) and (q_xy > 0) and (this.mcu_blocks[0][0x02] == 0) {
|
||||
limit = ((1 as base.u32) << al) - 1
|
||||
scratch = 0
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][4])
|
||||
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][0])
|
||||
scratch ~mod+= 0x0000_000D ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][1])
|
||||
scratch ~mod+= 0xFFFF_FFE8 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][2])
|
||||
scratch ~mod+= 0x0000_000D ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][3])
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][4])
|
||||
|
||||
scratch ~mod*= q_00
|
||||
if scratch < 0x8000_0000 {
|
||||
scratch = 0 ~mod+ limit.min(no_more_than: (((0 ~mod+ scratch) ~mod+ (q_xy << 7)) / (q_xy << 8)))
|
||||
} else {
|
||||
scratch = 0 ~mod- limit.min(no_more_than: (((0 ~mod- scratch) ~mod+ (q_xy << 7)) / (q_xy << 8)))
|
||||
}
|
||||
this.mcu_blocks[0][0x02] = (scratch & 0xFFFF) as base.u16
|
||||
}
|
||||
|
||||
// Offset=0x08 AC coefficient. Weights total to zero:
|
||||
//
|
||||
// 0 0 -7 0 0
|
||||
// 0 0 +50 0 0
|
||||
// 0 0 0 0 0
|
||||
// 0 0 -50 0 0
|
||||
// 0 0 +7 0 0
|
||||
al = this.block_smoothing_lowest_scan_al[args.csel][2]
|
||||
q_xy = this.quant_tables[q][0x08] as base.u32
|
||||
if (al > 0) and (q_xy > 0) and (this.mcu_blocks[0][0x08] == 0) {
|
||||
limit = ((1 as base.u32) << al) - 1
|
||||
scratch = 0
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][1])
|
||||
scratch ~mod+= 0xFFFF_FFF9 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][1])
|
||||
scratch ~mod+= 0x0000_0032 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][1])
|
||||
scratch ~mod+= 0xFFFF_FFCE ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][1])
|
||||
scratch ~mod+= 0x0000_0007 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][4])
|
||||
|
||||
scratch ~mod*= q_00
|
||||
if scratch < 0x8000_0000 {
|
||||
scratch = 0 ~mod+ limit.min(no_more_than: (((0 ~mod+ scratch) ~mod+ (q_xy << 7)) / (q_xy << 8)))
|
||||
} else {
|
||||
scratch = 0 ~mod- limit.min(no_more_than: (((0 ~mod- scratch) ~mod+ (q_xy << 7)) / (q_xy << 8)))
|
||||
}
|
||||
this.mcu_blocks[0][0x08] = (scratch & 0xFFFF) as base.u16
|
||||
}
|
||||
|
||||
// Offset=0x09 AC coefficient. Weights total to zero:
|
||||
//
|
||||
// 0 -1 0 +1 0
|
||||
// -1 +10 0 -10 +1
|
||||
// 0 0 0 0 0
|
||||
// +1 -10 0 +10 -1
|
||||
// 0 +1 0 -1 0
|
||||
al = this.block_smoothing_lowest_scan_al[args.csel][4]
|
||||
q_xy = this.quant_tables[q][0x09] as base.u32
|
||||
if (al > 0) and (q_xy > 0) and (this.mcu_blocks[0][0x09] == 0) {
|
||||
limit = ((1 as base.u32) << al) - 1
|
||||
scratch = 0
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][0])
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][2])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][4])
|
||||
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][0])
|
||||
scratch ~mod+= 0x0000_000A ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][2])
|
||||
scratch ~mod+= 0xFFFF_FFF6 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][3])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][0])
|
||||
scratch ~mod+= 0xFFFF_FFF6 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][2])
|
||||
scratch ~mod+= 0x0000_000A ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][3])
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][0])
|
||||
scratch ~mod+= 0x0000_0001 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][1])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][2])
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][4])
|
||||
|
||||
scratch ~mod*= q_00
|
||||
if scratch < 0x8000_0000 {
|
||||
scratch = 0 ~mod+ limit.min(no_more_than: (((0 ~mod+ scratch) ~mod+ (q_xy << 7)) / (q_xy << 8)))
|
||||
} else {
|
||||
scratch = 0 ~mod- limit.min(no_more_than: (((0 ~mod- scratch) ~mod+ (q_xy << 7)) / (q_xy << 8)))
|
||||
}
|
||||
this.mcu_blocks[0][0x09] = (scratch & 0xFFFF) as base.u16
|
||||
}
|
||||
|
||||
// Offset=0x10 AC coefficient. Weights total to zero:
|
||||
//
|
||||
// 0 0 -1 0 0
|
||||
// 0 0 +13 0 0
|
||||
// 0 0 -24 0 0
|
||||
// 0 0 +13 0 0
|
||||
// 0 0 -1 0 0
|
||||
al = this.block_smoothing_lowest_scan_al[args.csel][3]
|
||||
q_xy = this.quant_tables[q][0x10] as base.u32
|
||||
if (al > 0) and (q_xy > 0) and (this.mcu_blocks[0][0x10] == 0) {
|
||||
limit = ((1 as base.u32) << al) - 1
|
||||
scratch = 0
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][1])
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[0][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][1])
|
||||
scratch ~mod+= 0x0000_000D ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[1][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][1])
|
||||
scratch ~mod+= 0xFFFF_FFE8 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[2][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][1])
|
||||
scratch ~mod+= 0x0000_000D ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[3][4])
|
||||
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][0])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][1])
|
||||
scratch ~mod+= 0xFFFF_FFFF ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][2])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][3])
|
||||
scratch ~mod+= 0x0000_0000 ~mod* this.util.sign_extend_convert_u16_u32(a: this.block_smoothing_dc_values[4][4])
|
||||
|
||||
scratch ~mod*= q_00
|
||||
if scratch < 0x8000_0000 {
|
||||
scratch = 0 ~mod+ limit.min(no_more_than: (((0 ~mod+ scratch) ~mod+ (q_xy << 7)) / (q_xy << 8)))
|
||||
} else {
|
||||
scratch = 0 ~mod- limit.min(no_more_than: (((0 ~mod- scratch) ~mod+ (q_xy << 7)) / (q_xy << 8)))
|
||||
}
|
||||
this.mcu_blocks[0][0x10] = (scratch & 0xFFFF) as base.u16
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user