Skip to content

pshell Test dev branch 06/12/26#34

Open
develone wants to merge 79 commits into
lurk101:masterfrom
develone:test-dev
Open

pshell Test dev branch 06/12/26#34
develone wants to merge 79 commits into
lurk101:masterfrom
develone:test-dev

Conversation

@develone

Copy link
Copy Markdown

I have been working for many years trying to get the openjpeg jpeg 2000 running on various hardware. First in bare metal using Lazarus IDE ultibo edition
https://github.com/develone/Ultibo_Projects/tree/master/jpeg2000 several years. Recently I was able to get this running on Raspberry Pi4.
The Raspberry Pi4 code is found at https://github.com/develone/dwtlift-pi. Now I am starting the https://github.com/develone/pshell/tree/test-dev branch.
This documents the current status of adding the 20 plus C files and header files https://github.com/develone/pshell/blob/test-dev/doc/notes-testing-adding-dwtlift.txt
Base on current tests it might be more of task, since it appears the pshell file system is Big Endian.

Pico Shell , LittleFS v2.9, Vi 0.9.1, SDK v2.0.0
The version of uf2-files/pico/pshell.uf2
Pico Shell , LittleFS v2.9, Vi 0.9.1, SDK v1.5.1
Thanks. I've made the recommended changes in the dev branch. See commit 098a68c
Can you verify that I got it right? I currently don't have an RP2040 set up for testing.
        4 features found.
Feature #0:  (37.000000,29.000000) with value of 19844
Feature lurk101#1:  (28.000000,39.000000) with value of 9270
Feature lurk101#2:  (24.000000,29.000000) with value of 4393
Feature lurk101#3:  (38.000000,39.000000) with value of 465
Feature lurk101#4:  (-1.000000,-1.000000) with value of -1
Feature lurk101#5:  (-1.000000,-1.000000) with value of -1
Feature lurk101#6:  (-1.000000,-1.000000) with value of -1
Feature lurk101#7:  (-1.000000,-1.000000) with value of -1
Feature lurk101#8:  (-1.000000,-1.000000) with value of -1
Feature lurk101#9:  (-1.000000,-1.000000) with value of -1
Feature lurk101#10:  (-1.000000,-1.000000) with value of -1
Feature lurk101#11:  (-1.000000,-1.000000) with value of -1
Feature lurk101#12:  (-1.000000,-1.000000) with value of -1
Feature lurk101#13:  (-1.000000,-1.000000) with value of -1
Feature lurk101#14:  (-1.000000,-1.000000) with value of -1
Feature lurk101#15:  (-1.000000,-1.000000) with value of -1
Feature lurk101#16:  (-1.000000,-1.000000) with value of -1
Feature lurk101#17:  (-1.000000,-1.000000) with value of -1
Feature lurk101#18:  (-1.000000,-1.000000) with value of -1
Feature lurk101#19:  (-1.000000,-1.000000) with value of -1
Feature lurk101#20:  (-1.000000,-1.000000) with value of -1
Feature lurk101#21:  (-1.000000,-1.000000) with value of -1
Feature lurk101#22:  (-1.000000,-1.000000) with value of -1
Feature lurk101#23:  (-1.000000,-1.000000) with value of -1
Feature lurk101#24:  (-1.000000,-1.000000) with value of -1
Feature lurk101#25:  (-1.000000,-1.000000) with value of -1
Feature lurk101#26:  (-1.000000,-1.000000) with value of -1
Feature lurk101#27:  (-1.000000,-1.000000) with value of -1
Feature lurk101#28:  (-1.000000,-1.000000) with value of -1
Feature lurk101#29:  (-1.000000,-1.000000) with value of -1
Feature lurk101#30:  (-1.000000,-1.000000) with value of -1
Feature lurk101#31:  (-1.000000,-1.000000) with value of -1
Feature lurk101#32:  (-1.000000,-1.000000) with value of -1
Feature lurk101#33:  (-1.000000,-1.000000) with value of -1
Feature lurk101#34:  (-1.000000,-1.000000) with value of -1
Feature #35:  (-1.000000,-1.000000) with value of -1
Feature #36:  (-1.000000,-1.000000) with value of -1
Feature #37:  (-1.000000,-1.000000) with value of -1
Feature #38:  (-1.000000,-1.000000) with value of -1
Feature #39:  (-1.000000,-1.000000) with value of -1
Feature #40:  (-1.000000,-1.000000) with value of -1
Feature #41:  (-1.000000,-1.000000) with value of -1
Feature #42:  (-1.000000,-1.000000) with value of -1
Feature #43:  (-1.000000,-1.000000) with value of -1
Feature #44:  (-1.000000,-1.000000) with value of -1
Feature #45:  (-1.000000,-1.000000) with value of -1
Feature #46:  (-1.000000,-1.000000) with value of -1
Feature #47:  (-1.000000,-1.000000) with value of -1
Feature #48:  (-1.000000,-1.000000) with value of -1
Feature #49:  (-1.000000,-1.000000) with value of -1
Feature #50:  (-1.000000,-1.000000) with value of -1
Feature #51:  (-1.000000,-1.000000) with value of -1
Feature #52:  (-1.000000,-1.000000) with value of -1
Feature #53:  (-1.000000,-1.000000) with value of -1
Feature #54:  (-1.000000,-1.000000) with value of -1
Feature #55:  (-1.000000,-1.000000) with value of -1
Feature #56:  (-1.000000,-1.000000) with value of -1
Feature #57:  (-1.000000,-1.000000) with value of -1
Feature #58:  (-1.000000,-1.000000) with value of -1
Feature #59:  (-1.000000,-1.000000) with value of -1
Feature #60:  (-1.000000,-1.000000) with value of -1
Feature #61:  (-1.000000,-1.000000) with value of -1
Feature #62:  (-1.000000,-1.000000) with value of -1
Feature #63:  (-1.000000,-1.000000) with value of -1
Feature #64:  (-1.000000,-1.000000) with value of -1
Feature #65:  (-1.000000,-1.000000) with value of -1
Feature #66:  (-1.000000,-1.000000) with value of -1
Feature #67:  (-1.000000,-1.000000) with value of -1
Feature #68:  (-1.000000,-1.000000) with value of -1
Feature #69:  (-1.000000,-1.000000) with value of -1
Feature #70:  (-1.000000,-1.000000) with value of -1
Feature #71:  (-1.000000,-1.000000) with value of -1
Feature #72:  (-1.000000,-1.000000) with value of -1
Feature #73:  (-1.000000,-1.000000) with value of -1
Feature #74:  (-1.000000,-1.000000) with value of -1
Feature #75:  (-1.000000,-1.000000) with value of -1
Feature #76:  (-1.000000,-1.000000) with value of -1
Feature #77:  (-1.000000,-1.000000) with value of -1
Feature #78:  (-1.000000,-1.000000) with value of -1
Feature #79:  (-1.000000,-1.000000) with value of -1
Feature #80:  (-1.000000,-1.000000) with value of -1
Feature #81:  (-1.000000,-1.000000) with value of -1
Feature #82:  (-1.000000,-1.000000) with value of -1
Feature #83:  (-1.000000,-1.000000) with value of -1
Feature #84:  (-1.000000,-1.000000) with value of -1
Feature #85:  (-1.000000,-1.000000) with value of -1
Feature #86:  (-1.000000,-1.000000) with value of -1
Feature #87:  (-1.000000,-1.000000) with value of -1
Feature #88:  (-1.000000,-1.000000) with value of -1
Feature #89:  (-1.000000,-1.000000) with value of -1
Feature #90:  (-1.000000,-1.000000) with value of -1
Feature #91:  (-1.000000,-1.000000) with value of -1
Feature #92:  (-1.000000,-1.000000) with value of -1
Feature #93:  (-1.000000,-1.000000) with value of -1
Feature #94:  (-1.000000,-1.000000) with value of -1
Feature #95:  (-1.000000,-1.000000) with value of -1
Feature #96:  (-1.000000,-1.000000) with value of -1
Feature #97:  (-1.000000,-1.000000) with value of -1
Feature #98:  (-1.000000,-1.000000) with value of -1
Feature #99:  (-1.000000,-1.000000) with value of -1
pshell (void *pvParameters)
{
  while (true)
    {
      //printf("This is a place holder for the pshell task\n");
      while (run)
	{
	  printf ("%s: ", full_path (""));
	  fflush (stdout);
	  parse_cmd ();
	  bool found = false;
	  int i;
	  result[0] = 0;
	  if (argc)
	    for (i = 0; i < sizeof cmd_table / sizeof cmd_table[0]; i++)
	      if (strcmp (argv[0], cmd_table[i].name) == 0)
		{
		  cmd_table[i].func ();
		  printf ("%d %s %s\n", i, cmd_table[i].name,
			  cmd_table[i].descr);
		  found = true;
		  break;
		}
	  if (!found)
	    {
	      if (argc)
		printf ("command unknown!\n\n");
	      for (int i = 0; i < sizeof cmd_table / sizeof cmd_table[0]; i++)
		printf ("%7s - %s\n", cmd_table[i].name, cmd_table[i].descr);
	      printf ("\n");
	      continue;
	    }
	  printf ("%s\n", result);
	}
      vTaskDelay (35000);
    }
}

