ogl_beamforming

Ultrasound Beamforming Implemented with OpenGL
git clone anongit@rnpnr.xyz:ogl_beamforming.git
Log | Files | Refs | Feed | Submodules | LICENSE

Commit: 294d5ba945cb5b8cc057ad8f8da20729d6e731a9
Parent: 2d2482dfe5facc81627065c8eef99be9c274797b
Author: Randy Palamar
Date:   Sat,  7 Dec 2024 15:54:58 -0700

make output test dim consistent with stored frame dim

Diffstat:
Mbeamformer.c | 14++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/beamformer.c b/beamformer.c @@ -11,6 +11,17 @@ decoded_data_size(ComputeShaderCtx *cs) return result; } +static uv4 +make_valid_test_dim(uv4 in) +{ + uv4 result; + result.x = MAX(in.x, 1); + result.y = MAX(in.y, 1); + result.z = MAX(in.z, 1); + result.w = 1; + return result; +} + static void alloc_beamform_frame(GLParams *gp, BeamformFrame *out, uv4 out_dim, u32 frame_index, s8 name) { @@ -48,8 +59,7 @@ alloc_beamform_frame(GLParams *gp, BeamformFrame *out, uv4 out_dim, u32 frame_in static void alloc_output_image(BeamformerCtx *ctx, uv4 output_dim) { - uv4 try_dim = {.xyz = output_dim.xyz}; - try_dim.w = 1; + uv4 try_dim = make_valid_test_dim(output_dim); if (!uv4_equal(try_dim, ctx->averaged_frame.dim)) { alloc_beamform_frame(&ctx->gl, &ctx->averaged_frame, try_dim, 0, s8("Beamformed_Averaged_Data"));