-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Langwen Huang
committed
Nov 14, 2024
1 parent
7d2ba6b
commit ef27cfb
Showing
5 changed files
with
87 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
#include <cstdlib> | ||
#include "Encoder.h" | ||
#include "Decoder.h" | ||
#include "spiht.h" | ||
|
||
|
||
extern "C" | ||
void spiht_encode(float *buffer, size_t height, size_t width, uint8_t **out_buffer, size_t *output_size, int num_stages, float* max_val) { | ||
extern "C" void spiht_encode(float *buffer, size_t height, size_t width, uint8_t **out_buffer, size_t *output_size, int num_stages, float* max_val) { | ||
Encoder encoder; | ||
encoder.encode_image(buffer, height, width, out_buffer, output_size, num_stages, max_val); | ||
} | ||
|
||
extern "C" | ||
void spiht_decode(uint8_t *buffer, size_t size, float *out_buffer, size_t height, size_t width, int num_bits, float max_val) { | ||
|
||
extern "C" void spiht_decode(uint8_t *buffer, size_t size, float *out_buffer, size_t height, size_t width, int num_bits, float max_val) { | ||
Decoder decoder; | ||
decoder.decode_image(buffer, size, out_buffer, height, width, num_bits, max_val); | ||
} | ||
|
||
extern "C" void spiht_destroy_buffer(uint8_t *buffer) { | ||
free(buffer); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
#ifndef SPIHT_H | ||
#define SPIHT_H | ||
|
||
#include <cstddef> | ||
#include <cstdint> | ||
#ifndef SPIHT_F_H | ||
#define SPIHT_F_H | ||
|
||
#include <stddef.h> | ||
#include <stdint.h> | ||
#ifdef __cplusplus | ||
extern "C" { | ||
void spiht_encode(float *buffer, size_t height, size_t width, uint8_t **out_buffer, size_t *output_size, int num_stages, float* max_val); | ||
void spiht_decode(uint8_t *buffer, size_t size, float *out_buffer, size_t height, size_t width, int num_bits, float max_val); | ||
#endif | ||
void spiht_encode(float *buffer, size_t height, size_t width, uint8_t **out_buffer, size_t *output_size, int num_stages, float* max_val); | ||
void spiht_decode(uint8_t *buffer, size_t size, float *out_buffer, size_t height, size_t width, int num_bits, float max_val); | ||
void spiht_destroy_buffer(uint8_t *buffer); | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif // SPIHT_H | ||
#endif // SPIHT_F_H |