devel@pi5-80:~/test-build-pshell/pshell/build-rp2350 $ make
[  1%] Built target bs2_default
[  3%] Built target bs2_default_library
[  4%] Building C object CMakeFiles/pshell.dir/shell.c.o
/home/devel/test-build-pshell/pshell/shell.c: In function 'pshell':
/home/devel/test-build-pshell/pshell/shell.c:1254:7: warning: implicit declaration of function 'vTaskDelay' [-Wimplicit-function-declaration]
 1254 |       vTaskDelay (35000);
      |       ^~~~~~~~~~
In file included from /home/devel/test-build-pshell/pshell/shell.c:31:
/home/devel/test-build-pshell/pshell/comprogs.h: At top level:
/home/devel/test-build-pshell/pshell/comprogs.h:57:17: warning: array 'a' assumed to have one element
   57 | const short int a[];
      |                 ^
[  5%] Linking CXX executable pshell.elf
[100%] Built target pshell

devel@pi5-80:~/test-build-pshell/pshell/build-rp2040 $ make
[  1%] Built target bs2_default
[  3%] Built target bs2_default_library
[  3%] Building C object CMakeFiles/pshell.dir/shell.c.o
/home/devel/test-build-pshell/pshell/shell.c: In function 'pshell':
/home/devel/test-build-pshell/pshell/shell.c:1254:7: warning: implicit declaration of function 'vTaskDelay' [-Wimplicit-function-declaration]
 1254 |       vTaskDelay (35000);
      |       ^~~~~~~~~~
In file included from /home/devel/test-build-pshell/pshell/shell.c:31:
/home/devel/test-build-pshell/pshell/comprogs.h: At top level:
/home/devel/test-build-pshell/pshell/comprogs.h:57:17: warning: array 'a' assumed to have one element
   57 | const short int a[];
      |                 ^
[  4%] Linking CXX executable pshell.elf
[100%] Built target pshell
Open On-Chip Debugger 0.11.0-g8e3c38f-dirty (2024-11-06-20:01)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz

Info : Hardware thread awareness created
Info : Hardware thread awareness created
Info : RP2040 Flash Bank Command
Info : BCM2835 GPIO JTAG/SWD bitbang driver
Info : clock speed 1001 kHz
Info : SWD DPIDR 0x0bc12477
Info : SWD DLPIDR 0x00000001
Info : SWD DPIDR 0x0bc12477
Info : SWD DLPIDR 0x10000001
Info : rp2040.core0: hardware has 4 breakpoints, 2 watchpoints
Info : rp2040.core1: hardware has 4 breakpoints, 2 watchpoints
Info : starting gdb server for rp2040.core0 on 3333
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0x000000ea msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0x000000ea msp: 0x20041f00
** Programming Started **
Info : RP2040 B0 Flash Probe: 2097152 bytes @10000000, in 512 sectors

target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
Info : Writing 258048 bytes starting at 0x0
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
** Programming Finished **
** Verify Started **
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000184 msp: 0x20041f00
** Verified OK **
** Resetting Target **
shutdown command invoked
          openjpeg-lib/dwt.h
          openjpeg-lib/image.c
          openjpeg-lib/j2k.c
          openjpeg-lib/j2k.h
          openjpeg-lib/jp2.c
          openjpeg-lib/jp2.h
          openjpeg-lib/mct.c
          openjpeg-lib/mct.h
          openjpeg-lib/mqc.c
          openjpeg-lib/mqc.h
          openjpeg-lib/mqc_inl.h
          openjpeg-lib/openjpeg.c
          openjpeg-lib/openjpeg.h
          openjpeg-lib/opj_codec.h
          openjpeg-lib/opj_includes.h
          openjpeg-lib/opj_intmath.h
          openjpeg-lib/pi.c
          openjpeg-lib/t1.c
          openjpeg-lib/t1.h
          openjpeg-lib/t2.c
          openjpeg-lib/t2.h
          openjpeg-lib/tcd.c
          openjpeg-lib/tcd.h
          openjpeg-lib/thread.c
          openjpeg-lib/dwtlift.c
          openjpeg-lib/dwtlift.h
