43#include "gtest/gtest.h"
51TEST(TestMixedCOC, FourCompMixedReversibility) {
60 std::vector<ojph::si32> comp3_orig(width * height);
87 j2c_file.
open(
"mixed_rev_irrev_4comp.j2c");
97 ASSERT_EQ(next_comp, c);
104 cur_line->
i32[x] = val;
105 comp3_orig[y * width + x] = val;
109 memset(cur_line->
i32, 0,
112 memset(cur_line->
f32, 0,
113 sizeof(
float) * cur_line->
size);
114 cur_line = codestream.
exchange(cur_line, next_comp);
126 j2c_file.
open(
"mixed_rev_irrev_4comp.j2c");
139 <<
"Component " << c <<
" should be irreversible";
143 <<
"Component 3 should be reversible";
159 ASSERT_EQ(comp_num, c);
162 ASSERT_EQ(comp_width, width);
164 EXPECT_EQ(line->
i32[x], comp3_orig[y * width + x])
165 <<
"Component 3 sample mismatch at (" << x <<
", " << y <<
")";
175int main(
int argc,
char** argv) {
176 ::testing::InitGoogleTest(&argc, argv);
177 return RUN_ALL_TESTS();
The object represent a codestream.
param_siz access_siz()
Returns the underlying SIZ marker segment object.
param_cod access_cod()
Returns the underlying COD marker segment object.
void restrict_input_resolution(ui32 skipped_res_for_data, ui32 skipped_res_for_recon)
This function restricts resolution decoding for a codestream. It is for a reading (decoding) codestre...
void close()
Call this function to close the underlying file; works for both encoding and decoding codestreams.
void set_planar(bool planar)
Sets the sequence of pushing or pull rows from the machinery.
line_buf * exchange(line_buf *line, ui32 &next_component)
This call is used to send image data rows to the library. We expect to send one row from a single com...
param_qcd access_qcd()
Returns the underlying QCD marker segment object.
void read_headers(infile_base *file)
This call reads the headers of a codestream. It is for a reading (or decoding) codestream,...
void write_headers(outfile_base *file, const comment_exchange *comments=NULL, ui32 num_comments=0)
Writes codestream headers when the codestream is used for writing. This function should be called aft...
void create()
This call is for a decoding (or reading) codestream. Call this function after calling restrict_input_...
void flush()
This is the last call to a writing (encoding) codestream. This will write encoded bitstream data to t...
line_buf * pull(ui32 &comp_num)
This call is to pull one row from the codestream, being decoded. The returned line_buf object holds o...
void open(const char *filename)
void open(const char *filename)
void set_num_decomposition(ui32 num_decompositions)
bool is_reversible() const
void set_block_dims(ui32 width, ui32 height)
void set_color_transform(bool color_transform)
void set_reversible(bool reversible)
void set_irrev_quant(float delta)
Set the irreversible quantization base delta.
void set_tile_size(size s)
void set_component(ui32 comp_num, const point &downsampling, ui32 bit_depth, bool is_signed)
void set_num_components(ui32 num_comps)
ui32 get_bit_depth(ui32 comp_num) const
void set_tile_offset(point offset)
void set_image_offset(point offset)
ui32 get_recon_height(ui32 comp_num) const
void set_image_extent(point extent)
ui32 get_recon_width(ui32 comp_num) const
ui32 get_num_components() const
int main(int argc, char **argv)
TEST(TestMixedCOC, FourCompMixedReversibility)