target_link_libraries(${PSHELL} PUBLIC
    littlefs disassembler io vi cc misc xymodem
    pico_stdlib pico_rand
    hardware_flash hardware_sync hardware_watchdog hardware_timer hardware_gpio
    hardware_pwm hardware_adc hardware_clocks hardware_uart hardware_i2c
    hardware_spi hardware_irq hardware_dma hardware_uart lifting klt openjpeg)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5176e80..6f35b2f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,7 +75,7 @@ target_link_libraries(${PSHELL} PUBLIC
     pico_stdlib pico_rand
     hardware_flash hardware_sync hardware_watchdog hardware_timer hardware_gpio
     hardware_pwm hardware_adc hardware_clocks hardware_uart hardware_i2c
-    hardware_spi hardware_irq hardware_dma hardware_uart lifting klt)
+    hardware_spi hardware_irq hardware_dma hardware_uart lifting klt openjpeg)

 pico_add_extra_outputs(${PSHELL})
-rw-r--r-- 1 devel devel 498176 Jun 11 18:25 pshell.uf2
index 2cca551..361882b 100644
--- a/shell.c
+++ b/shell.c
@@ -533,18 +533,24 @@ P5
   fs_file_close (&out);
 }

-
+
 static void
 j2k_cmd (void)
 {
   if (check_mount (true))
     return;
-       //in_fname is passed as argv[1]
-       //out_fname is passed as argv[2]
-       //Compression Ratio
-       //Compress DeCompress
-       printf ("%d in_fname = %s out_fname = %s CR %d C/D = %d \n", argc, argv[1], argv[2], atoi(argv[3]), atoi(argv[4]));
-//lfsfile_close (&in);
+    int da_x0, da_y0, da_x1, da_y1;
+    char ff[20]="test.j2k";
+
+    da_x0 = 0;
+    da_y0 = 0;
+    da_x1 = 256;
+    da_y1= 256;
+    printf("da_xo %d da_y0 %d\n",da_x0,da_y0);
+    printf("da_x1 %d da_y1 %d ff %s\n",da_x1,da_y1,ff);
+    //decom_test(da_x0,da_y0,da_x1,da_y1,ff);
+
+
 }

devel@pi5-70:~/pshell/build $ ../cmpico
Using PICO_SDK_PATH from environment ('/home/devel/pico2/pico-sdk')
PICO_SDK_PATH is /home/devel/pico2/pico-sdk
Target board (PICO_BOARD) is 'pico'.
Using board configuration from /home/devel/pico2/pico-sdk/src/boards/include/boards/pico.h
Pico Platform (PICO_PLATFORM) is 'rp2040'.
-- Defaulting build type to 'Release' since not specified.
Defaulting compiler (PICO_COMPILER) to 'pico_arm_cortex_m0plus_gcc' since not specified.
Configuring toolchain based on PICO_COMPILER 'pico_arm_cortex_m0plus_gcc'
Defaulting PICO_GCC_TRIPLE to 'arm-none-eabi'
-- The C compiler identification is GNU 12.2.1
-- The CXX compiler identification is GNU 12.2.1
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/arm-none-eabi-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/arm-none-eabi-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/arm-none-eabi-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Build type is Release
-- Found Python3: /usr/bin/python3 (found version "3.11.2") found components: Interpreter
TinyUSB available at /home/devel/pico2/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; enabling build support for USB.
BTstack available at /home/devel/pico2/pico-sdk/lib/btstack
cyw43-driver available at /home/devel/pico2/pico-sdk/lib/cyw43-driver
lwIP available at /home/devel/pico2/pico-sdk/lib/lwip
mbedtls available at /home/devel/pico2/pico-sdk/lib/mbedtls
-- Found Git: /usr/bin/git (found version "2.39.5")
fatal: No names found, cannot describe anything.
-----------------------------------------------------
-- CMake 3.25.1
-- Build Release / PICO
-- USB_CONSOLE 0, using UART
-- building for pico, using flash file system
-----------------------------------------------------
-- Configuring done
-- Generating done
-- Build files have been written to: /home/devel/pshell/build

[ 81%] Building C object CMakeFiles/pshell.dir/openjpeg/openjpeg-lib/bio.c.o
[ 82%] Building C object CMakeFiles/pshell.dir/openjpeg/openjpeg-lib/cio.c.o
[ 83%] Building C object CMakeFiles/pshell.dir/openjpeg/openjpeg-lib/dwt.c.o
[ 84%] Building C object CMakeFiles/pshell.dir/openjpeg/openjpeg-lib/event.c.o
[ 84%] Building C object CMakeFiles/pshell.dir/openjpeg/openjpeg-lib/function_list.c.o
[ 85%] Building C object CMakeFiles/pshell.dir/openjpeg/openjpeg-lib/image.c.o
[ 86%] Building C object CMakeFiles/pshell.dir/openjpeg/openjpeg-lib/invert.c.o
[ 87%] Building C object CMakeFiles/pshell.dir/openjpeg/openjpeg-lib/j2k.c.o
[ 89%] Building C object CMakeFiles/pshell.dir/openjpeg/openjpeg-lib/mct.c.o
[ 90%] Building C object CMakeFiles/pshell.dir/openjpeg/openjpeg-lib/openjpeg.c.o
[ 90%] Building C object CMakeFiles/pshell.dir/openjpeg/openjpeg-lib/opj_clock.c.o
[ 91%] Building C object CMakeFiles/pshell.dir/openjpeg/openjpeg-lib/opj_malloc.c.o
[ 92%] Building C object CMakeFiles/pshell.dir/openjpeg/openjpeg-lib/pi.c.o
[ 93%] Building C object CMakeFiles/pshell.dir/openjpeg/openjpeg-lib/rd-wr-ops.c.o
[ 94%] Building C object CMakeFiles/pshell.dir/openjpeg/openjpeg-lib/sparse_array.c.o
[ 94%] Building C object CMakeFiles/pshell.dir/openjpeg/openjpeg-lib/t1.c.o
[ 95%] Building C object CMakeFiles/pshell.dir/openjpeg/openjpeg-lib/tcd.c.o
[ 96%] Building C object CMakeFiles/pshell.dir/openjpeg/openjpeg-lib/tgt.c.o
[ 97%] Building C object CMakeFiles/pshell.dir/openjpeg/openjpeg-lib/thread.c.o
[ 98%] Building C object CMakeFiles/pshell.dir/openjpeg/openjpeg-lib/dwtlift.c.o
/home/devel/pshell/openjpeg/openjpeg-lib/dwtlift.c: In function 'decompress':
/home/devel/pshell/openjpeg/openjpeg-lib/dwtlift.c:716:17: warning: implicit declaration of function 'octave_write_byte' [-Wimplicit-function-declaration]
  716 |                 octave_write_byte(r_decompress_fn,r_decompress,da_x1*da_y1);
      |                 ^~~~~~~~~~~~~~~~~
/home/devel/pshell/openjpeg/openjpeg-lib/dwtlift.c: In function 'lift_config':
/home/devel/pshell/openjpeg/openjpeg-lib/dwtlift.c:1131:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 1131 |         lclip = (char *)*bufferptr;
      |                 ^
[100%] Linking CXX executable pshell.elf
[100%] Built target pshell

devel@pi5-70:~/pshell/build $ scp pshell.uf2 pi4-50:/media/devel/RPI-RP2/

    cat - display a text file, use -p to paginate
     cc - compile & run C source file. cc -h for help
     cd - change directory
  clear - clear the screen
     cp - copy a file
 format - format the filesystem
    hex - simple hexdump, use -p to paginate
     ls - list a directory, -a to show hidden files
  mkdir - create a directory
  mount - mount the filesystem
     mv - rename a file or directory
   news - what's new in this release
   quit - shutdown the system
 reboot - restart the system
     rm - remove a file or directory. -r for recursive
 status - display the filesystem status
    tar - manage tar archives
 umount - unmount the filesystem
version - display pico shell's version
     vi - edit file(s) with vi
   xget - xmodem get a file (pico->host)
   xput - xmodem put a file (host->pico)
   yget - ymodem get a file (pico->host)
   yput - ymodem put a file (host->pico)
  lsklt - lifting step 0 klt 1
    j2k - In File Out Frile Compression Ratio Compression 0 Decompression 1
      # - comment line

/: mount

filesystem is mounted

/: ls

    4224 a64.bin
    4224 img1.pgm

xput lena_rgb_64.bin
   1|Sending lena_rgb_64.bmp, 97 blocks: Give your local XMODEM receive com|
  10|mand now.                                                             |
    |Bytes Sent:  12544   BPS:3027                                         |
/: r|                                                                      |
    |Transfer complete                                                     |
file|                                                                      |
    | READY: press any key to continue...

xput test.j2k

file|Sending test.j2k, 59 blocks: Give your local XMODEM receive command no|
    |w.                                                                    |
/: l|Bytes Sent:   7680   BPS:2909                                         |
    |                                                                      |
    |Transfer complete                                                     |
    |                                                                      |
  10| READY: press any key to continue...

/: ls

    4224 a64.bin
    4224 img1.pgm
   12544 lena_rgb_64.bmp
    7680 test.j2k
/: j2k
da_xo 0 da_y0 0
da_x1 256 da_y1 256 ff test.j2k

devel@pi4-50:~/dwtlift-pi/pi-myTTEncoder $ od -x lena_rgb_64.bmp | less

0000000 4d42 308a 0000 0000 0000 008a 0000 007c
0000020 0000 0040 0000 0040 0000 0001 0018 0000
0000040 0000 3000 0000 0b13 0000 0b13 0000 0000
0000060 0000 0000 0000 0000 00ff ff00 0000 00ff
0000100 0000 0000 0000 4742 7352 0000 0000 0000
0000120 0000 0000 0000 0000 0000 0000 0000 0000
*
0000160 0000 0000 0000 0000 0000 0002 0000 0000
0000200 0000 0000 0000 0000 0000 1b3d 595d 7742
	.
	.
	.
0027740 cd66 4056 58a2 ab47 4a55 55b0 b14b 4b55
0027760 57b1 ba52 5a59 5cc4 ca5e 625f 61cd cc64
0030000 635f 61cc cd64 6562 61d0 d265 6560 62d0
0030020 cf65 6762 65cf ce66 6667 60cb cc63 6662
0030040 5fcb ce63 6660 61d0 ce64 6563 61cd cc63
0030060 6261 61ca c961 6162 60ca c760 5a60 59bf
0030100 b151 5b5b 6ec1 d779 8671 6adc dc7e 806e
0030120 6cdc de81 7f68 67de de80 836a 6ddd dc84
0030140 a47b 9ae6 f8cf b789 5ce8 ae56 585d 5db8
0030160 bb5c 5d61 5cbb c05b 5e5e 5dc1 c15d 5f61
0030200 5ec2 c35e 5b5e 69bf c872

/: hex -p lena_rgb_64.bmp
0000 424d8a30 00000000 00008a00 00007c00 'BM.0..........|.'
0010 00004000 00004000 00000100 18000000 '..@...@.........'
0020 00000030 0000130b 0000130b 00000000 '...0............'
0030 00000000 00000000 ff0000ff 0000ff00 '................'
0040 00000000 00004247 52730000 00000000 '......BGRs......'
0050 00000000 00000000 00000000 00000000 '................'
0060 00000000 00000000 00000000 00000000 '................'
0070 00000000 00000000 00000200 00000000 '................'
0080 00000000 00000000 00003d1b 5d594277 '..........=.]YBw'
0090 a8b4d599 abd1636f ca7798e9 7da1ee6e '......co.w..}..n'
	.
	.
	.
3050 dc6c81de 687fde67 80de6a83 dd6d84dc '.l..h..g..j..m..'
3060 7ba4e69a cff889b7 e85c56ae 5d58b85d '{........\V.]X.]'
3070 5cbb615d bb5c5bc0 5e5ec15d 5dc1615f '\.a].\[.^^.]].a_'
3080 c25e5ec3 5e5bbf69 72c81a1a 1a1a1a1a '.^^.^[.ir.......'
3090 1a1a1a1a 1a1a1a1a 1a1a1a1a 1a1a1a1a '................'
30a0 1a1a1a1a 1a1a1a1a 1a1a1a1a 1a1a1a1a '................'
30b0 1a1a1a1a 1a1a1a1a 1a1a1a1a 1a1a1a1a '................'
30c0 1a1a1a1a 1a1a1a1a 1a1a1a1a 1a1a1a1a '................'
30d0 1a1a1a1a 1a1a1a1a 1a1a1a1a 1a1a1a1a '................'
30e0 1a1a1a1a 1a1a1a1a 1a1a1a1a 1a1a1a1a '................'
30f0 1a1a1a1a 1a1a1a1a 1a1a1a1a 1a1a1a1a '................'

devel@pi4-50:~/dwtlift-pi/pi-myTTEncoder $ od -x test.j2k | less
0000000 4fff 51ff 2f00 0000 0000 4000 0000 4000
0000020 0000 0000 0000 0000 0000 4000 0000 4000
0000040 0000 0000 0000 0000 0300 0107 0701 0101
0000060 0107 ff01 0052 000c 0000 0001 0405 0004
0000100 ff00 005c 4223 2077 f076 f076 c076 006f
0000120 006f e06e 5067 5067 6867 0550 0550 4750
0000140 d357 d357 6257 64ff 2500 0100 7243 6165
0000160 6574 2064 7962 4f20 6570 4a6e 4550 2047
0000200 6576 7372 6f69 206e 2e32 2e32 ff30 0090
0000220 000a 0000 1d00 002e ff01 c393 07f8 8d0a
0000240 17b6 1ea7 c348 08f8 9708 346c b9bb dfc3
0000260 f2c3 0c07 ba5f 692c 6362 f8c3 8107 03f9
	.
	.
	.
0016540 1097 9baf 737d 3aa0 de2b 22ec 4dd5 3e6d
0016560 d96c e91c 86b2 18d1 fa49 24b2 53f2 0873
0016600 410c dc75 ce54 3c8c 3965 3e1a d966 104a
0016620 275b 2948 fda5 d5ef b63b 1e64 a0f2 159a
0016640 ea5b 0ef7 fc3e 61b3 9314 0556 6c6a 5206
0016660 9602 d2a7 7c8a f5c2 a968 ff88 00d9

/: hex -p test.j2k
0000 ff4fff51 002f0000 00000040 00000040 '.O.Q./.....@...@'
0010 00000000 00000000 00000040 00000040 '...........@...@'
0020 00000000 00000000 00030701 01070101 '................'
0030 070101ff 52000c00 00000100 05040400 '....R...........'
0040 00ff5c00 23427720 76f076f0 76c06f00 '..\.#Bw v.v.v.o.'
0050 6f006ee0 67506750 67685005 50055047 'o.n.gPgPghP.P.PG'
0060 57d357d3 5762ff64 00250001 43726561 'W.W.Wb.d.%..Crea'
0070 74656420 6279204f 70656e4a 50454720 'ted by OpenJPEG '
0080 76657273 696f6e20 322e322e 30ff9000 'version 2.2.0...'
	.
	.
	.
1d50 130ec553 10dcbff9 2c0ed7ef 4504611b '...S....,...E.a.'
1d60 9710af9b 7d73a03a 2bdeec22 d54d6d3e '....}s.:+..".Mm>'
1d70 6cd91ce9 b286d118 49fab224 f2537308 'l.......I..$.Ss.'
1d80 0c4175dc 54ce8c3c 65391a3e 66d94a10 '.Au.T..<e9.>f.J.'
1d90 5b274829 a5fdefd5 3bb6641e f2a09a15 '['H)....;.d.....'
1da0 5beaf70e 3efcb361 14935605 6a6c0652 '[...>..a..V.jl.R'
1db0 0296a7d2 8a7cc2f5 68a988ff d91a1a1a '.....|..h.......'
1dc0 1a1a1a1a 1a1a1a1a 1a1a1a1a 1a1a1a1a '................'
1dd0 1a1a1a1a 1a1a1a1a 1a1a1a1a 1a1a1a1a '................'
1de0 1a1a1a1a 1a1a1a1a 1a1a1a1a 1a1a1a1a '................'
1df0 1a1a1a1a 1a1a1a1a 1a1a1a1a 1a1a1a1a '................'
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See LICENSE file for details.

platform: pico, console: UART0 [80 X 24], filesystem: flash

file system automatically mounted

enter a command or hit ENTER for command list

/: ls

    4224 a64.bin
    4224 img1.pgm
   12544 lena_rgb_64.bmp
    7680 test.j2k
…t.c ~/dwtlift-pi/pi-myTTEncoder/src/dwtlift.c

devel@pi5-70:~/pshell/build $ diffuse ../openjpeg/openjpeg-lib/dwtlift.h ~/dwtlift-pi/pi-myTTEncoder/src/dwtlift.h
devel@pi5-70:~/pshell/build $ diffuse ../openjpeg/openjpeg-lib/bio.c ~/dwtlift-pi/pi-myTTEncoder/src/bio.c
devel@pi5-70:~/pshell/build $ diffuse ../openjpeg/openjpeg-lib/bio.h ~/dwtlift-pi/pi-myTTEncoder/src/bio.h
devel@pi5-70:~/pshell/build $ diffuse ../openjpeg/openjpeg-lib/cio.c ~/dwtlift-pi/pi-myTTEncoder/src/cio.c
devel@pi5-70:~/pshell/build $ diffuse ../openjpeg/openjpeg-lib/dwt.c ~/dwtlift-pi/pi-myTTEncoder/src/dwt.c
devel@pi5-70:~/pshell/build $ diffuse ../openjpeg/openjpeg-lib/dwt.h ~/dwtlift-pi/pi-myTTEncoder/src/dwt.h

devel@pi5-70:~/pshell/build $ diffuse ../openjpeg/openjpeg-lib/event.c ~/dwtlift-pi/pi-myTTEncoder/src/event.c

devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/event.h ~/dwtlift-pi/pi-myTTEncoder/src/event.
diff: /home/devel/dwtlift-pi/pi-myTTEncoder/src/event.: No such file or directory
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/event.h ~/dwtlift-pi/pi-myTTEncoder/src/event.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/format_defs.h ~/dwtlift-pi/pi-myTTEncoder/src/format_defs.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/function_list.h ~/dwtlift-pi/pi-myTTEncoder/src/function_list.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/function_list.c ~/dwtlift-pi/pi-myTTEncoder/src/function_list.c
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/image.c ~/dwtlift-pi/pi-myTTEncoder/src/image.c
51,52c51,52
<         image->comps = (opj_image_comp_t*)opj_calloc(1,
<                        image->numcomps * sizeof(opj_image_comp_t));
---
>         image->comps = (opj_image_comp_t*)opj_calloc(image->numcomps,
>                        sizeof(opj_image_comp_t));
73c73
<                 // TODO event manager
---
>                 /* TODO event manager */
183c183
<                 opj_free(image_comp->data);
---
>                 opj_image_data_free(image_comp->data);
devel@pi5-70:~/pshell/build $ git status | less
modified:   ../openjpeg/openjpeg-lib/image.c
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/image.h ~/dwtlift-pi/pi-myTTEncoder/src/image.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/image.c ~/dwtlift-pi/pi-myTTEncoder/src/image.c
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/invert.c ~/dwtlift-pi/pi-myTTEncoder/src/invert.c
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/invert.h ~/dwtlift-pi/pi-myTTEncoder/src/invert.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/j2k.c ~/dwtlift-pi/pi-myTTEncoder/src/j2k.c
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/j2k.h ~/dwtlift-pi/pi-myTTEncoder/src/j2k.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/jp2.c ~/dwtlift-pi/pi-myTTEncoder/src/jp2.c
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/jp2.h ~/dwtlift-pi/pi-myTTEncoder/src/jp2.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/mct.c ~/dwtlift-pi/pi-myTTEncoder/src/mct.c
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/mct.h ~/dwtlift-pi/pi-myTTEncoder/src/mct.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/mqc.c ~/dwtlift-pi/pi-myTTEncoder/src/mqc.c
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/mqc.h ~/dwtlift-pi/pi-myTTEncoder/src/mqc.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/openjpeg.c ~/dwtlift-pi/pi-myTTEncoder/src/openjpeg.c
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/openjpeg.h ~/dwtlift-pi/pi-myTTEncoder/src/openjpeg.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/opj_clock.c ~/dwtlift-pi/pi-myTTEncoder/src/opj_clock.c
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/opj_clock.h ~/dwtlift-pi/pi-myTTEncoder/src/opj_clock.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/opj_codec.h ~/dwtlift-pi/pi-myTTEncoder/src/opj_codec.h
113a114,118
>             /** Set the decoded components */
>             OPJ_BOOL(*opj_set_decoded_components)(void * p_codec,
>                                                   OPJ_UINT32 num_comps,
>                                                   const OPJ_UINT32* comps_indices,
>                                                   opj_event_mgr_t * p_manager);
devel@pi5-70:~/pshell/build $ cp ~/dwtlift-pi/pi-myTTEncoder/src/opj_codec.h ../openjpeg/openjpeg-lib/opj_codec.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/opj_codec.h ~/dwtlift-pi/pi-myTTEncoder/src/opj_codec.h
devel@pi5-70:~/pshell/build $ mv ../openjpeg/openjpeg-lib/opj_codec.h ~/master-repos/pshell/openjpeg/openjpeg-lib/
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/opj_codec.h ~/dwtlift-pi/pi-myTTEncoder/src/opj_codec.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/opj_common.h ~/dwtlift-pi/pi-myTTEncoder/src/opj_common.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/opj_config.h ~/dwtlift-pi/pi-myTTEncoder/src/opj_config.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/opj_config_private.h ~/dwtlift-pi/pi-myTTEncoder/src/opj_config_private.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/opj_includes.h ~/dwtlift-pi/pi-myTTEncoder/src/opj_includes.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/opj_intmath.h ~/dwtlift-pi/pi-myTTEncoder/src/opj_intmath.h
98a99,107
>  Get the saturated difference of two unsigned integers
>  @return Returns saturated sum of a-b
>  */
> static INLINE OPJ_UINT32 opj_uint_subs(OPJ_UINT32 a, OPJ_UINT32 b)
> {
>     return (a >= b) ? a - b : 0;
> }
>
> /**
117a127,148
>
> /**
> Clamp an integer inside an interval
> @return
> <ul>
> <li>Returns a if (min < a < max)
> <li>Returns max if (a > max)
> <li>Returns min if (a < min)
> </ul>
> */
> static INLINE OPJ_INT64 opj_int64_clamp(OPJ_INT64 a, OPJ_INT64 min,
>                                         OPJ_INT64 max)
> {
>     if (a < min) {
>         return min;
>     }
>     if (a > max) {
>         return max;
>     }
>     return a;
> }
>
142c173
<     return (a + b - 1) / b;
---
>     return (OPJ_UINT32)(((OPJ_UINT64)a + b - 1) / b);
devel@pi5-70:~/pshell/build $ cp ~/dwtlift-pi/pi-myTTEncoder/src/opj_intmath.h ../openjpeg/openjpeg-lib/
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/opj_intmath.h ~/dwtlift-pi/pi-myTTEncoder/src/opj_intmath.h
devel@pi5-70:~/pshell/build $ mv ../openjpeg/openjpeg-lib/opj_intmath.h ~/master-repos/pshell/openjpeg/openjpeg-lib/
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/opj_inttypes.h ~/dwtlift-pi/pi-myTTEncoder/src/opj_inttypes.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/opj_malloc.c ~/dwtlift-pi/pi-myTTEncoder/src/opj_malloc.c
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/opj_malloc.h ~/dwtlift-pi/pi-myTTEncoder/src/opj_malloc.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/opj_stdint.h ~/dwtlift-pi/pi-myTTEncoder/src/opj_stdint.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/pi.c ~/dwtlift-pi/pi-myTTEncoder/src/pi.c
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/pi.h ~/dwtlift-pi/pi-myTTEncoder/src/pi.h
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/rd-wr-ops.c ~/dwtlift-pi/pi-myTTEncoder/src/rd-wr-ops.c
86c86
< /*
---
>
92c92
< */
---
>
devel@pi5-70:~/pshell/build $ cp ~/dwtlift-pi/pi-myTTEncoder/src/rd-wr-ops.c ../openjpeg/openjpeg-lib/
devel@pi5-70:~/pshell/build $ diff ../openjpeg/openjpeg-lib/rd-wr-ops.c ~/dwtlift-pi/pi-myTTEncoder/src/rd-wr-ops.c
devel@pi5-70:~/pshell/build $ mv ../openjpeg/openjpeg-lib/rd-wr-ops.c ~/master-repos/pshell/openjpeg/openjpeg-lib/
develone added 30 commits June 17, 2026 04:38
…ch file or directory

   30 | #include "encode_decode.h"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/pshell.dir/build.make:76: CMakeFiles/pshell.dir/shell.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1998: CMakeFiles/pshell.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

devel@pi5-70:~/master-repos/pshell $ diff encode_decode.h ../dwtlift-pi/encode_decode/encode_decode.h
This was added many builds and will require a change to compare.sh
…ch file or directory

   30 | #include "encode_decode.h"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/pshell.dir/build.make:76: CMakeFiles/pshell.dir/shell.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1998: CMakeFiles/pshell.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

devel@pi5-70:~/master-repos/pshell $ diff encode_decode.h ../dwtlift-pi/encode_decode/encode_decode.h
This was added many builds and will require a change to compare.sh

devel@pi5-70:~/pshell $ ./compare.sh
914c914
< 	printf("size %ld ",imgsz);
---
> 	printf("size %d ",imgsz);
1010a1011,1013
>     FILTER = 0;
>     //FILTER 0 5/3 DWT
>     //FILTER 1 9/7 DWT
1011a1015
>
devel@pi5-70:~/pshell/build-rp2040 $ and
devel@pi5-70:~/pshell/build-rp2350 $
diff --git a/openjpeg/CMakeLists.txt b/openjpeg/CMakeLists.txt
index 89fb444..084a216 100644
--- a/openjpeg/CMakeLists.txt
+++ b/openjpeg/CMakeLists.txt
@@ -44,8 +44,6 @@ target_sources(openjpeg INTERFACE
     ${CMAKE_CURRENT_LIST_DIR}/openjpeg-lib/pi.h
                ${CMAKE_CURRENT_LIST_DIR}/openjpeg-lib/rdwr.h
                ${CMAKE_CURRENT_LIST_DIR}/openjpeg-lib/rd-wr-ops.c
-    ${CMAKE_CURRENT_LIST_DIR}/openjpeg-lib/sparse_array.c
-    ${CMAKE_CURRENT_LIST_DIR}/openjpeg-lib/sparse_array.h
     ${CMAKE_CURRENT_LIST_DIR}/openjpeg-lib/t1.c
     ${CMAKE_CURRENT_LIST_DIR}/openjpeg-lib/t1.h
     ${CMAKE_CURRENT_LIST_DIR}/openjpeg-lib/t1_luts.h
plus chgs to openjpeg/openjpeg-lib/opj_includes.h
        modified:   opj_codec.h
        modified:   opj_intmath.h
        modified:   thread.c

devel@pi5-70:~/pshell $ ./compare.sh
914c914
< 	printf("size %ld ",imgsz);
---
> 	printf("size %d ",imgsz);
1010a1011,1013
>     FILTER = 0;
>     //FILTER 0 5/3 DWT
>     //FILTER 1 9/7 DWT
1011a1015
>
51,52c51,52
<         image->comps = (opj_image_comp_t*)opj_calloc(image->numcomps,
<                        sizeof(opj_image_comp_t));
---
>         image->comps = (opj_image_comp_t*)opj_calloc(1,
>                        image->numcomps * sizeof(opj_image_comp_t));
73c73
<                 /* TODO event manager */
---
>                 // TODO event manager
183c183
<                 opj_image_data_free(image_comp->data);
---
>                 opj_free(image_comp->data);
…rc/dwtlift.c openjpeg/openjpeg-lib/

devel@pi5-70:~/master-repos/pshell $ git status | less
devel@pi5-70:~/master-repos/pshell $ git diff openjpeg/openjpeg-lib/dwtlift.c
diff --git a/openjpeg/openjpeg-lib/dwtlift.c b/openjpeg/openjpeg-lib/dwtlift.c
index 4365e8f..a1bdbca 100644
--- a/openjpeg/openjpeg-lib/dwtlift.c
+++ b/openjpeg/openjpeg-lib/dwtlift.c
@@ -911,7 +911,7 @@ printf("data bufferptr 0x%x first byte %d \n",bufferptr, *bufferptr);
        struct GPU_FFT_HOST host;

        printf ("Hello Ultibo from C!! Called by Pascal ");
-       printf("size %ld ",imgsz);
+       printf("size %d ",imgsz);
        printf("pointer passed  %x ",bufferptr);

        printf("starting compression: %ld seconds %ld useconds %ld \n", mtime,seconds, useconds);
@@ -1008,7 +1008,11 @@ printf("data bufferptr 0x%x first byte %d \n",bufferptr, *bufferptr);
     tile_width = width;
     tile_height = height;
     comp_prec = 8;
+    FILTER = 0;
+    //FILTER 0 5/3 DWT
+    //FILTER 1 9/7 DWT
     irreversible = FILTER;
+
     output_file = "test.j2k";

   if( num_comps > NUM_COMPS_MAX )
devel@pi5-70:~/dwtlift-pi/encode_decode $ ./Encoder lena_rgb_64.bmp
devel@pi5-70:~/dwtlift-pi/encode_decode $ ./Decoder 64 64 test.j2k
pico2
xput blue
xput green
xput red
/: ls

    4224 a64.bin
    4160 bb.bin
    4096 blue
    4096 green
     128 hello.c
   12544 lena_rgb_64.bmp
    4096 red
     384 sine.c
     128 test.c
    8064 test.j2k
00000000   01 00 00 00  FE FF FE FF  FE FF FF FF  FC FF 02 00  12 00 22 00  2D 00 18 00  ..................".-...
00000018   FF FF FF FF  00 00 FD FF  FE FF 00 00  01 00 00 00  01 00 01 00  01 00 03 00  ........................
00000030   03 00 04 00  04 00 03 00  02 00 03 00  02 00 00 00  02 00 03 00  04 00 09 00  ........................
00000048   07 00 04 00  04 00 06 00  04 00 01 00  00 00 FB FF  FA FF FD FF  FE FF 00 00  ........................
00000060   05 00 17 00  15 00 F0 FF  C0 FF A7 FF  A6 FF A8 FF  B1 FF B9 FF  BD FF DB FF  ........................
00000078   DF FF DD FF  E0 FF E2 FF  FF FF 00 00  FF FF FE FF  01 00 04 00  02 00 F6 FF  ........................
00000090   E0 FF DA FF  E9 FF EF FF  F0 FF F0 FF  EF FF F2 FF  F4 FF F5 FF  F5 FF F4 FF  ........................
000000A8   F3 FF F7 FF  F7 FF F6 FF  F5 FF F4 FF  F4 FF F4 FF  F3 FF F4 FF  F5 FF F5 FF  ........................
000000C0   F3 FF F1 FF  F0 FF F0 FF  EF FF EE FF  EC FF EB FF  EC FF E9 FF  E9 FF EC FF  ........................
000000D8   EF FF F6 FF  02 00 FF FF  F8 FF F2 FF  F2 FF 02 00  1B 00 28 00  2E 00 32 00  ..................(...2.
000000F0   35 00 36 00  3B 00 37 00  2C 00 2C 00  39 00 38 00  FE FF 00 00  05 00 04 00  5.6.;.7.,.,.9.8.........
00000108   02 00 00 00  05 00 0C 00  11 00 10 00  0E 00 0D 00  0C 00 0C 00  0E 00 0E 00  ........................
00000120   0D 00 09 00  0B 00 0D 00  0C 00 0B 00  0A 00 0B 00  0A 00 0D 00  0E 00 0E 00  ........................
00000138   0E 00 0E 00  0E 00 0E 00  0F 00 12 00  12 00 12 00  14 00 14 00  16 00 17 00  ........................
00000150   14 00 0F 00  10 00 0F 00  0E 00 0C 00  08 00 09 00  0E 00 13 00  17 00 16 00  ........................

00000A50   FA FF FD FF  06 00 1D 00  03 00 E1 FF  EA FF F9 FF  F0 FF 0F 00  03 00 00 00  ........................
00000A68   00 00 00 00  01 00 01 00  FE FF FF FF  FF FF FE FF  FF FF FF FF  FE FF 00 00  ........................
00000A80   08 00 09 00  09 00 08 00  05 00 06 00  08 00 0A 00  0C 00 0B 00  0C 00 0C 00  ........................
00000A98   0E 00 0F 00  0D 00 F5 FF  F2 FF 0C 00  04 00 01 00  02 00 01 00  01 00 02 00  ........................
00000AB0   09 00 D8 FF  F9 FF 13 00  20 00 23 00  22 00 F9 FF  FF FF 27 00  01 00 03 00  ........ .#.".....'.....
00000AC8   0B 00 0F 00  14 00 10 00  FB FF E1 FF  E5 FF F6 FF  FA FF FD FF  FB FF F6 FF  ........................
00000AE0   F4 FF DA FF  10 00 19 00  02 00 01 00  03 00 02 00  01 00 02 00  01 00 02 00  ........................
00000AF8   FF FF 00 00  00 00 FE FF  00 00 00 00  00 00 01 00  02 00 02 00  01 00 FF FF  ........................
00000B10   00 00 07 00  0D 00 0C 00  0D 00 0D 00  0E 00 0E 00  04 00 02 00  01 00 01 00  ........................
00000B28   FF FF 02 00  06 00 0E 00  F2 FF F8 FF  FB FF EC FF  CF FF BE FF  C0 FF D3 FF  ........................
00000B40   E2 FF E7 FF  E9 FF E5 FF  EA FF EE FF  FD FF 08 00  0D 00 11 00  10 00 0D 00  ........................
00000B58   0D 00 0A 00  0B 00 09 00  0A 00 09 00  05 00 D1 FF  00 00 38 00  33 00 1E 00  ..................8.3...
00000B70   0E 00 03 00  01 00 01 00  02 00 02 00  00 00 02 00  FF FF FF FF  00 00 01 00  ........................

00000EB8   FF FF FD FF  FF FF FF FF  00 00 01 00  01 00 FE FF  EE FF F6 FF  10 00 13 00  ........................
00000ED0   07 00 02 00  05 00 06 00  02 00 FF FF  00 00 FD FF  FF FF 04 00  17 00 23 00  ......................#.
00000EE8   05 00 E3 FF  DF FF F0 FF  FA FF FF FF  00 00 03 00  0E 00 F8 FF  F7 FF FA FF  ........................
00000F00   01 00 01 00  12 00 0A 00  E9 FF FE FF  04 00 01 00  FF FF 01 00  F9 FF F4 FF  ........................
00000F18   F4 FF 1A 00  08 00 FF FF  05 00 02 00  00 00 00 00  01 00 00 00  FF FF 00 00  ........................
00000F30   00 00 00 00  01 00 FF FF  01 00 00 00  00 00 03 00  03 00 02 00  FA FF 04 00  ........................
00000F48   0D 00 01 00  FD FF 02 00  01 00 FE FF  00 00 00 00  FF FF 02 00  00 00 02 00  ........................
00000F60   0F 00 11 00  DD FF FA FF  00 00 0A 00  0B 00 00 00  FA FF 08 00  00 00 F4 FF  ........................
00000F78   01 00 12 00  02 00 05 00  F7 FF 0A 00  EB FF FB FF  01 00 00 00  FF FF FF FF  ........................
00000F90   03 00 ED FF  F4 FF 12 00  00 00 05 00  04 00 01 00  FF FF 00 00  00 00 01 00  ........................
00000FA8   01 00 01 00  01 00 01 00  01 00 01 00  00 00 01 00  01 00 02 00  FF FF 02 00  ........................
00000FC0   00 00 FA FF  05 00 02 00  FD FF 01 00  04 00 00 00  01 00 01 00  02 00 01 00  ........................
00000FD8   01 00 FF FF  00 00 06 00  F1 FF F2 FF  05 00 08 00  FB FF FE FF  07 00 05 00  ........................
00000FF0   FE FF 07 00  0F 00 05 00  FD FF F7 FF  FB FF F2 FF
diff --git a/shell.c b/shell.c
index d314b26..1fe8c4e 100644
--- a/shell.c
+++ b/shell.c
@@ -450,8 +450,9 @@ testpgm_cmd (void)
     printf("\n");
     fs_file_close (&in);
     printf ("%d \n", fs_file_open (&out, "dwt.bin", LFS_O_WRONLY | LFS_O_CREAT));
-    fs_file_write(&out, &buffer[4096], 4096);
+    fs_file_write(&out, &buffer[4096], 8192);
     fs_file_close (&out);
+    printf("%d \n",sizeof(buffer));

 }
These chgs were the fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant